/*
==================================================
HUEGO — SINGLE PRODUCT
File: assets/css/pages/single-product.css
==================================================
*/

/*
==================================================
1. PAGE TOKENS
==================================================
*/

.single-product {
    --huego-single-padding-top: 32px;
    --huego-single-padding-bottom: 64px;
    --huego-single-column-gap: 24px;
    --huego-single-radius: 16px;
    --huego-description-collapsed-height: 300px;
}

/*
==================================================
2. HERO / LAYOUT
==================================================
*/

.single-product .huego-single-hero,
.single-product .huego-single-hero *,
.single-product .huego-single-hero *::before,
.single-product .huego-single-hero *::after {
    box-sizing: border-box;
}

/*
 * Width/max-width remain controlled by the existing Elementor container.
 * HUEGO only owns spacing, overflow protection and responsive behavior.
 */
.single-product .huego-single-hero {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    padding-top: var(--huego-single-padding-top);
    padding-bottom: var(--huego-single-padding-bottom);
}

.single-product .huego-single-gallery,
.single-product .huego-single-summary,
.single-product .huego-single-benefits,
.single-product .huego-single-product {
    min-width: 0;
    margin: 0;
}

.single-product .huego-single-gallery {
    padding-right: calc(var(--huego-single-column-gap) / 2);
}

.single-product .huego-single-summary {
    padding-right: calc(var(--huego-single-column-gap) / 2);
    padding-left: calc(var(--huego-single-column-gap) / 2);
}

.single-product .huego-single-benefits {
    padding-left: calc(var(--huego-single-column-gap) / 2);
}

/*
==================================================
3. CONTENT SAFETY
==================================================
*/

.single-product .huego-single-gallery img,
.single-product .huego-single-summary img,
.single-product .huego-single-benefits img {
    display: block;
    max-width: 100%;
    height: auto;
}

.single-product .huego-single-summary p,
.single-product .huego-single-summary li,
.single-product .huego-single-benefits p {
    overflow-wrap: break-word;
}

.single-product .huego-single-product-attributes table.woocommerce-product-attributes {
    width: 100%;
    max-width: 100%;
}

/*
==================================================
4. PRODUCT META — SKU / STOCK
==================================================
*/

.single-product .huego-single-product-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
    gap: 0;
    margin: 0 0 18px;
}

.single-product .huego-single-product-sku {
    display: flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    margin: 0;
}

.single-product .huego-single-product-sku::after {
    content: "";
    display: block;
    flex: 0 0 auto;
    width: 1px;
    height: 14px;
    margin: 0 14px;
    background-color: var(--huego-color-border);
}

.single-product .huego-single-product-stock {
    width: auto;
    max-width: 100%;
    margin: 0;
}

/*
==================================================
5. PRODUCT DESCRIPTION — COLLAPSE / EXPAND
==================================================
*/

.single-product .huego-product-description {
    position: relative;
    width: 100%;
}

.single-product .huego-product-description-content {
    position: relative;
    max-height: var(--huego-description-collapsed-height);
    overflow: hidden;
    transition: max-height 0.45s ease;
}

.single-product .huego-product-description.is-expanded .huego-product-description-content {
    max-height: none;
    overflow: visible;
}

.single-product .huego-description-fade {
    position: absolute;
    right: 0;
    bottom: 44px;
    left: 0;
    z-index: 2;
    height: 110px;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        color-mix(in srgb, var(--huego-color-surface) 80%, transparent) 55%,
        var(--huego-color-surface) 100%
    );
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.single-product .huego-description-toggle {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 120px;
    min-height: 40px;
    margin: 0 auto;
    padding: 9px 18px;
    border: 1px solid var(--huego-color-primary);
    border-radius: 9px;
    background-color: var(--huego-color-surface);
    color: var(--huego-color-primary);
    font-family: var(--huego-font-family);
    font-size: var(--huego-font-size-button);
    font-weight: var(--huego-font-weight-semibold);
    line-height: var(--huego-line-height-button);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.single-product .huego-description-toggle:hover {
    background-color: var(--huego-color-primary);
    color: var(--huego-color-white);
}

.single-product .huego-description-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--huego-color-focus-ring);
}

.single-product .huego-description-toggle:active {
    transform: translateY(1px);
}

.single-product .huego-description-toggle-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.single-product .huego-product-description.is-expanded .huego-description-fade {
    opacity: 0;
    visibility: hidden;
}

.single-product .huego-product-description.is-not-collapsible .huego-description-fade,
.single-product .huego-product-description.is-not-collapsible .huego-description-toggle {
    display: none;
}

/*
==================================================
6. BENEFIT CARDS — HUEGO CONTRACT
==================================================
*/

/*
 * Native benefit cards use stable HUEGO classes from the renderer.
 */
.single-product .huego-single-benefits {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 16px;
    min-width: 0;
    height: auto;
}

.single-product .huego-single-benefits > .huego-single-benefit-box {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
}

.single-product .huego-benefit-shell,
.single-product .huego-benefit-adapter,
.single-product .huego-benefit-surface {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
}

.single-product .huego-benefit-surface {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 10px !important;
}

.single-product .huego-benefit-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
}

.single-product .huego-benefit-title,
.single-product .huego-benefit-body p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.single-product .huego-benefit-icon {
    margin: 0 0 10px !important;
}

.single-product .huego-benefit-title {
    margin-bottom: 7px !important;
}

/*
==================================================
7. VARIATION SWATCHES — WOOCOMMERCE COMPATIBILITY
==================================================
*/

/*
 * Keep the variation form aligned with HUEGO's single-product presentation.
 * These selectors are intentionally scoped to single-product pages and only
 * activate when the installed swatch plugin renders the matching classes.
 */
.single-product .variations {
    margin-bottom: 20px !important;
}

.single-product .variations th.label {
    padding-right: 25px;
    vertical-align: middle;
}

.single-product .variations th.label label {
    font-weight: var(--huego-font-weight-semibold);
    color: var(--huego-color-primary);
}

.single-product .variable-items-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.single-product .variable-item.button-variable-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 44px;
    padding: 0 18px !important;
    border: 1px solid var(--huego-color-border) !important;
    border-radius: 5px !important;
    background: var(--huego-color-surface) !important;
    box-shadow: none !important;
    color: var(--huego-color-primary);
    font-size: var(--huego-font-size-body);
    font-weight: 500;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.single-product .variable-item.button-variable-item:hover {
    border-color: var(--huego-color-primary) !important;
    color: var(--huego-color-primary) !important;
}

.single-product .variable-item.button-variable-item.selected {
    border-color: var(--huego-color-primary) !important;
    background: var(--huego-color-primary) !important;
    color: var(--huego-color-white) !important;
}

.single-product .variable-item.button-variable-item:focus-visible {
    outline: none;
    border-color: var(--huego-color-focus) !important;
    box-shadow: 0 0 0 3px var(--huego-color-focus-ring) !important;
}

.single-product .variable-item.button-variable-item .variable-item-span {
    color: inherit !important;
}

/*
 * variation-price.js mirrors the selected variation price into HUEGO's main
 * product-price area, so WooCommerce's secondary price output is redundant.
 */
.single-product .woocommerce-variation-price {
    display: none !important;
}

.single-product table.variations,
.single-product table.variations td,
.single-product table.variations th {
    background: transparent !important;
}

/*
==================================================
8. TABLET
==================================================
*/

@media screen and (max-width: 1024px) {
    .single-product {
        --huego-single-padding-top: 28px;
        --huego-single-padding-bottom: 48px;
        --huego-single-column-gap: 20px;
        --huego-description-collapsed-height: 280px;
    }

    .single-product .huego-single-hero {
        flex-wrap: wrap;
    }

    .single-product .huego-single-gallery {
        padding-right: calc(var(--huego-single-column-gap) / 2);
        padding-left: 0;
    }

    .single-product .huego-single-summary {
        padding-right: 0;
        padding-left: calc(var(--huego-single-column-gap) / 2);
    }

    .single-product .huego-single-benefits {
        margin-top: 32px;
        padding-right: 0;
        padding-left: 0;
    }
}

/*
==================================================
9. MOBILE
==================================================
*/

@media screen and (max-width: 767px) {
    .single-product {
        --huego-single-padding-top: 20px;
        --huego-single-padding-bottom: 40px;
        --huego-description-collapsed-height: 250px;
    }

    .single-product .huego-single-hero {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .single-product .huego-single-gallery,
    .single-product .huego-single-summary,
    .single-product .huego-single-benefits {
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    .single-product .huego-single-summary {
        margin-top: 24px;
    }

    .single-product .huego-single-benefits {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        margin-top: 28px;
    }

    .single-product .huego-single-benefits > .huego-single-benefit-box {
        flex: 0 0 calc(50% - 5px) !important;
        width: calc(50% - 5px) !important;
        max-width: calc(50% - 5px) !important;
        aspect-ratio: 1 / 1;
    }

    .single-product .huego-benefit-surface {
        padding: 12px 8px !important;
    }

    .single-product .huego-benefit-icon {
        margin-bottom: 8px !important;
    }

    .single-product .huego-benefit-title {
        margin-bottom: 6px !important;
    }

    .single-product .huego-single-product-meta {
        margin-bottom: 16px;
    }

    .single-product .huego-single-product-sku::after {
        margin-right: 10px;
        margin-left: 10px;
    }

    .single-product .huego-description-fade {
        bottom: 42px;
        height: 95px;
    }

    .single-product .huego-description-toggle {
        min-width: 114px;
        min-height: 38px;
        padding: 8px 14px;
    }
}

/*
==================================================
10. SMALL MOBILE
==================================================
*/

@media screen and (max-width: 480px) {
    .single-product {
        --huego-single-padding-top: 16px;
        --huego-single-padding-bottom: 32px;
    }
}
