/* --------------------------------------------------------------------------
   Helios Configurator: design tokens
   -------------------------------------------------------------------------- */
:root {
    --hc-background: #f8f5ef;
    --hc-card: #ffffff;
    --hc-border: #ece6dd;
    --hc-text: #3c352f;
    --hc-muted: #746b63;
    --hc-accent: #6f826a;
    --hc-accent-hover: #5f705a;
    --hc-wood: #c9a46c;
    --hc-radius: 22px;
    --hc-shadow: 0 14px 40px rgb(60 53 47 / 8%);
}

/* --------------------------------------------------------------------------
   Product layout
   -------------------------------------------------------------------------- */
body.single-product {
    background: var(--hc-background);
    color: var(--hc-text);
    font-family: "Poppins", sans-serif;
}

.single-product div.product {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(360px, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}

.single-product div.product > .woocommerce-product-gallery,
.single-product div.product > .summary.entry-summary {
    float: none;
    width: 100% !important;
    max-width: none !important;
    margin: 0;
}

.woocommerce-product-gallery {
    position: relative;
    min-width: 0;
}

.summary.entry-summary {
    box-sizing: border-box;
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius);
    background: var(--hc-card);
    box-shadow: var(--hc-shadow);
}

.woocommerce-tabs,
.wc-tabs-wrapper {
    grid-column: 1 / -1;
    box-sizing: border-box;
    width: 100%;
    margin: clamp(42px, 7vw, 88px) 0 0;
    padding: clamp(26px, 4vw, 42px);
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius);
    background: var(--hc-card);
    box-shadow: var(--hc-shadow);
}

/* --------------------------------------------------------------------------
   Live preview
   Text coordinates are set exclusively by position.js and layout.js.
   -------------------------------------------------------------------------- */
#hc-preview-sticky {
    position: relative;
}

#hc-preview {
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(14px, 2.5vw, 28px);
    border: 1px solid var(--hc-border);
    border-radius: var(--hc-radius);
    background: var(--hc-card);
    box-shadow: var(--hc-shadow);
}

#hc-canvas {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: calc(var(--hc-radius) - 8px);
    aspect-ratio: 1 / 1;
}

#hc-base {
    display: block;
    width: 100%;
    height: auto;
}

#hc-animal {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#hc-foreground-cloud {
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    clip-path: polygon(
        47.5% 86%,
        48.5% 80%,
        52% 77%,
        56% 77%,
        57% 73%,
        61% 70%,
        65% 70%,
        68% 73%,
        70% 76%,
        73% 75%,
        76% 77%,
        79% 80%,
        81.5% 84%,
        81.5% 86%
    );
}

#hc-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
}

.hc-text {
    position: absolute;
    z-index: 20;
    white-space: nowrap;
    color: #ffffff;
    text-align: center;
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    line-height: 1.1;
}

/* --------------------------------------------------------------------------
   Product information
   -------------------------------------------------------------------------- */
.summary.entry-summary .product_title {
    margin: 0 0 10px;
    color: var(--hc-text);
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.summary.entry-summary .price {
    margin: 0 0 20px;
    color: var(--hc-wood);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 700;
}

.summary.entry-summary .woocommerce-product-details__short-description {
    margin-bottom: 24px;
    color: var(--hc-muted);
    font-size: 15px;
    line-height: 1.75;
}

.hc-product-usps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.hc-product-usps li {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 8px;
    border: 1px solid var(--hc-border);
    border-radius: 14px;
    color: var(--hc-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
}

.hc-product-usps svg {
    width: 20px;
    height: 20px;
    margin: 0 auto;
    stroke: var(--hc-accent);
}

/* --------------------------------------------------------------------------
   WAPF fields and standard WooCommerce controls
   -------------------------------------------------------------------------- */
.summary.entry-summary .wapf-field-container,
.summary.entry-summary .wapf-field-row {
    margin: 0 0 20px;
}

.summary.entry-summary .wapf-field-label,
.summary.entry-summary label {
    display: block;
    margin: 0 0 8px;
    color: var(--hc-text);
    font-size: 14px;
    font-weight: 600;
}

.summary.entry-summary input:not([type="radio"]):not([type="checkbox"]),
.summary.entry-summary select,
.summary.entry-summary textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 54px;
    padding: 12px 15px;
    border: 1px solid var(--hc-border);
    border-radius: 13px;
    background: #fffdfa;
    color: var(--hc-text);
    font: inherit;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.summary.entry-summary textarea {
    min-height: 110px;
    resize: vertical;
}

.summary.entry-summary input:not([type="radio"]):not([type="checkbox"]):focus,
.summary.entry-summary select:focus,
.summary.entry-summary textarea:focus {
    border-color: var(--hc-accent);
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgb(111 130 106 / 14%);
}

.hc-choice {
    position: relative;
    display: inline-flex;
    margin: 0 8px 10px 0;
    cursor: pointer;
}

.hc-choice .wapf-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.hc-choice label,
label.hc-choice {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin: 0;
    padding: 8px 13px 8px 9px;
    border: 1px solid var(--hc-border);
    border-radius: 13px;
    background: #ffffff;
    color: var(--hc-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.hc-choice:hover label,
label.hc-choice:hover {
    border-color: #cfc5b8;
    transform: translateY(-1px);
}

.hc-choice.hc-choice--selected label,
label.hc-choice.hc-choice--selected {
    border-color: var(--hc-accent);
    box-shadow: 0 0 0 2px var(--hc-accent);
}

.hc-choice:focus-within label,
label.hc-choice:focus-within {
    outline: 3px solid rgb(111 130 106 / 28%);
    outline-offset: 2px;
}

.hc-colour-swatch {
    display: inline-block;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border: 1px solid rgb(60 53 47 / 18%);
    border-radius: 50%;
    background: var(--hc-swatch-colour);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 30%);
}

.hc-animal-choice label,
label.hc-animal-choice {
    display: grid;
    justify-items: center;
    width: 82px;
    min-height: 92px;
    padding: 11px 8px;
    text-align: center;
}

/* WAPF renders each radio in a checkable wrapper; keep those wrappers inline
   and let the field create a new row only when its available width is used. */
.wapf-field-input:has(.hc-animal-choice) {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wapf-field-input:has(.hc-animal-choice) .wapf-checkable {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto !important;
    margin: 0;
}

.wapf-field-input:has(.hc-animal-choice) .hc-choice {
    margin: 0;
}

.hc-animal-icon {
    font-size: 28px;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Add to cart and product tabs
   -------------------------------------------------------------------------- */
.summary.entry-summary .cart {
    margin-top: 26px;
}

.summary.entry-summary .quantity {
    display: none;
}

.summary.entry-summary .single_add_to_cart_button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    margin: 0;
    padding: 14px 24px;
    border: 0;
    border-radius: 14px;
    background: var(--hc-accent);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.summary.entry-summary .single_add_to_cart_button:hover,
.summary.entry-summary .single_add_to_cart_button:focus {
    background: var(--hc-accent-hover);
    color: #ffffff;
    box-shadow: 0 10px 18px rgb(95 112 90 / 24%);
    transform: translateY(-1px);
}

.woocommerce-tabs ul.tabs {
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.woocommerce-tabs ul.tabs::before,
.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::after {
    display: none;
}

.woocommerce-tabs ul.tabs li {
    margin: 0 8px 0 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
}

.woocommerce-tabs ul.tabs li a {
    padding: 9px 12px;
    color: var(--hc-muted);
    font-weight: 600;
}

.woocommerce-tabs ul.tabs li.active {
    background: #f0ede6;
}

.woocommerce-tabs ul.tabs li.active a {
    color: var(--hc-text);
}

/* --------------------------------------------------------------------------
   Responsive layout
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
    .single-product div.product {
        grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.9fr);
        gap: 28px;
    }

    .summary.entry-summary {
        padding: 26px;
    }

    .hc-product-usps {
        grid-template-columns: 1fr;
    }

    .hc-product-usps li {
        grid-template-columns: 20px 1fr;
        align-items: center;
        text-align: left;
    }
}

@media (max-width: 760px) {
    .single-product div.product {
        display: block;
    }

    .woocommerce-product-gallery {
        margin-bottom: 24px !important;
    }

    .summary.entry-summary {
        padding: 24px 20px;
        border-radius: 18px;
    }

    #hc-preview {
        padding: 12px;
        border-radius: 18px;
    }

    #hc-canvas {
        border-radius: 11px;
    }

    .woocommerce-tabs,
    .wc-tabs-wrapper {
        margin-top: 40px;
        padding: 24px 20px;
        border-radius: 18px;
    }

    .hc-product-usps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hc-product-usps li {
        display: grid;
        text-align: center;
    }
}
