/*
 * pba-storefront — Responsive & nav overrides
 * Loaded after style.css
 */

/* ============================================================
   RESET FIXED WIDTHS — make everything fluid
   ============================================================ */
#templatemo_container,
#templatemo_menu,
#templatemo_content,
#templatemo_footer {
    width: 100%;
    max-width: 980px;
    box-sizing: border-box;
}

/* ============================================================
   TOP NAV
   ============================================================ */
#templatemo_nav {
    position: relative;
    width: 100%;
    background: url(../images/templatemo_menu_bg.jpg) repeat-x center;
    background-size: auto 100%;
    min-height: 45px;
    z-index: 1000;
}

/* Hide hamburger on desktop */
.pba-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 1001;
}
.pba-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #c9c840;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.25s ease;
}

/* Nav inner — flex row on desktop */
#pba-nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Primary WP menu */
#pba-nav-inner .nav-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 8px 0 0 0;
}
#pba-nav-inner .nav-menu li {
    display: inline-block;
}
#pba-nav-inner .nav-menu li a {
    display: block;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: bold;
    color: #969547;
    text-decoration: none;
    white-space: nowrap;
}
#pba-nav-inner .nav-menu li a:hover {
    color: #fcf88e;
}

/* ============================================================
   CONDENSED GENRE NAV
   ============================================================ */
#pba-genre-nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 8px 0 0 0;
    border-top: 1px solid #3a3830;
    width: 100%;
}

#pba-genre-nav > li {
    position: relative;
    display: inline-block;
}

#pba-genre-nav > li > a {
    display: block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: bold;
    color: #cbc750;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-right: 1px solid #4a4535;
}
#pba-genre-nav > li:last-child > a {
    border-right: none;
}
#pba-genre-nav > li > a:hover,
#pba-genre-nav > li.open > a {
    color: #fcf88e;
}

/* Dropdown arrow indicator */
#pba-genre-nav .genre-parent > a::after {
    content: ' ▾';
    font-size: 10px;
    opacity: 0.7;
}

/* Sub-menu dropdown */
#pba-genre-nav .genre-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #1a1a18;
    border: 1px solid #3a3830;
    border-top: 2px solid #cbc750;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
#pba-genre-nav .genre-parent.open .genre-dropdown,
#pba-genre-nav .genre-parent:hover .genre-dropdown {
    display: block;
}
#pba-genre-nav .genre-dropdown li a {
    display: block;
    padding: 7px 16px;
    font-size: 11px;
    color: #969547;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px solid #2a2a28;
}
#pba-genre-nav .genre-dropdown li:last-child a {
    border-bottom: none;
}
#pba-genre-nav .genre-dropdown li a:hover {
    color: #fcf88e;
    background: #252520;
}

/* ============================================================
   LANGUAGE NAV
   ============================================================ */
#pba-lang-nav {
    width: 100%;
    border-top: 1px solid #3a3830;
    padding: 6px 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
}
#pba-lang-nav li {
    display: inline-block;
}
#pba-lang-nav li a {
    display: block;
    padding: 4px 10px;
    font-size: 11px;
    color: #969547;
    text-decoration: none;
    border-right: 1px solid #4a4535;
}
#pba-lang-nav li:last-child a {
    border-right: none;
}
#pba-lang-nav li a:hover,
#pba-lang-nav li.active a {
    color: #fcf88e;
}

/* ============================================================
   HEADER — responsive layout
   ============================================================ */
#templatemo_header {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 200px;
    background-size: cover;
    background-position: center top;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    padding-bottom: 16px;
    box-sizing: border-box;
}

#templatemo_blog {
    position: static;
    flex: 0 0 48%;
    text-align: center;
    padding: 20px 10px 10px 20px;
}

#templatemo_special_offers {
    flex: 0 0 24%;
    font-size: 13px;
    padding: 12px 8px;
    margin: 0;
}

#templatemo_new_books {
    flex: 0 0 24%;
    padding: 12px 8px;
    margin: 0;
}

/* ============================================================
   CONTENT AREA — responsive columns
   ============================================================ */
#templatemo_content {
    display: flex;
    flex-wrap: wrap;
    padding: 0 10px;
    box-sizing: border-box;
}

#templatemo_content_left {
    flex: 0 0 210px;
    max-width: 210px;
    padding: 10px;
    box-sizing: border-box;
    background-color: #171716;
    border: 1px solid #212120;
}

#templatemo_content_right {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 10px;
    box-sizing: border-box;
}

/* Book grid cards */
.inner-for-box,
.inner-for-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.inner-for-box .templatemo_product_box,
.inner-for-group .templatemo_product_box {
    flex: 1 1 300px;
    max-width: 350px;
    box-sizing: border-box;
    min-height: 0 !important;
}

/* ============================================================
   BUTTON CONTAINER — side-by-side vendor + buy columns
   ============================================================ */
.button-container {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    width: auto;
    position: static;
}

.vendor-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.store-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

/* Direct Buy button */
.pba-buy-btn {
    display: block;
    text-align: center;
    padding: 9px 18px;
    background: #2a7a2a;
    color: #fff !important;
    font-weight: bold;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}
.pba-buy-btn:hover {
    background: #3a9a3a;
    color: #fff !important;
}

.pba-cart-btn {
    display: block;
    text-align: center;
    padding: 7px 14px;
    background: #5a4a10;
    color: #fcf88e !important;
    font-weight: bold;
    font-size: 12px;
    border-radius: 6px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}
.pba-cart-btn:hover {
    background: #7a6418;
    color: #fff !important;
}

.pba-price-tag {
    font-size: 16px;
    font-weight: bold;
    color: #fcf88e;
    margin-bottom: 8px;
    display: block;
}

/* Cart icon in nav */
.pba-cart-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    color: #cbc750;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
}
.pba-cart-count {
    background: #c82020;
    color: #fff;
    border-radius: 50%;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

/* ============================================================
   BOOK LANDING PAGE
   ============================================================ */
.pba-landing-wrap {
    padding: 20px;
    max-width: 900px;
}

.pba-landing-hero {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.pba-landing-cover {
    flex: 0 0 200px;
}
.pba-landing-cover img {
    width: 100%;
    height: auto;
    border: 2px solid #3a3830;
}

.pba-landing-info {
    flex: 1 1 280px;
}
.pba-landing-info h1 {
    font-size: 22px;
    color: #cbc750;
    margin: 0 0 12px 0;
}
.pba-landing-info .pba-series-label {
    font-size: 12px;
    color: #969547;
    margin-bottom: 10px;
}

.pba-landing-desc {
    margin-bottom: 24px;
    line-height: 1.6;
    font-size: 12px;
}

/* Series section on landing page */
.pba-series-section {
    margin-top: 32px;
    border-top: 1px solid #3a3830;
    padding-top: 20px;
}
.pba-series-section h2 {
    font-size: 16px;
    color: #cbc750;
    margin-bottom: 16px;
}
.pba-series-books {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.pba-series-book-card {
    flex: 0 0 140px;
    text-align: center;
}
.pba-series-book-card img {
    width: 120px;
    height: auto;
    border: 1px solid #3a3830;
    margin-bottom: 6px;
}
.pba-series-book-card .card-title {
    font-size: 11px;
    color: #cbc750;
    display: block;
    margin-bottom: 6px;
}
.pba-series-book-card.current-book img {
    border-color: #cbc750;
    opacity: 0.7;
}

/* Discount badge on series section */
.pba-series-discount-note {
    font-size: 12px;
    color: #fcf88e;
    background: #2a2410;
    border: 1px solid #5a4a10;
    border-radius: 4px;
    padding: 8px 14px;
    margin-bottom: 14px;
    display: inline-block;
}

/* ============================================================
   MINI CART FLYOUT
   ============================================================ */
#pba-cart-flyout {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    max-width: 95vw;
    height: 100vh;
    background: #1a1a18;
    border-left: 2px solid #3a3830;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.6);
}
#pba-cart-flyout.open {
    display: block;
}
#pba-cart-flyout h2 {
    color: #cbc750;
    font-size: 16px;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3830;
}
#pba-cart-flyout .pba-close-cart {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #cbc750;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.pba-cart-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #2a2a28;
    align-items: flex-start;
}
.pba-cart-item img {
    width: 50px;
    height: auto;
    flex-shrink: 0;
}
.pba-cart-item-info {
    flex: 1;
    font-size: 12px;
}
.pba-cart-item-title {
    color: #cbc750;
    font-weight: bold;
    margin-bottom: 4px;
}
.pba-cart-item-price {
    color: #fcf88e;
}
.pba-remove-item {
    background: none;
    border: none;
    color: #c84040;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}
#pba-cart-total {
    margin-top: 14px;
    font-size: 14px;
    font-weight: bold;
    color: #fcf88e;
    text-align: right;
}
#pba-cart-checkout-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    background: #2a7a2a;
    color: #fff;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}
#pba-cart-checkout-btn:hover {
    background: #3a9a3a;
}
#pba-cart-empty-msg {
    color: #777;
    font-size: 13px;
    text-align: center;
    margin-top: 40px;
}

/* Cart overlay */
#pba-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
#pba-cart-overlay.open {
    display: block;
}

/* ============================================================
   FOOTER
   ============================================================ */
#templatemo_footer {
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
}

/* ============================================================
   TABLET — max-width: 900px
   ============================================================ */
@media (max-width: 900px) {
    #templatemo_blog    { flex: 0 0 50%; }
    #templatemo_special_offers,
    #templatemo_new_books { flex: 0 0 46%; }

    #templatemo_content_left { flex: 0 0 160px; max-width: 160px; }
}

/* ============================================================
   MOBILE — max-width: 768px
   ============================================================ */
@media (max-width: 768px) {

    /* Show hamburger, hide nav by default */
    .pba-hamburger { display: block; }

    #pba-nav-inner {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        background: #1a1a18;
        border-top: 2px solid #3a3830;
        width: 100%;
        padding: 0 0 12px 0;
    }
    #pba-nav-inner.open { display: flex; }

    /* Primary nav stacks vertically */
    #pba-nav-inner .nav-menu { flex-direction: column; width: 100%; padding: 0; }
    #pba-nav-inner .nav-menu li { display: block; }
    #pba-nav-inner .nav-menu li a { padding: 10px 18px; border-bottom: 1px solid #2a2a28; font-size: 13px; }

    /* Genre nav stacks */
    #pba-genre-nav { flex-direction: column; }
    #pba-genre-nav > li > a { padding: 10px 18px; border-right: none; border-bottom: 1px solid #2a2a28; font-size: 13px; }

    /* Dropdowns slide in-place on mobile */
    #pba-genre-nav .genre-dropdown {
        position: static;
        display: none;
        border: none;
        border-top: none;
        background: #141412;
        box-shadow: none;
        padding: 0;
    }
    #pba-genre-nav .genre-parent.open .genre-dropdown { display: block; }
    #pba-genre-nav .genre-dropdown li a { padding: 9px 32px; font-size: 12px; }

    /* Language nav wraps */
    #pba-lang-nav { padding: 8px 0; border-top: 1px solid #3a3830; }
    #pba-lang-nav li a { padding: 6px 10px; font-size: 12px; }

    /* Header stacks */
    #templatemo_header {
        flex-direction: column;
        align-items: center;
        min-height: auto;
        padding: 16px;
        height: auto !important;
    }
    #templatemo_blog,
    #templatemo_special_offers,
    #templatemo_new_books {
        flex: 0 0 100%;
        width: 100%;
        text-align: center;
        padding: 10px 0;
        margin: 0 !important;
        position: static !important;
    }

    /* Content stacks */
    #templatemo_content { flex-direction: column; }
    #templatemo_content_left { flex: 0 0 auto; max-width: 100%; width: 100%; }
    #templatemo_content_right { padding-left: 0; }

    /* Product cards full-width on phone */
    .inner-for-box .templatemo_product_box,
    .inner-for-group .templatemo_product_box {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Book landing hero stacks */
    .pba-landing-hero { flex-direction: column; }
    .pba-landing-cover { flex: 0 0 auto; max-width: 180px; margin: 0 auto; }

    /* Button layout stacks on small phones */
    .button-container { flex-direction: column; }
}

/* ============================================================
   VERY SMALL PHONES — max-width: 400px
   ============================================================ */
@media (max-width: 400px) {
    #templatemo_title { font-size: 28px !important; }
    #pba-genre-nav > li > a { font-size: 12px; }
    .pba-series-books { justify-content: center; }
    .pba-series-book-card { flex: 0 0 120px; }
}
