/**
 * Pan Product Experience — storefront adaptation for es.allofpan.com.
 *
 * This layer intentionally contains presentation only. Product templates,
 * WooCommerce hooks, ACF fields and cart behavior remain owned by the plugin.
 */

body.single-product {
    --pan-storefront-blue: #02225a;
    --pan-storefront-sky: #04abde;
    --pan-storefront-yellow: #fecc20;
    --pan-storefront-ink: #363636;
    --pan-storefront-muted: #74819a;
    --pan-storefront-line: #d7dfeb;
    --pan-storefront-card: #f5f3ea;
}

/* Product hero */
body.single-product.woocommerce div.product[id^="product-"] > .row {
    background: #fff;
}

body.single-product.woocommerce div.product[id^="product-"] .gallery-original-container,
body.single-product.woocommerce div.product[id^="product-"] .bg-product,
body.single-product.woocommerce div.product[id^="product-"] .woocommerce-product-gallery__image {
    background-color: var(--pan-storefront-card) !important;
}

/* The legacy gallery leaves its loading veil active although the images are
 * already complete on staging. Keep the product visible without changing the
 * gallery markup or controls. */
body.single-product.woocommerce div.product[id^="product-"] .wcgs-gallery-preloader {
    display: none !important;
}

body.single-product.woocommerce div.product[id^="product-"] .summary-inner {
    display: block !important;
    width: 100% !important;
    max-width: 680px !important;
    padding: clamp(32px, 5vw, 72px) clamp(24px, 5vw, 72px) !important;
    color: var(--pan-storefront-ink);
}

:is(#pan-product-typography-override, body.single-product.woocommerce) div.product[id^="product-"] h1.product_title.entry-title {
    margin: 0 0 12px !important;
    color: var(--pan-storefront-blue) !important;
    font-family: "Metropolis-Bold", Arial, sans-serif !important;
    font-size: 40px !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
    line-height: 48px !important;
    text-transform: none !important;
}

body.single-product.woocommerce div.product[id^="product-"] .woocommerce-product-details__short-description {
    margin: 0 0 22px !important;
    color: #212529 !important;
    font-family: "Metropolis-Regular", Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    line-height: 24px !important;
    white-space: normal !important;
}

body.single-product.woocommerce div.product[id^="product-"] .woocommerce-product-details__short-description p {
    margin: 0 0 14px !important;
    color: inherit !important;
    font: inherit !important;
    line-height: inherit !important;
}

body.single-product.woocommerce div.product[id^="product-"] p.price,
body.single-product.woocommerce div.product[id^="product-"] span.price {
    display: block;
    margin: 22px 0 28px !important;
    color: var(--pan-storefront-blue) !important;
    font-family: "Metropolis-Bold", Arial, sans-serif !important;
    font-size: 48px !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    line-height: 72px !important;
}

body.single-product.woocommerce div.product[id^="product-"] p.price del,
body.single-product.woocommerce div.product[id^="product-"] span.price del {
    color: var(--pan-storefront-muted) !important;
    font-size: 0.6em;
    opacity: 1;
}

body.single-product.woocommerce div.product[id^="product-"] p.price ins,
body.single-product.woocommerce div.product[id^="product-"] span.price ins {
    color: var(--pan-storefront-blue) !important;
    text-decoration: none;
}

/* Quantity and primary purchase action */
/* Secondary information stays below the native purchase controls. */
body.single-product.woocommerce div.product[id^="product-"] .pan-product-details {
    margin: 24px 0 0;
    padding: 0;
    border-top: 1px solid var(--pan-storefront-line);
    border-bottom: 1px solid var(--pan-storefront-line);
    color: var(--pan-storefront-ink);
    font: 15px/1.6 "Metropolis-Regular", Arial, sans-serif;
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    padding: 14px 2px;
    color: var(--pan-storefront-blue);
    font-family: "Metropolis-Bold", Arial, sans-serif;
    list-style: none;
    cursor: pointer;
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details > summary::-webkit-details-marker {
    display: none;
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details > summary:focus-visible {
    outline: 3px solid var(--pan-storefront-blue);
    outline-offset: 3px;
    border-radius: 3px;
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details__chevron {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details[open] .pan-product-details__chevron {
    transform: rotate(225deg);
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details__content {
    padding: 0 2px 16px;
    overflow-wrap: anywhere;
}

body.single-product.woocommerce div.product[id^="product-"] .pan-product-details__content > :last-child {
    margin-bottom: 0;
}

/* Quantity and primary purchase action (unchanged). */
body.single-product.woocommerce div.product[id^="product-"] form.cart {
    display: flex !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 0 28px !important;
}

body.single-product.woocommerce div.product[id^="product-"] form.cart .quantity {
    float: none !important;
    flex: 0 0 146px !important;
    width: 146px !important;
    height: 59px !important;
    margin: 0 !important;
    overflow: hidden;
    border: 1px solid var(--pan-storefront-line) !important;
    border-radius: 12px !important;
    background: #f6f8fb !important;
}

body.single-product.woocommerce div.product[id^="product-"] form.cart .quantity .qty {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--pan-storefront-blue) !important;
    font-family: "Metropolis-Bold", Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 59px !important;
    text-align: center !important;
    box-shadow: none !important;
}

body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button,
body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button:hover,
body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button:focus {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    float: none !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 59px !important;
    margin: 0 !important;
    padding: 0 28px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--pan-storefront-blue) !important;
    color: #fff !important;
    font-family: "Metropolis-Bold", Arial, sans-serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
    transform: none !important;
}

body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button:hover,
body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button:focus-visible {
    background: #0b326f !important;
    box-shadow: 0 8px 18px rgba(2, 34, 90, 0.18) !important;
}

body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button:focus-visible {
    outline: 3px solid rgba(4, 171, 222, 0.35) !important;
    outline-offset: 3px;
}

body.single-product.woocommerce div.product[id^="product-"] .product_meta {
    color: var(--pan-storefront-muted);
    font-family: "Metropolis-Regular", Arial, sans-serif;
    font-size: 13px;
}

/* Keep the plugin badges within the Spain visual system. */
body.single-product.woocommerce div.product[id^="product-"] .product-badges-container {
    margin-bottom: 22px !important;
}

body.single-product.woocommerce div.product[id^="product-"] .badge-pill {
    border: 1px solid rgba(2, 34, 90, 0.08);
    color: var(--pan-storefront-blue) !important;
    font-family: "Metropolis-Bold", Arial, sans-serif !important;
    font-size: 11px !important;
    letter-spacing: 0.01em;
}

@media (max-width: 767px) {
    body.single-product.woocommerce div.product[id^="product-"] .summary-inner {
        max-width: none !important;
        padding: 32px 20px 40px !important;
    }

    :is(#pan-product-typography-override, body.single-product.woocommerce) div.product[id^="product-"] h1.product_title.entry-title {
        font-size: 32px !important;
        line-height: 38.4px !important;
    }

    body.single-product.woocommerce div.product[id^="product-"] form.cart {
        flex-wrap: wrap !important;
    }

    body.single-product.woocommerce div.product[id^="product-"] form.cart .quantity {
        flex-basis: 146px !important;
    }

    body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button {
        flex-basis: calc(100% - 156px) !important;
    }
}

@media (max-width: 560px) {
    body.single-product.woocommerce div.product[id^="product-"] form.cart .quantity,
    body.single-product.woocommerce div.product[id^="product-"] form.cart button.single_add_to_cart_button {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
}
