/*
Theme Name: Heyy Comics
Template: storefront
Description: Custom storefront for Heyy Comics
Version: 4.5
*/

/* ---- FONTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ---- BRAND VARIABLES ---- */
:root {
    --bg: #0c0c0f;
    --bg-card: #151519;
    --bg-elevated: #1c1c22;
    --text: #ece8e1;
    --text-mid: #a8a19a;
    --text-dim: #6b6560;
    --red: #d32f2f;
    --red-dark: #b71c1c;
    --yellow: #ffd54f;
    --blue: #4A9FD8;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

/* ---- GLOBAL ---- */
body,
.site-content,
.content-area {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
}

a {
    color: var(--red);
}

a:hover {
    color: var(--yellow);
}

h1, h2, h3, h4, h5, h6,
.woocommerce div.product .product_title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-display);
    color: var(--text);
    letter-spacing: 1px;
}

/* ---- HEADER BASE ---- */
.site-header {
    background: var(--bg) !important;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.site-header .site-search,
.site-header .widget_product_search,
.storefront-primary-navigation,
.secondary-navigation,
.site-branding,
.site-header-cart {
    display: none !important;
}

/* ---- CUSTOM INLINE HEADER ---- */
.heyy-header-row {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 0;
    flex-wrap: wrap;
}

.heyy-header-logo {
    flex-shrink: 0;
    margin-right: 24px;
}

.heyy-header-logo img {
    max-height: 55px;
    width: auto;
    display: block;
}

.heyy-header-logo .site-title {
    font-family: var(--font-display);
    color: var(--text);
    margin: 0;
}

.heyy-header-logo a {
    text-decoration: none;
}

.heyy-header-nav {
    flex-grow: 1;
}

.heyy-nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.heyy-nav-menu li {
    white-space: nowrap;
}

.heyy-nav-menu li a {
    color: var(--text) !important;
    font-family: var(--font-body);
    font-weight: 500;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.heyy-nav-menu li a:hover {
    color: var(--yellow) !important;
}

.heyy-nav-menu li:last-child a {
    background: var(--red);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
    transition: all 0.3s ease;
}

.heyy-nav-menu li:last-child a:hover {
    background: var(--red-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

.heyy-menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
    font-size: 22px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}

.heyy-header-cart {
    flex-shrink: 0;
    margin-left: 20px;
}

.heyy-header-cart a {
    color: var(--text) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.heyy-header-cart svg {
    display: block;
}

/* ---- HIDE BREADCRUMBS ---- */
.woocommerce-breadcrumb,
.storefront-breadcrumb {
    display: none !important;
}

/* ---- FOOTER ---- */
.site-footer {
    background: var(--bg) !important;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.site-footer .widget-area,
.site-footer .site-info {
    color: var(--text-mid);
}

.site-footer a {
    color: var(--text-mid);
}

.site-footer a:hover {
    color: var(--yellow);
}

/* ---- SHOP PAGE: PRODUCT CARDS ---- */
.woocommerce ul.products li.product {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 0;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.woocommerce ul.products li.product a img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 0;
    background: var(--bg-card);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text);
    padding: 10px 14px 0;
}

/* ---- GENRE PILLS ---- */
.heyy-genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 14px 0;
}

.heyy-pill {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgba(255,255,255,0.06);
    color: var(--text-mid);
    font-family: var(--font-body);
}

/* ---- LOGLINE ---- */
.heyy-logline {
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.5;
    padding: 6px 14px 0;
    font-family: var(--font-body);
    font-weight: 400;
}

/* ---- LEARN MORE BUTTON ---- */
.woocommerce ul.products li.product .button.heyy-learn-more {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    margin: 12px 14px 14px;
    width: calc(100% - 28px);
    text-align: center;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 10px;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product .button.heyy-learn-more:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* ---- SALE BADGE TOP RIGHT (shop page) ---- */
.woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 10px;
    right: 10px;
    left: auto;
    margin: 0;
    z-index: 2;
}

.woocommerce span.onsale {
    background: var(--yellow);
    color: var(--bg);
    font-family: var(--font-body);
    font-weight: 700;
    border-radius: 6px;
    padding: 4px 10px;
    min-height: auto;
    min-width: auto;
    line-height: 1.4;
}

/* ============================================
   SINGLE PRODUCT PAGE
   ============================================ */
.woocommerce div.product .product_title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    letter-spacing: 2px;
    color: var(--text);
}

.woocommerce div.product p.price {
    font-size: 1.5rem;
    color: var(--red);
    font-weight: 700;
}

.woocommerce div.product .woocommerce-product-details__short-description {
    color: var(--text-mid);
    font-size: 16px;
    line-height: 1.7;
}

.woocommerce div.product .single_add_to_cart_button {
    background: var(--red) !important;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    padding: 14px 32px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-display);
    color: #fff;
    box-shadow: 0 4px 16px rgba(211, 47, 47, 0.3);
    transition: all 0.3s ease;
}

.woocommerce div.product .single_add_to_cart_button:hover {
    background: var(--red-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(211, 47, 47, 0.4);
}

.woocommerce div.product div.images {
    border-radius: 8px;
    overflow: hidden;
}

/* Quantity input */
.woocommerce .quantity .qty {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
}

/* Select dropdowns (variations) - hidden by JS, but styled as fallback */
.woocommerce div.product form.cart .variations select {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 8px;
}

/* ---- SINGLE PRODUCT: GENRE PILLS ---- */
.heyy-single-genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* ---- SINGLE PRODUCT: COMP TITLES ---- */
.heyy-comp-titles {
    color: var(--text-dim);
    font-size: 13px;
    font-style: italic;
    margin: 0 0 20px 0;
    font-family: var(--font-body);
}

/* ---- SINGLE PRODUCT: CREATOR CREDITS ---- */
.heyy-creator-credits {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 16px;
    margin-top: 16px;
}

.heyy-creator-credits p {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 0 4px 0;
    font-family: var(--font-body);
}

.heyy-creator-credits p span {
    color: var(--text-mid);
}

/* ============================================
   FIX 1: FORMAT TABS (Digital / Paperback)
   Viz-inspired tab buttons with red underline
   ============================================ */
.heyy-format-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}

.heyy-format-tab {
    background: none;
    border: none;
    border-top: none;
    border-left: none;
    border-right: none;
    outline: none;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 24px;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.heyy-format-tab:focus,
.heyy-format-tab:focus-visible {
    outline: none;
    box-shadow: none;
}

.heyy-format-tab:hover {
    color: var(--text-mid);
}

.heyy-format-tab.active {
    color: var(--text);
    font-weight: 600;
    border-bottom-color: var(--red);
}

/* Hide the original variations table (JS hides it too, this is backup) */
.woocommerce div.product form.cart table.variations {
    display: none !important;
}

/* Hide reset variations link */
.woocommerce div.product form.cart .reset_variations {
    display: none !important;
}

/* ============================================
   FIX 2: READ FREE BUTTON
   Sits in the summary column above genre pills
   ============================================ */
.heyy-read-free-wrap {
    margin: 0 0 16px;
    padding: 0;
}

.heyy-read-free-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a8a5c;
    color: #fff !important;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(26, 138, 92, 0.3);
}

.heyy-read-free-btn:hover {
    background: #148a52;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 138, 92, 0.4);
}

/* ---- SINGLE PRODUCT: INLINE DESCRIPTION ---- */
.heyy-inline-description {
    padding: 0;
    margin: 0 0 32px;
    clear: both;
}

.heyy-inline-description h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--text);
    margin: 0 0 12px 0;
    text-transform: uppercase;
}

.heyy-inline-description .heyy-desc-content {
    color: var(--text-mid);
    font-size: 15px;
    line-height: 1.7;
    font-family: var(--font-body);
}

.heyy-inline-description .heyy-desc-content p {
    margin: 0 0 12px 0;
}

/* ============================================
   MORE FROM HEYY COMICS (recommendation row)
   ============================================ */
.heyy-more-section {
    padding: 0;
    margin: 0 0 32px;
    clear: both;
}

.heyy-more-section h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--text);
    margin: 0 0 16px 0;
    text-transform: uppercase;
}

.heyy-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.heyy-more-card {
    text-decoration: none;
    display: block;
    transition: transform 0.3s ease;
}

.heyy-more-card:hover {
    transform: translateY(-4px);
}

.heyy-more-cover {
    background: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.heyy-more-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.heyy-more-title {
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
    line-height: 1.3;
}

.heyy-more-tags {
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 11px;
    margin: 0;
}

/* Volume count in series heading */
.heyy-vol-count {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--text-dim);
    letter-spacing: 0;
    text-transform: none;
}

/* ============================================
   NEWSLETTER CTA (Comics on the House)
   ============================================ */
.heyy-newsletter-cta {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 0 0 32px;
    clear: both;
}

.heyy-newsletter-text {
    flex-grow: 1;
}

.heyy-newsletter-headline {
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.heyy-newsletter-sub {
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 13px;
    margin: 0;
}

.heyy-newsletter-btn {
    flex-shrink: 0;
    background: var(--red);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.heyy-newsletter-btn:hover {
    background: var(--red-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
}

/* ============================================
   FIX 3: GALLERY THUMBNAIL OVERFLOW
   Contain thumbnails within the image column
   ============================================ */
.woocommerce div.product div.images {
    overflow: hidden;
    position: relative;
}

.woocommerce div.product div.images .flex-control-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow: hidden;
    padding: 0;
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: auto;
    flex: 0 0 60px;
    overflow: hidden;
}

.woocommerce div.product div.images .flex-control-thumbs li img {
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
    opacity: 0.6;
    transition: opacity 0.3s ease;
    display: block;
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover,
.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
    opacity: 1;
    border-color: rgba(255,255,255,0.2);
}

/* Prevent gallery wrapper from overflowing */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
    overflow: hidden;
}

/* Hide any FlexSlider nav arrows that might bleed */
.woocommerce div.product div.images .flex-direction-nav {
    display: none;
}

/* ============================================
   FIX 4: HIDE SALE BADGE ON SINGLE PRODUCT
   ============================================ */
.single-product .woocommerce span.onsale,
.single-product span.onsale {
    display: none !important;
}

/* ---- HIDE TABS (replaced by inline description) ---- */
.woocommerce div.product .woocommerce-tabs {
    display: none;
}

/* ---- STOREFRONT SPECIFIC OVERRIDES ---- */
.storefront-sorting {
    display: none;
}

#page {
    background: var(--bg);
}

.site-content .col-full {
    background: transparent;
}

.hentry,
.page .entry-content {
    background: transparent;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    background: var(--bg-card);
    color: var(--text-mid);
    border-color: rgba(255,255,255,0.1);
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media screen and (max-width: 767px) {
    .heyy-menu-toggle {
        display: block;
    }

    .heyy-header-logo {
        margin-right: auto;
    }

    .heyy-header-nav {
        display: none;
        width: 100%;
        order: 10;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,0.05);
        margin-top: 12px;
    }

    .heyy-header-nav.open {
        display: block;
    }

    .heyy-nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .heyy-nav-menu li {
        width: 100%;
    }

    .heyy-nav-menu li a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    .heyy-nav-menu li:last-child a {
        display: inline-block;
        width: auto;
        margin-top: 8px;
        border-bottom: none;
    }

    .heyy-header-cart {
        margin-left: 12px;
    }

    /* Format tabs on mobile */
    .heyy-format-tab {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Single product mobile */
    .heyy-read-free-wrap {
        margin: 0 0 12px;
    }

    .heyy-inline-description {
        padding: 0 14px;
    }

    .heyy-more-section {
        padding: 0 14px;
    }

    .heyy-more-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .heyy-newsletter-cta {
        flex-direction: column;
        text-align: center;
        margin: 0 14px 32px;
    }
}