/* ============================================================
   Astra Child — WooCommerce Product Page Customizations v1.0.4
   ============================================================ */

/* ----------------------------------------------------------
   0. Global mobile overflow fix
      Prevents ANY element from causing horizontal scroll
   ---------------------------------------------------------- */
html, body {
    max-width: 100%;
}
/* clip（不是 hidden）：不会生成滚动容器，position: sticky 仍然有效 */
body {
    overflow-x: clip;
}

/* Images and embeds should never overflow their container */
img, video, iframe, embed {
    max-width: 100% !important;
    height: auto;
}

/* WooCommerce product gallery on mobile */
@media (max-width: 767px) {
    .woocommerce-product-gallery,
    .woocommerce-product-gallery__wrapper,
    .woocommerce-product-gallery__image {
        max-width: 100% !important;
        width: 100% !important;
    }
    .woocommerce div.product div.images {
        width: 100% !important;
        float: none !important;
    }
    .woocommerce div.product div.summary {
        width: 100% !important;
        float: none !important;
    }
    p.amazone-price-note {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ----------------------------------------------------------
   1. Hide Tabs
   ---------------------------------------------------------- */
.woocommerce-tabs.wc-tabs-wrapper {
    display: none !important;
}

/* ----------------------------------------------------------
   2. Price note — amber bar
   ---------------------------------------------------------- */
p.amazone-price-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fffbf0;
    border: 1px solid #f0c050;
    border-left: 4px solid #f5a623;
    color: #6b4f00;
    font-size: 0.82em;
    font-weight: 500;
    padding: 8px 14px;
    margin: 14px 0 16px;
    border-radius: 0 4px 4px 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.4;
}

a.amz-price-note-link {
    flex-shrink: 0;
    font-size: 0.88em;
    color: #b07800;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 1px dashed #f5a623;
    padding-bottom: 1px;
    transition: color 0.15s;
}
a.amz-price-note-link:hover { color: #7a5000; }

/* ----------------------------------------------------------
   3. Summary flex order
   ---------------------------------------------------------- */
.summary.entry-summary {
    display: flex;
    flex-direction: column;
}
.summary.entry-summary > * { order: 0; }
.summary.entry-summary p.amazone-price-note    { order: 1; }
.summary.entry-summary .amz-inline-description { order: 2; }
.summary.entry-summary .cart                   { order: 3; }
.summary.entry-summary .astra-child-disclaimer { order: 4; }
.summary.entry-summary .product_meta           { order: 5; }

/* Title spacing */
.summary.entry-summary .product_title.entry-title {
    margin-bottom: 4px;
    line-height: 1.3;
}

/* ----------------------------------------------------------
   4. Description
   ---------------------------------------------------------- */
.summary.entry-summary .amz-inline-description {
    font-size: 0.91em;
    line-height: 1.78;
    color: #3a3a3a;
    margin-bottom: 18px;
}
.summary.entry-summary .amz-inline-description p { margin-bottom: 10px; }
.summary.entry-summary .amz-inline-description p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------
   5. Check Price button
   ---------------------------------------------------------- */
.summary.entry-summary .cart {
    margin-bottom: 2px;
}
.summary.entry-summary .cart .single_add_to_cart_button {
    letter-spacing: 0.06em;
    font-size: 0.85em;
}

/* ----------------------------------------------------------
   6. Disclaimer — minimal inline
   ---------------------------------------------------------- */
.astra-child-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 0.8em;
    color: #595959;
    line-height: 1.55;
    margin: 6px 0 16px;
}
.astra-child-disclaimer-icon {
    flex-shrink: 0;
    color: #767676;
    margin-top: 1px;
    font-style: normal;
}

/* ----------------------------------------------------------
   7. Product meta
   ---------------------------------------------------------- */
.summary.entry-summary .product_meta {
    font-size: 0.79em;
    color: #aaa;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #efefef;
    line-height: 1.9;
}
.summary.entry-summary .product_meta a {
    color: #999;
    text-decoration: none;
}
.summary.entry-summary .product_meta a:hover {
    color: #555;
    text-decoration: underline;
}

/* ----------------------------------------------------------
   8. Related products section
   ---------------------------------------------------------- */

/* Section heading */
.related.products > h2 {
    font-size: 0.95em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* Base defaults for the outer <ul>/<li> — layout (grid/flex, colors, spacing)
   is fully defined further below in "9. Related Products — LIST LAYOUT";
   this block only keeps the structural resets that section doesn't set
   itself (sizing/box-model safety nets), so there's a single source of
   truth for anything visual and no more risk of two rules silently
   fighting over the same property. */
.related.products ul.products {
    gap: 12px !important;
    float: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}
.related.products ul.products li.product {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* Category label */
.related.products ul.products li.product .ast-woo-product-category {
    font-size: 0.65em;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

/* Hide price in related product cards — button is enough */
.related.products ul.products li.product span.price {
    display: none !important;
}

/* Check price button — box-model safety net; colors/size/position are
   set in the LIST LAYOUT block below */
.related.products ul.products li.product .button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    display: block;
}

/* ----------------------------------------------------------
   9. Product image gallery — adaptive, no crop
   Strategy: aspect-ratio container + object-fit:contain
   The image always shows in full, letterboxed if needed.
   ---------------------------------------------------------- */

/* Step 1: Make the image wrapper a square flex container */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    overflow: hidden !important;
    border-radius: 6px !important;
    background: #f8f8f8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Remove any fixed height that was set before */
    height: auto !important;
    max-height: none !important;
}

/* Step 2: Anchor fills the container */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Step 3: Image scales to fit — never cropped */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img,
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img.wp-post-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    background: #f8f8f8 !important;
}

/* Thumbnail strip — WooCommerce uses ol.flex-control-thumbs */
.woocommerce-product-gallery ol.flex-control-thumbs,
.woocommerce-product-gallery ul.flex-control-thumbs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.woocommerce-product-gallery ol.flex-control-thumbs li,
.woocommerce-product-gallery ul.flex-control-thumbs li {
    width: 68px !important;
    height: 68px !important;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 5px;
    border: 2px solid #e8e8e8;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #f8f8f8;
}
.woocommerce-product-gallery ol.flex-control-thumbs li:hover,
.woocommerce-product-gallery ul.flex-control-thumbs li:hover {
    border-color: #f5a623;
    box-shadow: 0 0 0 1px #f5a623;
}
.woocommerce-product-gallery ol.flex-control-thumbs li img,
.woocommerce-product-gallery ul.flex-control-thumbs li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    cursor: pointer;
    display: block;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.woocommerce-product-gallery ol.flex-control-thumbs li img.flex-active,
.woocommerce-product-gallery ul.flex-control-thumbs li img.flex-active {
    opacity: 1;
}
.woocommerce-product-gallery ol.flex-control-thumbs li:has(img.flex-active),
.woocommerce-product-gallery ul.flex-control-thumbs li:has(img.flex-active) {
    border-color: #f5a623;
    box-shadow: 0 0 0 1px #f5a623;
}

/* LEGACY selector kept for compatibility */
.woocommerce-product-gallery .flex-control-thumbs {
    margin-top: 8px;
    gap: 6px;
    display: flex;
    flex-wrap: wrap;
}

.woocommerce-product-gallery .flex-control-thumbs li {
    width: 72px !important;
    height: 72px;
    overflow: hidden;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.woocommerce-product-gallery .flex-control-thumbs li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.woocommerce-product-gallery .flex-control-thumbs li img.flex-active,
.woocommerce-product-gallery .flex-control-thumbs li:hover img {
    border-color: #f5a623;
    opacity: 0.85;
}

/* Mobile: aspect-ratio handles everything automatically */
@media (max-width: 768px) {
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
        width: 100% !important;
        max-height: none !important;
        height: auto !important;
    }
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img,
    .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img.wp-post-image {
        height: 100% !important;
    }
}

/* ============================================================
   WooCommerce Category Archive Page Fix
   ---------------------------------------------------------- */

/* Kill Astra's giant category title that breaks layout */
.woocommerce .woocommerce-products-header__title.page-title {
    font-size: 1.6em !important;
    margin-bottom: 16px !important;
    line-height: 1.3 !important;
}

.woocommerce .woocommerce-products-header {
    max-width: 320px;
    margin-bottom: 0;
}

/* Fix the sidebar + product grid layout on category pages */
.woocommerce-page .content-area {
    width: 100% !important;
}

/* Product grid in category pages — 3 columns */
.woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr);
    display: grid;
    gap: 20px;
}

/* Category page product cards: consistent height with button at bottom */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
}
.woocommerce ul.products li.product .astra-shop-summary-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.woocommerce ul.products li.product .button {
    margin-top: auto !important;
}

/* Hide WooCommerce's own prices on category pages (they show $32.99 etc from plugin) */
.woocommerce ul.products li.product .price {
    font-size: 0.8em;
    color: #999;
}

@media (max-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .woocommerce .woocommerce-products-header {
        max-width: 100%;
    }
    .woocommerce .woocommerce-products-header__title.page-title {
        font-size: 1.3em !important;
    }
}

/* ============================================================
   Shop Page — Category Directory Layout
   ============================================================ */

.sd-shop-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Hero */
.sd-shop-hero {
    padding: 36px 32px 32px;
    border-bottom: 1px solid #efefef;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #fffdf5 0%, #fff 60%);
    border-radius: 10px;
    border: 1px solid #f0e8cc;
}

.sd-shop-title {
    font-size: 2em;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.sd-shop-subtitle {
    font-size: 0.95em;
    color: #999;
    margin: 0;
    line-height: 1.6;
}

/* Grid — 3 col desktop */
.sd-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Card */
.sd-cat-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e8e8e8;
    border-left: 4px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
    overflow: hidden;
}

.sd-cat-card:hover {
    border-color: #c9a227;
    border-left-color: #c9a227;
    box-shadow: 0 4px 24px rgba(197, 162, 39, 0.13);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.sd-cat-card-inner {
    padding: 20px 22px 18px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    min-height: 150px;
}

/* Top row: name + count */
.sd-cat-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.sd-cat-name {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
}

.sd-cat-count {
    flex-shrink: 0;
    font-size: 0.72em;
    color: #bbb;
    font-weight: 400;
    background: #f7f7f7;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}
.sd-cat-count::after {
    content: " items";
}

/* Subcategory pill list */
.sd-cat-subcats {
    list-style: none;
    margin: 0 0 auto;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sd-cat-subcats li {
    font-size: 0.72em;
    color: #777;
    background: #f5f5f5;
    padding: 3px 9px;
    border-radius: 20px;
    line-height: 1.5;
    white-space: nowrap;
}

/* Browse CTA */
.sd-cat-cta {
    display: block;
    margin-top: 16px;
    font-size: 0.78em;
    font-weight: 600;
    color: #c9a227;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Tablet: 2 columns */
@media (max-width: 768px) {
    .sd-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sd-shop-title {
        font-size: 1.8em;
    }
}

/* Mobile: 1 column */
@media (max-width: 480px) {
    .sd-cat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .sd-cat-card-inner {
        min-height: auto;
        padding: 16px 18px;
    }
}

/* ============================================================
   Category Archive Page (.sd-archive-page wraps woocommerce_content())
   PC: 6 col × 2 rows = 12/page  |  Mobile: 3 col × 4 rows = 12/page
   ============================================================ */

.sd-archive-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 60px;
    box-sizing: border-box;
}

/* Page title */
.sd-archive-page h1.page-title,
.sd-archive-page .woocommerce-products-header__title {
    font-size: 1.4em !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 24px 0 6px !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
}

/* Toolbar row */
.sd-archive-page .woocommerce-result-count {
    font-size: 0.8em;
    color: #bbb;
    margin-bottom: 12px;
}
.sd-archive-page .woocommerce-ordering {
    margin-bottom: 12px;
}
.sd-archive-page .woocommerce-ordering select {
    font-size: 0.8em;
    color: #888;
    border-color: #e8e8e8;
}

/* Product grid — 6 columns */
.sd-archive-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 14px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    width: 100% !important;
    clear: both;
}
.sd-archive-page ul.products[class*="columns-"] {
    grid-template-columns: repeat(6, 1fr) !important;
}

/* Product card */
.sd-archive-page ul.products li.product {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
    display: flex !important;
    flex-direction: column !important;
    background: #fff;
    border: 1px solid #efefef;
    border-radius: 8px;
    padding: 8px 8px 10px;
    box-sizing: border-box !important;
    overflow: hidden;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}
.sd-archive-page ul.products li.product:hover {
    border-color: #e0c97a;
    box-shadow: 0 3px 14px rgba(197,162,39,0.1);
    transform: translateY(-2px);
}

/* Thumbnail — square crop */
.sd-archive-page ul.products li.product .astra-shop-thumbnail-wrap {
    width: 100%;
    overflow: hidden;
    border-radius: 5px;
    background: #f8f8f8;
}
.sd-archive-page ul.products li.product .astra-shop-thumbnail-wrap img,
.sd-archive-page ul.products li.product img {
    width: 100% !important;
    height: 150px !important;
    object-fit: cover !important;
    display: block;
    border-radius: 5px;
}

/* Summary */
.sd-archive-page ul.products li.product .astra-shop-summary-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    padding: 0 !important;
}

/* Image zoom on hover */
.sd-archive-page ul.products li.product .astra-shop-thumbnail-wrap img,
.sd-archive-page ul.products li.product img {
    transition: transform 0.28s ease !important;
}
.sd-archive-page ul.products li.product:hover .astra-shop-thumbnail-wrap img,
.sd-archive-page ul.products li.product:hover img {
    transform: scale(1.05);
}

/* Category label — hide to save space at 6-col */
.sd-archive-page ul.products li.product .ast-woo-product-category {
    display: none !important;
}

/* Title — max 2 lines with ellipsis */
.sd-archive-page ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.77em !important;
    line-height: 1.4;
    margin: 6px 0 8px !important;
    color: #1a1a1a;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

/* Hide price */
.sd-archive-page ul.products li.product .price {
    display: none !important;
}

/* Button pinned to bottom */
.sd-archive-page ul.products li.product .button {
    margin-top: auto !important;
    font-size: 0.68em !important;
    padding: 5px 8px !important;
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    box-sizing: border-box !important;
    letter-spacing: 0.05em !important;
    border-radius: 4px !important;
}

/* Pagination — clean minimal */
.sd-archive-page .woocommerce-pagination {
    margin-top: 40px;
    text-align: center;
    clear: both;
}
.sd-archive-page .woocommerce-pagination ul {
    display: inline-flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.sd-archive-page .woocommerce-pagination ul li a,
.sd-archive-page .woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 0.82em;
    color: #555;
    border: 1px solid #e8e8e8;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.sd-archive-page .woocommerce-pagination ul li span.current {
    background: #c9a227;
    border-color: #c9a227;
    color: #fff;
    font-weight: 600;
}
.sd-archive-page .woocommerce-pagination ul li a:hover {
    border-color: #c9a227;
    color: #c9a227;
}

/* Tablet ≤ 900px → 4 columns */
@media (max-width: 900px) {
    .sd-archive-page ul.products,
    .sd-archive-page ul.products[class*="columns-"] {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }
}

/* Mobile ≤ 600px → 3 columns */
@media (max-width: 600px) {
    .sd-archive-page {
        padding: 0 12px 40px;
    }
    .sd-archive-page ul.products,
    .sd-archive-page ul.products[class*="columns-"] {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .sd-archive-page ul.products li.product .astra-shop-thumbnail-wrap img,
    .sd-archive-page ul.products li.product img {
        height: 100px !important;
    }
    .sd-archive-page ul.products li.product {
        padding: 6px 6px 8px;
    }
    .sd-shop-page {
        padding: 0 12px 40px;
    }
    .sd-shop-hero {
        padding: 20px 18px 18px;
    }
}

/* 分类名称链接 */
.sd-cat-name {
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}
.sd-cat-name:hover {
    color: #e07b39; /* 你的主题色 */
}

/* 子分类标签链接 */
.sd-subcat-link {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: #f3f3f3;
    color: #555;
    font-size: 0.82em;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.sd-subcat-link:hover {
    background: #e07b39;
    color: #fff;
}

/* 卡片整体 hover 效果（之前在 <a> 上，现在移到 div） */
.sd-cat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/*
 * GOLDSOID — Correctif ::before fantôme dans la grille produits
 * ==============================================================
 * Ajouter dans : Apparence > Personnaliser > CSS additionnel
 * (Remplace / complète les CSS précédemment ajoutés)
 * ==============================================================
 *
 * Le pseudo-élément ::before de ul.products occupe la première
 * cellule du grid CSS, décalant tous les produits d'une position
 * et créant une case vide en début et fin de grille.
 */

/* 去掉占用一个 grid 单元格的 ::before 伪元素 */
.sd-archive-page ul.products::before,
ul.products::before {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    grid-column: unset !important;
}

/* 同样处理 ::after（如果存在） */
.sd-archive-page ul.products::after,
ul.products::after {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
}


/* ============================================================
   Goldsoid — Product Page Visual Optimizations (patch)
   Add AFTER existing custom.css rules
   ============================================================ */

/* ----------------------------------------------------------
   A. "Vérifier le prix" — High-conversion CTA button
      Strategy: large, full-width, warm gold with pulse hint
   ---------------------------------------------------------- */

/* Wrapper: give it breathing room */
.summary.entry-summary .cart {
    margin-top: 20px;
    margin-bottom: 0;
}

/* The button itself */
.summary.entry-summary .cart .single_add_to_cart_button {
    display: block;
    width: 100%;
    box-sizing: border-box;

    /* Size & type */
    padding: 15px 24px;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;

    /* Gold gradient */
    background: linear-gradient(135deg, #e8a020 0%, #c98b10 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;

    /* Depth */
    box-shadow: 0 4px 14px rgba(197,139,16,0.40);

    /* Motion */
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    cursor: pointer;

    /* Arrow icon via pseudo-element */
    position: relative;
}

.summary.entry-summary .cart .single_add_to_cart_button::after {
    content: " →";
    font-weight: 400;
    opacity: 0.85;
}

.summary.entry-summary .cart .single_add_to_cart_button:hover {
    background: linear-gradient(135deg, #f0ad2a 0%, #d99818 100%);
    box-shadow: 0 6px 20px rgba(197,139,16,0.55);
    transform: translateY(-2px);
}

.summary.entry-summary .cart .single_add_to_cart_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(197,139,16,0.35);
}

/* Subtle pulse on page-load to draw the eye (runs once) */
@keyframes gs-pulse-once {
    0%   { box-shadow: 0 4px 14px rgba(197,139,16,0.40); }
    50%  { box-shadow: 0 4px 28px rgba(197,139,16,0.70); }
    100% { box-shadow: 0 4px 14px rgba(197,139,16,0.40); }
}
.summary.entry-summary .cart .single_add_to_cart_button {
    animation: gs-pulse-once 1.6s ease 0.8s 1;
}

/* B. 声明不再“隐形化”：可读性见第 6 节与 .affiliate-disclaimer */

/* ----------------------------------------------------------
   C. Price note bar — tighten spacing above button
   ---------------------------------------------------------- */
p.amazone-price-note {
    margin-bottom: 0;   /* button sits right below, no gap */
}

/* ----------------------------------------------------------
   D. Description — slightly tighter before the button
      so the CTA feels closer to the content
   ---------------------------------------------------------- */
.summary.entry-summary .amz-inline-description {
    margin-bottom: 12px; /* was 18px */
}

/* ----------------------------------------------------------
   E. Product title — minor weight boost for authority
   ---------------------------------------------------------- */
.summary.entry-summary .product_title.entry-title {
    font-size: 1.65em;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

/* ----------------------------------------------------------
   F. Mobile: keep button large & tapable on small screens
   ---------------------------------------------------------- */
@media (max-width: 767px) {
    .summary.entry-summary .cart .single_add_to_cart_button {
        padding: 16px 20px;
        font-size: 1.05em;
        border-radius: 10px;
    }
}

/* ============================================================
   9. "Ähnliche Produkte" (Related Products) — LIST LAYOUT (v3)
   REPLACES the previous "9. ..." block (v2) you pasted last time.
   Add this AFTER the existing "8. Related products section" block.

   Changes vs v2:
   - Title now sits ABOVE the highlight badge (was below)
   - Slightly larger/bolder title since it's now the visual lead
   - Highlight badge toned down a touch (secondary info now)
   - Tighter, more even row height / vertical centering
   ============================================================ */

/* --- Container: stack items vertically instead of a 6-col grid --- */
.related.products ul.products,
.related.products ul.products[class*="columns-"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

/* --- Each row: CSS Grid so we can freely place thumb / title /
   highlight / button regardless of where they sit in the original HTML --- */
.related.products ul.products li.product {
    display: grid !important;
    grid-template-columns: 96px 1fr auto;
    grid-template-areas:
        "thumb category action"
        "thumb title     action"
        "thumb highlight action";
    grid-template-rows: auto auto auto;
    align-items: center;
    column-gap: 16px;
    row-gap: 3px;
    width: 100% !important;
    padding: 14px !important;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: none;
    overflow: visible !important;
}
.related.products ul.products li.product:hover {
    border-color: #e0c97a;
    box-shadow: 0 3px 14px rgba(197,162,39,0.10);
}

/* --- Flatten wrapper <div>/<a> tags so their children (img, title,
   highlight box, button) become direct grid items we can place freely --- */
.related.products ul.products li.product .astra-shop-thumbnail-wrap,
.related.products ul.products li.product .astra-shop-summary-wrap,
.related.products ul.products li.product .woocommerce-LoopProduct-link,
.related.products ul.products li.product .ast-loop-product__link {
    display: contents !important;
}

/* --- Thumbnail image --- */
.related.products ul.products li.product .astra-shop-thumbnail-wrap img {
    grid-area: thumb;
    width: 96px !important;
    height: 96px !important;
    object-fit: cover;
    border-radius: 6px;
    align-self: center;
    margin: 0 !important;
}

/* Hide the small bag-icon hover button used on cards — not needed in a list */
.related.products ul.products li.product .ast-on-card-button {
    display: none !important;
}

/* --- Category label: fixed position directly above the title on every
   card, regardless of whether a highlight badge exists (fixes the random
   "sometimes under image, sometimes beside it" placement) --- */
.related.products ul.products li.product .ast-woo-product-category {
    grid-area: category;
    margin: 0 !important;
    align-self: end;
}

/* --- Title: now the visual lead, sits right after the thumbnail --- */
.related.products ul.products li.product .woocommerce-loop-product__title {
    grid-area: title;
    margin: 0 !important;
    font-size: 0.95em;      /* bumped up slightly since it's now primary */
    line-height: 1.35;
    color: #1a1a1a;
    font-weight: 600;
}

/* --- Highlight badge: secondary info below the title.
   Hugs its own text, never truncates, wraps on narrow screens --- */
.related.products ul.products li.product .amz-related-highlight {
    grid-area: highlight;
    position: static !important;
    display: inline-flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px;
    justify-self: start !important;
    width: fit-content !important;
    max-width: 100% !important;
    background: #fdf3e0;
    border-left: 3px solid #f0c050;
    padding: 3px 9px;
    border-radius: 0 4px 4px 0;
    box-sizing: border-box;
    margin-top: 2px;   /* the 1-2px extra breathing room the title needs */
}
.related.products ul.products li.product .amz-related-highlight__label,
.related.products ul.products li.product .amz-related-highlight__value {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    line-height: 1.45;
    word-break: break-word;
}
.related.products ul.products li.product .amz-related-highlight__label {
    font-size: 11.5px;
    font-weight: 700;
    color: #966a00;
    flex-shrink: 0;
}
.related.products ul.products li.product .amz-related-highlight__value {
    font-size: 12px;
    font-weight: 500;
    color: #6b5124;   /* slightly softer than the title, keeps hierarchy clear */
}

/* --- CTA button: orange, high visual weight, sits at the end of the row --- */
.related.products ul.products li.product .astra-shop-summary-wrap .button {
    grid-area: action;
    justify-self: end;
    align-self: center;
    margin: 0 !important;
    white-space: nowrap;
    background: linear-gradient(135deg, #f5a623 0%, #e8901a 100%) !important;
    color: #fff !important;
    border: none;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.03em;
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(232,144,26,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-width: max-content;
}
.related.products ul.products li.product .astra-shop-summary-wrap .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,144,26,0.5);
}

/* --- Responsive: on narrow screens, move the button to its own full-width
   row instead of squeezing three columns into one line --- */
@media (max-width: 600px) {
    .related.products ul.products li.product {
        grid-template-columns: 64px 1fr;
        grid-template-areas:
            "thumb category"
            "thumb title"
            "thumb highlight"
            "action action";
        row-gap: 4px;
        column-gap: 10px;
        padding: 10px;
    }
    .related.products ul.products li.product .astra-shop-thumbnail-wrap img {
        width: 64px !important;
        height: 64px !important;
    }
    .related.products ul.products li.product .woocommerce-loop-product__title {
        font-size: 0.86em;
    }
    .related.products ul.products li.product .astra-shop-summary-wrap .button {
        justify-self: stretch;
        text-align: center;
        margin-top: 4px !important;
    }
}


/* ----------------------------------------------------------
   Aviso de afiliación (.affiliate-disclaimer) — generado en PHP
   ---------------------------------------------------------- */
.affiliate-disclaimer {
    font-size: 12.5px;
    color: #e5d8d8; /* #595959 */
    margin: 8px 0 0;
    line-height: 1.55;
    clear: both;
}
.affiliate-disclaimer--page {
    text-align: center;
    max-width: 760px;
    margin: 20px auto !important;
    padding: 0 16px !important;
}
/* 如果 Amazon 插件也输出了 .astra-child-disclaimer，只保留一个，避免重复声明 */
.summary.entry-summary:has(.affiliate-disclaimer) .astra-child-disclaimer {
    display: none;
}

/* ----------------------------------------------------------
   Plantillas a ancho completo (body.sg-fullwidth)
   Se aplica a: portada, índice de guías y "todas las categorías".
   Sustituye al truco de 100vw (que provocaba scroll horizontal).
   ---------------------------------------------------------- */
body.sg-fullwidth { background: #FFFFFF; }

body.sg-fullwidth #primary,
body.sg-fullwidth #content,
body.sg-fullwidth .site-content,
body.sg-fullwidth .content-area {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    background: transparent !important;
}
body.sg-fullwidth .site-content > .ast-container,
body.sg-fullwidth #content > .ast-container,
body.sg-fullwidth .content-area > .ast-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    display: block !important;
}
body.sg-fullwidth main,
body.sg-fullwidth #main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    background: transparent !important;
}
body.sg-fullwidth .entry-content,
body.sg-fullwidth article.page {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}
body.sg-fullwidth #secondary,
body.sg-fullwidth .sidebar,
body.sg-fullwidth aside.widget-area,
body.sg-fullwidth #sidebar,
body.sg-fullwidth .sidebar-area {
    display: none !important;
    width: 0 !important;
}
