/**
 * Hirad Product Color Options b_gh
 * Frontend UI
 * Author: behzad ghaemmaghami
 * Version: 1.0.0
 */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    --hpc-orange: #ff6703;
    --hpc-orange-2: #ff7a18;
    --hpc-orange-dark: #f45700;

    --hpc-text: #252525;
    --hpc-muted: #666;
    --hpc-line: rgba(20, 25, 35, 0.08);

    --hpc-glass:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.62) 0%,
            rgba(255, 255, 255, 0.42) 50%,
            rgba(248, 249, 252, 0.36) 100%
        );

    --hpc-glass-soft:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.54) 0%,
            rgba(255, 255, 255, 0.38) 100%
        );

    --hpc-border: rgba(255, 255, 255, 0.55);

    --hpc-shadow:
        0 10px 32px rgba(20, 25, 35, 0.06),
        0 2px 8px rgba(20, 25, 35, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);

    --hpc-shadow-hover:
        0 14px 38px rgba(20, 25, 35, 0.08),
        0 4px 12px rgba(20, 25, 35, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);

    --hpc-radius: 18px;
    --hpc-radius-md: 14px;
    --hpc-radius-sm: 11px;

    --hpc-blur: blur(14px) saturate(140%);
    --hpc-blur-md: blur(14px) saturate(140%);

    --hpc-success: #2f9d57;
    --hpc-danger: #d63638;
}

/* ==========================================================================
   2. MAIN WRAPPER
   ========================================================================== */

.single-product .hpc-product-color-options {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    width: 100%;
    margin: 18px 0 22px;
    padding: 20px;

    color: var(--hpc-text);

    background: var(--hpc-glass);
    border: 1px solid var(--hpc-border);
    border-radius: var(--hpc-radius);

    -webkit-backdrop-filter: var(--hpc-blur);
    backdrop-filter: var(--hpc-blur);

    box-shadow: var(--hpc-shadow);

    transition:
        transform 280ms ease,
        box-shadow 280ms ease,
        border-color 280ms ease;
}

.single-product .hpc-product-color-options::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;

    background:
        radial-gradient(
            circle at 88% 0%,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(255, 255, 255, 0.12) 38%,
            rgba(255, 255, 255, 0) 68%
        );
}

@media (hover: hover) {
    .single-product .hpc-product-color-options:hover {
        transform: translateY(-2px);
        border-color: rgba(255, 255, 255, 1);
        box-shadow: var(--hpc-shadow-hover);
    }
}

.hpc-product-color-options[hidden],
.hpc-selector[hidden],
.hpc-color-group[hidden] {
    display: none !important;
}

/* ==========================================================================
   3. SECTION / SELECTOR
   ========================================================================== */

.single-product .hpc-selector {
    position: relative;

    width: 100%;
    margin: 0;
    padding: 0;
}

.single-product .hpc-selector + .hpc-selector {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(20, 25, 35, 0.07);
}

.single-product .hpc-selector-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: 0 0 18px;
    padding: 0;

    color: var(--hpc-text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
}

.single-product .hpc-selector-heading-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.single-product .hpc-selector-heading-text::before {
    content: "";

    display: inline-block;
    flex: 0 0 auto;

    width: 8px;
    height: 24px;

    background:
        linear-gradient(
            to bottom,
            var(--hpc-orange-2),
            var(--hpc-orange)
        );

    border: 2px solid rgba(255, 255, 255, 0.76);
    border-radius: 999px;

    box-shadow:
        0 6px 14px rgba(255, 103, 3, 0.23),
        inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.single-product .hpc-required {
    color: var(--hpc-danger);
    font-weight: 900;
}

.single-product .hpc-selector-note {
    margin: -5px 0 12px;
    color: var(--hpc-muted);
    font-size: 11.5px;
    line-height: 1.8;
}

/* ==========================================================================
   4. SWATCH GRID
   ========================================================================== */

.hpc-product-color-options .hpc-color-group {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hpc-product-color-options .hpc-swatches {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 16px;
    align-items: start;
    justify-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
}

.hpc-product-color-options .hpc-color-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    text-align: center;
    overflow: visible;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.hpc-product-color-options .hpc-color-option::before,
.hpc-product-color-options .hpc-color-option::after {
    content: none;
    display: none;
}

.hpc-product-color-options .hpc-color-option > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hpc-product-color-options .hpc-color-image,
.hpc-product-color-options .hpc-color-image.hpc-color-image--empty {
    display: block;
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    min-height: 56px;
    max-height: 56px;
    margin: 0 auto 6px;
    padding: 0;
    object-fit: cover;
    object-position: center;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.38);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow:
        0 2px 8px rgba(20, 20, 20, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.hpc-product-color-options .hpc-color-image.hpc-color-image--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    line-height: 1;
}

.hpc-product-color-options .hpc-color-name {
    display: -webkit-box;
    width: 100%;
    max-width: 56px;
    min-height: 28px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #363636;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hpc-product-color-options .hpc-selector-heading {
    margin: 0 0 18px;
}

.hpc-product-color-options .hpc-selector[data-sub-selector] {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

@media (hover: hover) {
    .hpc-product-color-options .hpc-color-option:not(.is-disabled):hover {
        transform: translateY(-2px);
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .hpc-product-color-options .hpc-color-option:not(.is-disabled):hover .hpc-color-image {
        border-color: rgba(255, 105, 0, 0.42);
        box-shadow:
            0 5px 13px rgba(20, 20, 20, 0.11),
            0 0 0 2px rgba(255, 105, 0, 0.08);
    }
}

/* ==========================================================================
   5. ACTIVE / SELECTED STATE
   ========================================================================== */

.hpc-product-color-options .hpc-color-option.is-active,
.hpc-product-color-options .hpc-color-option.is-selected,
.hpc-product-color-options .hpc-color-option[aria-checked="true"],
.hpc-product-color-options .hpc-color-option:has(input[type="radio"]:checked) {
    transform: translateY(-2px);
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.hpc-product-color-options .hpc-color-option.is-active .hpc-color-image,
.hpc-product-color-options .hpc-color-option.is-selected .hpc-color-image,
.hpc-product-color-options .hpc-color-option[aria-checked="true"] .hpc-color-image,
.hpc-product-color-options .hpc-color-option:has(input[type="radio"]:checked) .hpc-color-image {
    border-color: #ff6900;
    box-shadow:
        0 5px 14px rgba(255, 105, 0, 0.18),
        0 0 0 2px rgba(255, 105, 0, 0.17);
    transform: translateY(-2px);
}

.hpc-product-color-options .hpc-color-option.is-active .hpc-color-name,
.hpc-product-color-options .hpc-color-option.is-selected .hpc-color-name,
.hpc-product-color-options .hpc-color-option[aria-checked="true"] .hpc-color-name,
.hpc-product-color-options .hpc-color-option:has(input[type="radio"]:checked) .hpc-color-name {
    color: #e85f00;
    font-weight: 700;
}

/* ==========================================================================
   6. DISABLED / UNAVAILABLE
   ========================================================================== */

.hpc-product-color-options .hpc-color-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.42;
    filter: grayscale(0.35);
}

.hpc-product-color-options .hpc-color-option.is-disabled:hover {
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.hpc-product-color-options .hpc-color-option.is-disabled:hover .hpc-color-image {
    border-color: rgba(255, 255, 255, 0.48);
    box-shadow:
        0 2px 8px rgba(20, 20, 20, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transform: none;
}

/* ==========================================================================
   7. MATERIAL DEPENDENT GROUPS
   ========================================================================== */

.single-product .hpc-material-status {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;

    color: #555;
    font-size: 12px;
    line-height: 1.8;

    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 12px;

    box-shadow:
        0 6px 16px rgba(20, 25, 35, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.single-product .hpc-material-status.is-visible {
    display: block;
}

.single-product .hpc-material-status strong {
    color: var(--hpc-orange);
}

/* ==========================================================================
   8. PRIMARY / SECONDARY LAYOUT
   ========================================================================== */

.single-product .hpc-dual-color-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.single-product .hpc-dual-color-wrap .hpc-selector {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.single-product .hpc-dual-color-wrap .hpc-selector + .hpc-selector {
    margin-top: 0;
    padding-top: 18px;
    border-top: 1px solid rgba(20, 25, 35, 0.07);
}

/* ==========================================================================
   9. INLINE MESSAGE
   ========================================================================== */

.single-product .hpc-inline-message {
    display: none;

    margin: 10px 0 0;
    padding: 10px 12px;

    color: #3e454d;
    font-size: 12px;
    line-height: 1.8;

    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-right: 3px solid var(--hpc-orange);
    border-radius: 11px;

    box-shadow:
        0 7px 18px rgba(20, 25, 35, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.single-product .hpc-inline-message.is-visible {
    display: block;
}

.single-product .hpc-inline-message.is-error {
    border-right-color: var(--hpc-danger);
}

.single-product .hpc-inline-message.is-success {
    border-right-color: var(--hpc-success);
}

/* ==========================================================================
   10. RESET BUTTON
   ========================================================================== */

.single-product .hpc-reset-selection {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-height: 34px;
    padding: 6px 11px;

    color: #626973;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.88),
            rgba(255, 255, 255, 0.60)
        );

    border: 1px solid rgba(255, 255, 255, 0.96);
    border-radius: 10px;

    box-shadow:
        0 6px 16px rgba(20, 25, 35, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);

    transition:
        color 180ms ease,
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.single-product .hpc-reset-selection:hover {
    color: var(--hpc-orange);
    transform: translateY(-1px);
    border-color: rgba(255, 103, 3, 0.20);
}

/* ==========================================================================
   11. LOADING STATE
   ========================================================================== */

.single-product .hpc-selector.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.62;
}

.single-product .hpc-selector.is-loading::after {
    content: "";

    position: absolute;
    top: 50%;
    left: 50%;

    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;

    border: 3px solid rgba(255, 103, 3, 0.18);
    border-top-color: var(--hpc-orange);
    border-radius: 50%;

    animation: hpc-spin 0.8s linear infinite;
}

@keyframes hpc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   12. WOOCOMMERCE CART / CHECKOUT / ORDER DATA
   ========================================================================== */

.woocommerce-cart .variation dt,
.woocommerce-cart .variation dd,
.woocommerce-checkout .variation dt,
.woocommerce-checkout .variation dd,
.woocommerce-order-details .wc-item-meta li,
.woocommerce-mini-cart .variation dt,
.woocommerce-mini-cart .variation dd {
    line-height: 1.8;
}

.woocommerce-cart .variation dt,
.woocommerce-checkout .variation dt,
.woocommerce-mini-cart .variation dt {
    color: #333;
    font-weight: 700;
}

.woocommerce-cart .variation dd,
.woocommerce-checkout .variation dd,
.woocommerce-mini-cart .variation dd,
.woocommerce-order-details .wc-item-meta li p {
    color: #5d646e;
}

.hpc-cart-color-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-top: 4px;
    padding: 4px 8px;

    color: #3c434b;
    font-size: 11px;
    font-weight: 600;

    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(20, 25, 35, 0.07);
    border-radius: 9px;
}

/* ==========================================================================
   13. QUICK VIEW SUPPORT
   ========================================================================== */

.quick-view .hpc-product-color-options,
.wd-quick-view .hpc-product-color-options,
.product-quick-view .hpc-product-color-options {
    margin-top: 14px;
    padding: 16px;
    border-radius: 17px;
}

/* ==========================================================================
   14. TABLET (WRAPPER ONLY)
   ========================================================================== */

@media (max-width: 1024px) {
    .single-product .hpc-product-color-options {
        padding: 18px;
        border-radius: 19px;
    }
}

/* ==========================================================================
   15. MOBILE SWATCHES
   ========================================================================== */

@media (max-width: 767px) {
    .single-product .hpc-product-color-options {
        margin: 15px 0 18px;
        padding: 15px 12px;
        border-radius: 16px;

        -webkit-backdrop-filter: blur(14px) saturate(140%);
        backdrop-filter: blur(14px) saturate(140%);

        box-shadow:
            0 8px 24px rgba(20, 25, 35, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.65);
    }

    .single-product .hpc-selector + .hpc-selector {
        margin-top: 17px;
        padding-top: 15px;
    }

    .single-product .hpc-selector-heading {
        margin-bottom: 18px;
        font-size: 13px;
    }

    .single-product .hpc-selector-heading-text::before {
        width: 7px;
        height: 21px;
    }

    .hpc-product-color-options .hpc-swatches {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 14px;
    }

    .hpc-product-color-options .hpc-color-image,
    .hpc-product-color-options .hpc-color-image.hpc-color-image--empty {
        width: 51px;
        height: 51px;
        min-width: 51px;
        max-width: 51px;
        min-height: 51px;
        max-height: 51px;
        border-radius: 11px;
    }

    .hpc-product-color-options .hpc-color-name {
        max-width: 51px;
        min-height: 26px;
        font-size: 11px;
    }
}

/* ==========================================================================
   16. VERY SMALL PHONES
   ========================================================================== */

@media (max-width: 390px) {
    .hpc-product-color-options .hpc-swatches {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 14px;
    }
}

/* ==========================================================================
   17. ACCESSIBILITY
   ========================================================================== */

.hpc-product-color-options .hpc-color-option:focus-visible {
    outline: none;
}

.hpc-product-color-options .hpc-color-option:focus-visible .hpc-color-image {
    border-color: rgba(255, 105, 0, 0.55);
    box-shadow:
        0 5px 13px rgba(20, 20, 20, 0.11),
        0 0 0 3px rgba(255, 105, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .single-product .hpc-product-color-options,
    .hpc-product-color-options .hpc-color-option,
    .hpc-product-color-options .hpc-color-image,
    .hpc-product-color-options .hpc-color-name,
    .single-product .hpc-reset-selection {
        transition: none !important;
        animation: none !important;
    }

    .single-product .hpc-product-color-options:hover,
    .hpc-product-color-options .hpc-color-option:hover,
    .hpc-product-color-options .hpc-color-option.is-active,
    .hpc-product-color-options .hpc-color-option:has(input[type="radio"]:checked) {
        transform: none !important;
    }

    .hpc-product-color-options .hpc-color-option.is-active .hpc-color-image,
    .hpc-product-color-options .hpc-color-option:has(input[type="radio"]:checked) .hpc-color-image {
        transform: none !important;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .single-product .hpc-product-color-options,
    .quick-view .hpc-product-color-options,
    .wd-quick-view .hpc-product-color-options,
    .product-quick-view .hpc-product-color-options {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.96) !important;
    }
}

/* ==========================================================================
   18. FALLBACK FOR BROWSERS WITHOUT :has()
   ========================================================================== */

.no-js .hpc-product-color-options .hpc-color-option input:checked ~ .hpc-color-image {
    border-color: #ff6900;
    box-shadow:
        0 5px 14px rgba(255, 105, 0, 0.18),
        0 0 0 2px rgba(255, 105, 0, 0.17);
}

.no-js .hpc-product-color-options .hpc-color-option input:checked ~ .hpc-color-name {
    color: #e85f00;
    font-weight: 700;
}