/* Vanguard Product Display v1.2.5 — ATC Design System */
/* Navy accent, WCAG AA compliant, UK/AU readability standards */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    --atc-navy:        #1e3a5f;   /* Primary accent — navy blue */
    --atc-navy-dark:   #152d4a;   /* Hover state */
    --atc-navy-light:  #e8eef5;   /* Tint background */
    --atc-navy-mid:    #2c5282;   /* Secondary navy */
    --atc-green:       #1a6b3a;   /* Buy button */
    --atc-green-dark:  #145230;
    --atc-text-primary:   #1a1a1a; /* 16:1 on white — AAA */
    --atc-text-body:      #2d2d2d; /* 13.5:1 on white — AAA */
    --atc-text-secondary: #555555; /* 7.0:1 on white — AA large + small */
    --atc-text-muted:     #666666; /* 5.7:1 on white — AA */
    --atc-border:         #d4d9e0;
    --atc-bg-subtle:      #f5f7fa;
    --atc-bg-card:        #ffffff;
    --atc-radius:         6px;
    --atc-transition:     0.18s ease;
}

/* ============================================
   HIDE WC/BLOCKSY DUPLICATE OUTPUT
   ============================================ */
.summary .product_meta,
.entry-summary .product_meta,
.woocommerce div.product .product_meta,
.woocommerce-product-details__short-description + .book-details,
.summary > .book-details:not(.book-details-line),
.ct-product-metas,
.ct-product-tax,
[class*="ct-product-meta"],
.atc-publisher,
span.atc-publisher,
/* Blocksy dividers that bracket product_meta */
.ct-product-divider,
/* Legacy atc-comic-metadata block (old plugin still outputting) */
.atc-comic-metadata,
/* Dokan vendor info block inside product_meta */
.dokan-vendor-info-wrap,
/* Dokan report abuse button */
.dokan-report-abuse-button,
a.dokan-report-abuse-button {
    display: none !important;
}
/* WC native star rating — display handled by WooCommerce */

/* Hide Blocksy/WC duplicate genre and tag output */
.product_meta .tagged_as,
.product_meta .posted_in,
.entry-summary .tagged_as,
.summary .tagged_as,
span.tagged_as,
.woocommerce div.product .summary .tagged_as,
.woocommerce div.product .summary .posted_in,
.woocommerce div.product p.tagged_as,
.woocommerce div.product p.posted_in,
.ct-product-tags,
.ct-product-categories,
.blocksy-product-tags,
.blocksy-product-categories,
.wc-block-components-product-meta__tagged_as {
    display: none !important;
}

/* ============================================
   BOOK METADATA — primary info block
   ============================================ */
.vanguard-book-meta {
    margin: 4px 0 24px;
}

/* Author — clear secondary line under title */
.book-author {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--atc-text-secondary);
    margin: 0 0 8px;
}
.book-author strong {
    font-weight: 600;
    color: var(--atc-text-body);
}

/* Publisher · Year · ISBN — small, muted, scannable */
.book-details-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--atc-text-muted);
    margin-bottom: 20px;
}
.book-details-line > span:not(:last-child)::after {
    content: "·";
    margin: 0 7px;
    color: #bbb;
}

/* Brief Description — normal weight, subtle tint, no italic */
.book-brief-desc {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--atc-text-body);
    margin: 0 0 22px;
    padding: 14px 18px;
    background: var(--atc-navy-light);
    border-left: 3px solid var(--atc-navy);
    border-radius: 0 var(--atc-radius) var(--atc-radius) 0;
}

/* ============================================
   BOOK SPECS GRID — WCAG AA compliant labels
   ============================================ */
.book-specs {
    margin: 0 0 22px;
    padding: 18px 20px;
    background: var(--atc-bg-subtle);
    border-radius: var(--atc-radius);
    border: 1px solid var(--atc-border);
}
.specs-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--atc-text-muted);   /* #666 — passes WCAG AA */
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.specs-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.spec-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.spec-item dt {
    font-size: 12px;                 /* 12px minimum for labels */
    font-weight: 600;
    color: var(--atc-text-muted);   /* #666 — passes AA */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.spec-item dd {
    font-size: 15px;
    font-weight: 500;
    color: var(--atc-text-primary); /* #1a1a1a — AAA */
    margin: 0;
    line-height: 1.5;
}
.spec-na {
    color: #bbb;
    font-weight: 400;
}

/* ============================================
   GENRE TAGS & AGE RATING
   ============================================ */
.book-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
}
.book-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.genre-tag {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 20px;
    background: var(--atc-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: background var(--atc-transition);
}
.genre-tag:hover {
    background: var(--atc-navy-dark);
    color: #fff;
    text-decoration: none;
}
.genre-tag:focus-visible {
    outline: 3px solid var(--atc-navy-mid);
    outline-offset: 2px;
}

/* Age rating badge */
.age-badge {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.age-all-ages { background: #1a6b3a; color: #fff; }
.age-teen     { background: var(--atc-navy); color: #fff; }
.age-teen-    { background: #5b2c8d; color: #fff; }
.age-mature   { background: #8b1c1c; color: #fff; }

/* ============================================
   AVAILABLE FROM — sellers section
   ============================================ */
.vanguard-sellers-section {
    margin: 24px 0 0;
    padding: 20px;
    background: var(--atc-bg-subtle);
    border-radius: var(--atc-radius);
    border: 1px solid var(--atc-border);
}
.vanguard-sellers-section h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--atc-text-primary);
    letter-spacing: 0.01em;
}

/* No sellers state */
.no-sellers {
    text-align: center;
    padding: 24px 20px;
}
.no-sellers p {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--atc-text-secondary);
}
.no-sellers .hint {
    font-size: 13px;
    color: var(--atc-text-muted);
    margin-top: 6px;
}

/* Sellers list */
.sellers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual seller row */
.seller-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--atc-bg-card);
    border-radius: var(--atc-radius);
    border: 1px solid var(--atc-border);
    gap: 12px;
    transition: box-shadow var(--atc-transition);
}
.seller-row:hover {
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.10);
}

/* Seller info */
.seller-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.seller-info .name {
    font-size: 15px;
    font-weight: 600;
    color: var(--atc-text-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.seller-info a.name.seller-link {
    color: var(--atc-navy);
    text-decoration: none;
    transition: color var(--atc-transition);
}
.seller-info a.name.seller-link:hover,
.seller-info a.name.seller-link:focus {
    color: var(--atc-navy-dark);
    text-decoration: underline;
}
.seller-info a.name.seller-link:focus-visible {
    outline: 3px solid var(--atc-navy-mid);
    outline-offset: 2px;
}

/* Condition badge */
.seller-info .condition {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    background: #e9ecef;
    color: #495057;
}
.cond-like_new  { background: #d4edda !important; color: #155724 !important; }
.cond-very_good { background: #d1ecf1 !important; color: #0c5460 !important; }
.cond-good      { background: #fff3cd !important; color: #6d4a00 !important; }
.cond-acceptable{ background: #fde8d8 !important; color: #7a3400 !important; }
.cond-poor      { background: #e2e3e5 !important; color: #383d41 !important; }

/* Seller action buttons */
.seller-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.vanguard-trade-btn,
.btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    width: 112px;
    border: none;
    border-radius: var(--atc-radius);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none !important;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background var(--atc-transition), transform 0.1s, box-shadow var(--atc-transition);
}

/* Trade button — navy */
.vanguard-trade-btn,
.vanguard-trade-btn:link,
.vanguard-trade-btn:visited,
a.vanguard-trade-btn,
.seller-btns .vanguard-trade-btn,
.vanguard-sellers-section .vanguard-trade-btn,
.vanguard-trade-btn.dokan-add-to-quote-btn,
.vanguard-trade-btn.dokan-btn,
a.vanguard-trade-btn.dokan-add-to-quote-btn,
.dokan-add-to-quote-btn.vanguard-trade-btn {
    background: var(--atc-navy) !important;
    color: #fff !important;
    border: none !important;
}
.vanguard-trade-btn:hover,
.vanguard-trade-btn:focus,
a.vanguard-trade-btn:hover,
a.vanguard-trade-btn:focus {
    background: var(--atc-navy-dark) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.35);
    outline: none;
}
.vanguard-trade-btn:focus-visible {
    outline: 3px solid var(--atc-navy-mid);
    outline-offset: 2px;
}
.vanguard-trade-btn.is-loading  { opacity: 0.7; pointer-events: none; }
.vanguard-trade-btn.added_to_quote { background: #1a6b3a !important; }

/* Buy button — green */
.btn-buy {
    background: var(--atc-green);
    color: #fff;
}
.btn-buy:hover,
.btn-buy:focus {
    background: var(--atc-green-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(26, 107, 58, 0.35);
    outline: none;
}
.btn-buy:focus-visible {
    outline: 3px solid #2ecc71;
    outline-offset: 2px;
}

/* Wishlist */
.btn-wishlist {
    padding: 10px 18px;
    background: #fff;
    border: 2px solid var(--atc-navy);
    color: var(--atc-navy);
    border-radius: var(--atc-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    transition: all var(--atc-transition);
}
.btn-wishlist:hover,
.btn-wishlist:focus {
    background: var(--atc-navy);
    color: #fff;
}
.btn-wishlist:focus-visible {
    outline: 3px solid var(--atc-navy-mid);
    outline-offset: 2px;
}
.wishlist-cta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--atc-border);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--atc-text-muted);
}

/* ============================================
   CONTENT WARNINGS (ATC — used sparingly)
   ============================================ */
.book-warnings-section {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: #fffbeb;
    border-radius: var(--atc-radius);
    border: 1px solid #fde68a;
    font-size: 14px;
    line-height: 1.6;
}
.warnings-label {
    font-weight: 700;
    color: #6d4a00;
    margin-right: 6px;
}
.warnings-list {
    color: #6d4a00;
    display: inline;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.vanguard-trade-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--atc-navy);
    color: #fff;
    padding: 16px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 300px;
    max-width: 90vw;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}
.vanguard-trade-toast.toast-visible { transform: translateY(0); opacity: 1; }
.vanguard-trade-toast .toast-content { display: flex; align-items: center; gap: 12px; }
.vanguard-trade-toast .toast-icon { font-size: 22px; }
.vanguard-trade-toast .toast-message { font-weight: 600; font-size: 15px; line-height: 1.4; }
.vanguard-trade-toast .toast-actions { display: flex; gap: 10px; }
.vanguard-trade-toast .toast-btn {
    background: #fff;
    color: var(--atc-navy);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background var(--atc-transition);
}
.vanguard-trade-toast .toast-btn:hover { background: #e8eef5; }
.vanguard-trade-toast .toast-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}
.vanguard-trade-toast .toast-close:hover { opacity: 1; }

/* ============================================
   PRODUCT IMAGE — FIFU + Blocksy fix
   ============================================ */
/* FIFU (Featured Image from URL) uses LightSlider with inline height:650px on the ul.
   The active li is position:absolute which means the ul has 0 natural height.
   JS (fixGalleryImages) sets height:auto on the ul and position:relative on active li.
   CSS here handles the overflow clipping on slider wrappers. */
.lSSlideOuter,
.lSSlideWrapper {
    overflow: visible !important;
    max-height: none !important;
}
ul.fifu-product-gallery,
ul#image-gallery {
    /* height overridden by JS — CSS fallback */
    min-height: 200px;
}
ul.fifu-product-gallery img.fifu,
ul#image-gallery img.fifu {
    height: auto !important;
    max-height: none !important;
    width: 100% !important;
    object-fit: contain !important;
}
.woocommerce div.product div.images img,
.single-product .wp-post-image,
.woocommerce-product-gallery__image img,
.woocommerce-product-gallery__image a img,
.woocommerce-product-gallery .woocommerce-product-gallery__image img {
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
}
.woocommerce-product-gallery,
.woocommerce div.product div.images,
.woocommerce-product-gallery__image,
.woocommerce-product-gallery .woocommerce-product-gallery__image {
    overflow: visible !important;
    aspect-ratio: auto !important;
    height: auto !important;
    max-height: none !important;
}
.woocommerce-product-gallery__image::before,
.woocommerce-product-gallery__image::after {
    display: none !important;
    padding-bottom: 0 !important;
    content: none !important;
}
/* Blocksy uses a <figure> with padding-bottom for aspect ratio */
.woocommerce-product-gallery figure,
.woocommerce-product-gallery__image figure {
    padding-bottom: 0 !important;
    height: auto !important;
}


/* ============================================
   STAR RATINGS — vanguard-star-rating
   ============================================ */



.vanguard-star-rating {
    margin: 0 0 18px;
}
.vanguard-stars-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* WC star icons — use navy tint */
.vanguard-star-rating .star-rating,
.woocommerce .vanguard-star-rating .star-rating {
    color: var(--atc-navy) !important;
    font-size: 16px !important;
    letter-spacing: 1px;
    line-height: 1;
    overflow: visible !important;
    width: auto !important;
}
.vanguard-star-rating .star-rating::before,
.vanguard-star-rating .star-rating span::before {
    color: var(--atc-navy) !important;
}

.vanguard-rating-summary {
    font-size: 14px;
    color: var(--atc-text-muted);
    line-height: 1.4;
}
.vanguard-review-count {
    color: var(--atc-navy);
    text-decoration: underline;
    font-size: 14px;
    transition: color var(--atc-transition);
}
.vanguard-review-count:hover {
    color: var(--atc-navy-dark);
}
.vanguard-empty-stars {
    /* WC star-rating at 0% — shows empty star outlines */
    font-size: 14px !important;
    color: #ccc !important;
    width: auto !important;
    overflow: visible !important;
}
.vanguard-empty-stars::before {
    color: #ccc !important;
}
.vanguard-no-ratings {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vanguard-no-ratings .vanguard-review-count {
    letter-spacing: normal;
    font-size: 13px;
    color: var(--atc-text-muted);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 520px) {
    .specs-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .seller-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .seller-info {
        justify-content: space-between;
    }
    .seller-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .vanguard-trade-btn,
    .btn-buy {
        width: 100%;
    }
    .wishlist-cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .btn-wishlist {
        width: 100%;
    }
}
