/* =====================================================================
 * Wagport — single product (PDP) redesign
 * Brand-aligned restyle of the WooDmart Gutenberg single-product layout.
 * Palette: primary blue #3452EF, accent gold #FABA5B,
 * titles Fredoka, body Albert Sans. Scoped to .single-product.
 * Variation-option cards live in wagport-variation-picker.css.
 * ===================================================================== */

.single-product {
    --wag-blue: #3452ef;
    --wag-blue-dark: #2740c4;
    --wag-blue-soft: #eef1ff;
    --wag-gold: #faba5b;
    --wag-gold-soft: #fff5e6;
    --wag-ink: #1b2433;
    --wag-muted: #6b7686;
    --wag-line: #e4e8f2;
    --wag-line-soft: #eef0f6;
    --wag-surface: #fff;
    --wag-radius: 16px;
}

/* ---------------------------------------------------------------------
 * 1. Title, breadcrumb, short description
 * ------------------------------------------------------------------- */
.single-product .product_title.entry-title,
.single-product h1.product_title {
    margin-bottom: 8px;
    color: var(--wag-ink);
    font-family: "Fredoka", var(--wd-title-font, sans-serif);
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .2px;
}

.single-product .wd-single-stock p.stock,
.single-product p.stock.in-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    padding: 3px 11px 3px 9px;
    border-radius: 999px;
    background: #eaf7ef;
    color: #1f7a44;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
}

.single-product p.stock.in-stock::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #25a35a;
    box-shadow: 0 0 0 3px rgba(37, 163, 90, .18);
}

.single-product p.stock.out-of-stock {
    background: #fdecec;
    color: #c0392b;
}

.single-product .woocommerce-product-details__short-description {
    display: none !important;
}

/* ---------------------------------------------------------------------
 * 2. Price — range + selected variation
 * ------------------------------------------------------------------- */
.single-product .wd-single-price .price,
.single-product > * .price ins,
.single-product .price .woocommerce-Price-amount {
    color: var(--wag-ink);
}

.single-product .wd-single-price .price {
    font-family: "Fredoka", var(--wd-title-font, sans-serif);
    font-size: 22px;
    font-weight: 600;
}

/* Selected-variation price bar */
.single-product .single_variation .woocommerce-variation-price .price,
.single-product .woocommerce-variation-price .price {
    margin: 0;
    color: var(--wag-blue);
    font-family: "Fredoka", var(--wd-title-font, sans-serif);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.single-product .woocommerce-variation-price .price del {
    color: var(--wag-muted);
    font-size: 18px;
    font-weight: 500;
    opacity: .8;
}

.single-product .woocommerce-variation-price .price .woocommerce-Price-currencySymbol {
    font-size: .62em;
    font-weight: 600;
    vertical-align: super;
}

/* The single_variation block = price + availability row */
.single-product .single_variation_wrap .single_variation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 6px 0 16px;
    padding: 16px 18px;
    border: 1px solid var(--wag-line);
    border-radius: var(--wag-radius);
    background: linear-gradient(180deg, #fbfcff 0%, #f5f7ff 100%);
}

.single-product .single_variation .wd-scroll-content {
    display: contents;
}

.single-product .single_variation .stock {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
}

.single-product form.variations_form.wagport-sku-mode .single_variation {
    display: none !important;
}

/* ---------------------------------------------------------------------
 * 3. Quantity stepper + Add to cart
 * ------------------------------------------------------------------- */
.single-product .woocommerce-variation-add-to-cart,
.single-product form.cart:not(.variations_form) {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.single-product form.cart .quantity {
    display: inline-flex;
    align-items: stretch;
    height: 56px;
    border: 1.5px solid var(--wag-line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.single-product form.variations_form.wagport-sku-mode .quantity {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
}

.single-product form.cart .quantity input.minus,
.single-product form.cart .quantity input.plus,
.single-product form.cart .quantity .minus,
.single-product form.cart .quantity .plus {
    width: 46px;
    height: auto;
    margin: 0;
    border: 0;
    background: #f6f8fc;
    color: var(--wag-ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.single-product form.cart .quantity input.minus:hover,
.single-product form.cart .quantity input.plus:hover,
.single-product form.cart .quantity .minus:hover,
.single-product form.cart .quantity .plus:hover {
    background: var(--wag-blue);
    color: #fff;
}

.single-product form.cart .quantity input.qty {
    width: 58px;
    height: auto;
    margin: 0;
    border: 0;
    border-left: 1px solid var(--wag-line-soft);
    border-right: 1px solid var(--wag-line-soft);
    background: #fff;
    color: var(--wag-ink);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.single-product form.cart .single_add_to_cart_button {
    flex: 1 1 220px;
    min-height: 56px;
    padding: 0 28px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #3a59f5 0%, var(--wag-blue) 55%, var(--wag-blue-dark) 100%);
    box-shadow: 0 12px 24px -12px rgba(52, 82, 239, .7);
    color: #fff;
    font-family: "Fredoka", var(--wd-title-font, sans-serif);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: none;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.single-product form.cart .single_add_to_cart_button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px -12px rgba(52, 82, 239, .75);
    filter: brightness(1.04);
}

.single-product form.cart .single_add_to_cart_button:active {
    transform: translateY(0);
}

.single-product form.cart .single_add_to_cart_button.disabled,
.single-product form.cart .single_add_to_cart_button:disabled {
    background: #c7cede;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ---------------------------------------------------------------------
 * 4. Bulk-pricing (Advanced Dynamic Pricing) table
 * ------------------------------------------------------------------- */
.single-product .wdp_bulk_table_content {
    display: block;
    margin-top: 22px;
}

.single-product .wdp_bulk_table_content .bulk_table {
    border: 1px solid var(--wag-line);
    border-radius: var(--wag-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px -24px rgba(27, 36, 51, .5);
}

.single-product .wdp_pricing_table_caption {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 13px 18px;
    background: linear-gradient(90deg, var(--wag-blue-soft), #f7f9ff);
    border-bottom: 1px solid var(--wag-line);
    color: var(--wag-ink) !important;
    font-family: "Fredoka", var(--wd-title-font, sans-serif);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .2px;
}

.single-product .wdp_pricing_table_caption::before {
    content: "";
    width: 18px;
    height: 18px;
    background: var(--wag-gold);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 6a3 3 0 0 1 3-3h7l8 8-9 9-9-9V6Zm4 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'><path d='M3 6a3 3 0 0 1 3-3h7l8 8-9 9-9-9V6Zm4 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z'/></svg>") center/contain no-repeat;
}

.single-product table.wdp_pricing_table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    font-size: 13.5px;
}

.single-product table.wdp_pricing_table thead td {
    padding: 10px 18px;
    border: 0;
    background: #fbfcfe;
    color: var(--wag-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.single-product table.wdp_pricing_table tbody td {
    padding: 11px 18px;
    border: 0;
    border-top: 1px solid var(--wag-line-soft);
    color: var(--wag-ink);
    font-weight: 600;
    vertical-align: middle;
}

.single-product table.wdp_pricing_table tbody tr:nth-child(even) td {
    background: #fafbff;
}

.single-product table.wdp_pricing_table tbody td:nth-child(2) {
    color: #1f7a44;
    font-weight: 700;
}

.single-product table.wdp_pricing_table tbody td:last-child,
.single-product table.wdp_pricing_table tbody td:last-child .amount {
    color: var(--wag-blue);
    font-weight: 800;
}

/* ---------------------------------------------------------------------
 * 5. Secondary actions — compare / wishlist
 * ------------------------------------------------------------------- */
.single-product .wd-action-btn.wd-style-text > a,
.single-product .wd-action-btn > a {
    color: var(--wag-muted);
    font-size: 13px;
    font-weight: 600;
    transition: color .15s ease;
}

.single-product .wd-action-btn > a:hover {
    color: var(--wag-blue);
}

.single-product .wd-action-btn > a::before {
    color: inherit;
}

/* ---------------------------------------------------------------------
 * 6. Trust / delivery info line
 * ------------------------------------------------------------------- */
.single-product .wd-single-info-text,
.single-product .wd-product-delivery,
.single-product .product-delivery-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 16px;
    border: 1px dashed var(--wag-line);
    border-radius: 12px;
    background: var(--wag-gold-soft);
    color: #6a5526;
    font-size: 13.5px;
    font-weight: 600;
}

/* ---------------------------------------------------------------------
 * 7. Gallery polish
 * ------------------------------------------------------------------- */
.single-product .wd-single-gallery .woocommerce-product-gallery__image,
.single-product .wd-single-gallery figure {
    border-radius: var(--wag-radius);
    overflow: hidden;
}

.single-product .wd-single-gallery .product-image-wrap,
.single-product .wd-single-gallery .wd-carousel-item img {
    border-radius: var(--wag-radius);
}

.single-product .wd-single-gallery .product-thumbnails img,
.single-product .wd-single-gallery .wd-gallery-thumb img {
    border-radius: 12px;
    transition: box-shadow .15s ease, opacity .15s ease;
}

.single-product .wd-single-gallery .wd-nav-arrow,
.single-product .wd-single-gallery .wd-buttons .wd-zoom {
    color: var(--wag-blue);
}

/* ---------------------------------------------------------------------
 * 8. Tabs (Description / Additional info / Reviews)
 * ------------------------------------------------------------------- */
.single-product .wd-single-tabs .wd-nav-tabs {
    gap: 4px;
    border-bottom: 2px solid var(--wag-line);
}

.single-product .wd-single-tabs .wd-nav-tabs > li > a,
.single-product .wd-single-tabs .wd-nav-tabs > li > span {
    padding: 12px 4px;
    color: var(--wag-muted);
    font-family: "Fredoka", var(--wd-title-font, sans-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .2px;
}

.single-product .wd-single-tabs .wd-nav-tabs > li.active > a,
.single-product .wd-single-tabs .wd-nav-tabs > li.active > span,
.single-product .wd-single-tabs .wd-nav-tabs > li:hover > a {
    color: var(--wag-ink);
}

.single-product .wd-single-tabs .wd-nav-tabs > li.active::after,
.single-product .wd-single-tabs .wd-nav-tabs > li.active > a::after {
    background: var(--wag-blue);
}

.single-product .wc-tab,
.single-product .woocommerce-Tabs-panel {
    color: #495163;
    font-size: 15px;
    line-height: 1.75;
}

.single-product .wc-tab p {
    margin-bottom: 14px;
}

.single-product .wc-tab ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.single-product .wc-tab ul li {
    position: relative;
    margin: 0 0 9px;
    padding-left: 26px;
    line-height: 1.6;
}

.single-product .wc-tab ul li::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wag-blue-soft);
    box-shadow: inset 0 0 0 1px rgba(52, 82, 239, .35);
}

.single-product .wc-tab ul li::after {
    content: "";
    position: absolute;
    top: 11px;
    left: 5px;
    width: 6px;
    height: 3px;
    border-left: 1.5px solid var(--wag-blue);
    border-bottom: 1.5px solid var(--wag-blue);
    transform: rotate(-45deg);
}

/* ---------------------------------------------------------------------
 * 9. Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .single-product .woocommerce-variation-price .price {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    .single-product form.cart .single_add_to_cart_button {
        flex: 1 1 100%;
    }

    .single-product form.cart .quantity {
        flex: 0 0 auto;
    }

    .single-product .single_variation_wrap .single_variation {
        padding: 14px;
    }
}

/* =====================================================================
 * 10. Re-composed hero: gallery (left, sticky) + unified buy-box (right)
 *     Built by wagport-pdp.js out of the existing WooDmart blocks.
 * ===================================================================== */
.single-product .wagport-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(372px, 0.96fr);
    gap: 44px;
    align-items: start;
    margin: 6px 0 4px;
}

.single-product .wagport-hero__media {
    position: sticky;
    top: 92px;
    min-width: 0;
}

.single-product .wagport-hero__media .wd-single-gallery {
    width: 100%;
}

.single-product .wagport-hero__buy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* normalise spacing of the relocated WooDmart blocks inside the buy-box */
.single-product .wagport-hero__buy > .wd-single-title,
.single-product .wagport-hero__buy > .wd-single-price,
.single-product .wagport-hero__buy > .wd-single-add-cart,
.single-product .wagport-hero__buy > .woocommerce-product-details__short-description,
.single-product .wagport-hero__buy > [class*="wd-single-short"] {
    width: 100%;
    margin: 0;
    float: none;
}

.single-product .wagport-hero__buy > * {
    margin-bottom: 18px;
}

.single-product .wagport-hero__buy > .wd-single-title {
    margin-bottom: 10px;
}

.single-product .wagport-hero__buy .woocommerce-product-details__short-description {
    margin: 2px 0 4px;
    padding-top: 16px;
    border-top: 1px solid var(--wag-line-soft);
}

/* ---- Rating row ----------------------------------------------------- */
.single-product .wagport-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}

.single-product .wagport-rating__stars {
    --p: 0%;
    font-size: 17px;
    letter-spacing: 2px;
    line-height: 1;
    background: linear-gradient(90deg, var(--wag-gold) var(--p), #d6dbe6 var(--p));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.single-product .wagport-rating__stars::before {
    content: "★★★★★";
}

.single-product .wagport-rating__note {
    color: var(--wag-muted);
    font-size: 13px;
    font-weight: 600;
}

.single-product .wagport-rating__note:hover {
    color: var(--wag-blue);
}

/* ---- Trust chips ---------------------------------------------------- */
.single-product .wagport-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 6px;
}

.single-product .wagport-trust__chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 1px solid var(--wag-line);
    border-radius: 12px;
    background: #fff;
    color: #45505f;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
}

.single-product .wagport-trust__chip svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--wag-blue);
}

/* ---- SKU table flash (when tapping CTA before choosing) ------------- */
.single-product .wagport-sku-section.wagport-flash {
    animation: wagport-flash 1.4s ease;
}

@keyframes wagport-flash {
    0%, 100% { box-shadow: 0 24px 50px -38px rgba(27, 36, 51, .55); }
    25%, 60% { box-shadow: 0 0 0 3px rgba(52, 82, 239, .55); }
}

/* ---------------------------------------------------------------------
 * 11. Mobile sticky add-to-cart bar
 * ------------------------------------------------------------------- */
.wagport-sticky-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--wag-toolbar-h, 0px);
    z-index: 340;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    padding-bottom: 10px;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e4e8f2;
    box-shadow: 0 -10px 28px -18px rgba(0, 0, 0, .35);
    transform: translateY(160%);
    transition: transform .25s ease;
}

.wagport-sticky-buy.is-visible {
    transform: translateY(0);
}

.wagport-sticky-buy__price {
    flex: 0 0 auto;
    min-width: 64px;
    color: #3452ef;
    font-family: "Fredoka", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.wagport-sticky-buy__cta {
    flex: 1 1 auto;
    min-height: 48px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(180deg, #3a59f5, #3452ef 55%, #2740c4) !important;
    box-shadow: 0 10px 20px -10px rgba(52, 82, 239, .7);
    color: #fff !important;
    font-family: "Fredoka", "Albert Sans", sans-serif !important;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
}

.wagport-sticky-buy__cta:hover {
    filter: brightness(1.05);
}

.wagport-sticky-buy__cta.is-done {
    background: #1f7a44 !important;
}

/* ---------------------------------------------------------------------
 * 12. Hero responsive
 * ------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .single-product .wagport-hero {
        grid-template-columns: minmax(0, 1fr) minmax(330px, 0.92fr);
        gap: 28px;
    }

    .single-product .wagport-hero__media {
        position: static;
    }
}

@media (max-width: 767px) {
    .single-product .wagport-hero {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .single-product .wagport-hero__media,
    .single-product .wd-single-gallery,
    .single-product .woocommerce-product-gallery,
    .single-product .wd-carousel-container,
    .single-product .wd-carousel-inner,
    .single-product .wd-carousel {
        max-width: 100%;
        overflow-x: hidden;
    }

    .single-product .wd-single-gallery .zoomImg {
        display: none !important;
    }

    .single-product .wagport-trade-metrics {
        grid-template-columns: 1fr;
    }

    .single-product .wagport-trust {
        grid-template-columns: 1fr;
    }

    .wagport-sticky-buy {
        display: flex;
    }

    body.single-product {
        padding-bottom: calc(var(--wag-toolbar-h, 0px) + 78px);
    }
}
