/**
 * Magento360_HyvaOptionPopup
 *
 * Custom Product Options Popup Modal Styles - Redesigned
 * Two-panel desktop layout, bottom sheet mobile, modern card grid
 *
 * Design tokens:
 * - Primary: #222 (black)
 * - Secondary: #666767 (gray-600)
 * - Gray-500: #8e8f8f
 * - Gray-300: #d3d3d3
 * - Gray-50: #f7f8f8
 * - Font: Outfit
 * - Border radius: 4px (images), 6px (swatches), 8px (cards), 24px (buttons)
 */

/* ============================================
   POPUP CONTAINER & OVERLAY
   ============================================ */

.popup-holder {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    max-width: 920px;
    width: 92%;
    overflow: visible;
    z-index: 9999;
    transform: translateX(0);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

body.bodyPopup {
    overflow-y: hidden !important;
}

.popupOverlay {
    background: rgba(0, 0, 0, 0.45);
    bottom: 0;
    height: 100%;
    left: 0;
    margin: auto;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    z-index: 999;
}

/* ============================================
   MAIN POPUP BOX
   ============================================ */

.popup1.lightbox {
    background: #FFFFFF;
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 9999;
    border-radius: 0;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
}

/* ============================================
   LEFT PANEL: PREVIEW + DETAILS (325px)
   ============================================ */

.popup1 .col-first {
    width: 325px;
    min-width: 325px;
    box-sizing: border-box;
    padding: 24px;
    position: relative;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    border-right: 1px solid #d3d3d3;
}

/* Large Preview Image */
.largeImage.showSwatch {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    background-color: #f7f8f8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 16px;
}

.largeImage.showSwatch.swatchFullImage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.popup1 .col-first img {
    display: block;
    height: auto;
    width: 100%;
}

/* Preview Text */
.popup1 .col-first .preview-details {
    width: 100%;
    text-align: left;
}

.popup1 .col-first .preview-title-price {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #d3d3d3;
}

.popup1 .col-first .name {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    line-height: 22px;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.popup1 .col-first .price {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    color: #666767;
    display: block;
    margin-top: 4px;
}

/* Detail Sections (Composition, Martindale, Care) */
.popup1 .col-first .detail-sections {
    width: 100%;
}

.popup1 .col-first .detail-section {
    margin-bottom: 12px;
}

.popup1 .col-first .detail-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #8e8f8f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.popup1 .col-first .detail-section-content {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    line-height: 20px;
    color: #222;
}

.popup1 .col-first .detail-section-content p {
    margin: 0 0 4px;
}

/* Close button on left panel */
.popup1 .col-first .close-btn-left {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: box-shadow 0.2s;
    padding: 0;
}

.popup1 .col-first .close-btn-left:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.popup1 .col-first .close-btn-left svg {
    width: 14px;
    height: 14px;
    color: #222;
}

/* ============================================
   RIGHT PANEL: OPTIONS GRID (flex-1)
   ============================================ */

.popup1 .col-sec {
    flex: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    min-width: 0;
}

/* Header */
.popup-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.popup-header h3 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

/* Close button with shadow circle */
.close-popup {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: box-shadow 0.2s;
    flex-shrink: 0;
}

.close-popup:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.close-popup svg {
    width: 14px;
    height: 14px;
    color: #222;
}

/* Scrollable Options Area */
.popup1 .col-sec-inner {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 24px;
    flex: 1;
}

/* ============================================
   CATEGORY ACCORDION
   ============================================ */

.popup1 .col-sec .open-close {
    margin: 0;
    display: block;
    width: 100%;
}

.popup1 .col-sec .opener,
.popup1 .col-sec .openerCat {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    line-height: 22px;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #d3d3d3;
    position: relative;
    color: #222;
    font-weight: 500;
    cursor: pointer;
    background: none !important;
    transition: color 0.2s ease;
    text-decoration: none;
    border-radius: 0 !important;
}

.popup1 .col-sec .opener:hover,
.popup1 .col-sec .openerCat:hover {
    color: #222;
}

.popup1 .col-sec .opener.active,
.popup1 .col-sec .openerCat.active {
    color: #222;
    font-weight: 600;
}

/* Chevron icon */
.popup1 .col-sec .opener .chevron-icon,
.popup1 .col-sec .openerCat .chevron-icon {
    width: 16px;
    height: 16px;
    color: #666767;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.popup1 .col-sec .opener.active .chevron-icon,
.popup1 .col-sec .openerCat.active .chevron-icon {
    transform: rotate(180deg);
}

.popup1 .col-sec .slide,
.popup1 .col-sec .slideCat {
    padding: 0;
    position: relative;
}

/* ============================================
   OPTION CARD GRID
   ============================================ */

.popup1 .col-sec ul {
    margin: 0;
    padding: 16px 0 8px;
    list-style: none;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* Individual Option Card */
.popup1 .col-sec ul li.customOptionItem {
    position: relative;
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    background: #fff;
}

.popup1 .col-sec ul li.customOptionItem:hover {
    border-color: #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.popup1 .col-sec ul li.customOptionItem.activeSwatch {
    border: 2px solid #222 !important;
}

/* Card Image */
.popup1 .col-sec ul li.customOptionItem .swatchCustomImage {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    display: block;
    object-fit: cover;
    border-radius: 7px 7px 0 0;
}

/* Card Info (title + price) */
.popup1 .col-sec ul li.customOptionItem .card-info {
    padding: 8px;
}

.popup1 .col-sec ul li.customOptionItem .card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    line-height: 15px;
    font-weight: 400;
    color: #222;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.popup1 .col-sec ul li.customOptionItem .card-price {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    line-height: 15px;
    font-weight: 500;
    color: #666767;
    margin-top: 2px;
}

/* Disabled Swatch */
.popup1 .col-sec ul li.customOptionItem.disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* ============================================
   POPUP FOOTER
   ============================================ */

.popup-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

.popup-footer .btn-confirm {
    font-family: 'Outfit', sans-serif;
    background: transparent;
    color: #222;
    border: 1.5px solid #222;
    padding: 12px 48px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-footer .btn-confirm:hover {
    background: #222;
    color: #fff;
}

.popup-footer .btn-confirm:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   MOBILE BOTTOM SHEET
   ============================================ */

@media (max-width: 991px) {
    .popup-holder {
        width: 100%;
        max-width: 100%;
        transform: none;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        animation: none;
    }

    .mobileSlider {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: flex;
        align-items: flex-end;
    }

    .mobileCustomOptions {
        background: #FFFFFF;
        width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 10000;
        animation: slideUp 0.3s ease-out;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Mobile Header */
    .mobile-header {
        padding: 16px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.06);
        position: relative;
        z-index: 1;
    }

    .mobile-header h3 {
        font-family: 'Outfit', sans-serif;
        font-size: 18px;
        font-weight: 700;
        color: #222;
        margin: 0;
    }

    /* Mobile Scrollable Content */
    .mobile-options-scroll {
        overflow-y: auto;
        flex: 1;
        padding: 12px 20px;
    }

    /* Mobile Category Accordion */
    .mobileCustomOptions .open-close {
        display: block;
        position: relative;
        margin-bottom: 0;
    }

    .mobileCustomOptions .open-close .opener,
    .mobileCustomOptions .open-close .openerCat {
        color: #222;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        font-family: 'Outfit', sans-serif;
        font-size: 15px;
        font-weight: 500;
        cursor: pointer;
        background: none !important;
        border: none;
        border-bottom: 1px solid #d3d3d3;
        width: 100%;
        text-align: left;
        text-decoration: none;
        border-radius: 0 !important;
    }

    .mobileCustomOptions .open-close .opener.active,
    .mobileCustomOptions .open-close .openerCat.active {
        color: #222;
        font-weight: 600;
    }

    .mobileCustomOptions .open-close .opener .chevron-icon,
    .mobileCustomOptions .open-close .openerCat .chevron-icon {
        width: 14px;
        height: 14px;
        color: #666767;
        transition: transform 0.25s ease;
        flex-shrink: 0;
    }

    .mobileCustomOptions .open-close .opener.active .chevron-icon,
    .mobileCustomOptions .open-close .openerCat.active .chevron-icon {
        transform: rotate(180deg);
    }

    /* Mobile Card Grid: 2 columns */
    .mobileCustomOptions .open-close .slide ul,
    .mobileCustomOptions .open-close .slideCat ul {
        padding: 12px 0 4px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        list-style-type: none;
        margin: 0;
    }

    .mobileCustomOptions .open-close .slide ul li,
    .mobileCustomOptions .open-close .slideCat ul li {
        display: block;
        margin: 0;
        position: relative;
        border: 1px solid #d3d3d3;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
        cursor: pointer;
        transition: border-color 0.2s;
    }

    .mobileCustomOptions .open-close .slide ul li img,
    .mobileCustomOptions .open-close .slideCat ul li img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 7px 7px 0 0;
        display: block;
    }

    .mobileCustomOptions .open-close .slide ul li.activeSwatch,
    .mobileCustomOptions .open-close .slideCat ul li.activeSwatch {
        border: 2px solid #222;
    }

    /* Mobile Details Section (inline, collapsible) */
    .mobile-details {
        background: #f7f8f8;
        border-top: 1px solid #d3d3d3;
        padding: 16px 20px;
    }

    .mobile-details-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        font-family: 'Outfit', sans-serif;
    }

    .mobile-details-toggle .detail-title-price {
        text-align: left;
    }

    .mobile-details-toggle .detail-name {
        font-size: 15px;
        font-weight: 600;
        color: #222;
        display: block;
    }

    .mobile-details-toggle .detail-price {
        font-size: 13px;
        font-weight: 400;
        color: #666767;
        display: block;
        margin-top: 2px;
    }

    .mobile-details-toggle .chevron-icon {
        width: 16px;
        height: 16px;
        color: #666767;
        transition: transform 0.25s ease;
    }

    .mobile-details-toggle.expanded .chevron-icon {
        transform: rotate(180deg);
    }

    .mobile-details-content {
        padding-top: 12px;
    }

    .mobile-details-content .detail-section {
        margin-bottom: 10px;
    }

    .mobile-details-content .detail-section-title {
        font-family: 'Outfit', sans-serif;
        font-size: 11px;
        font-weight: 600;
        color: #8e8f8f;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }

    .mobile-details-content .detail-section-content {
        font-family: 'Outfit', sans-serif;
        font-size: 13px;
        line-height: 19px;
        color: #222;
    }

    /* Mobile Sticky Footer */
    .mobile-footer {
        padding: 14px 20px;
        box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.08);
        position: relative;
        z-index: 1;
        display: flex;
        justify-content: center;
    }

    .mobile-footer .btn-confirm-mobile {
        font-family: 'Outfit', sans-serif;
        width: 100%;
        background: #222;
        color: #fff;
        border: none;
        padding: 14px 24px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-radius: 24px;
    }

    .mobile-footer .btn-confirm-mobile:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
}

/* ============================================
   TRIGGER BUTTON - Redesigned
   ============================================ */

/* Trigger Swatch Preview */

.trigger-swatch-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.trigger-swatch-preview .no-image {
    width: 100%;
    height: 100%;
    background: #f7f8f8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;



/* Scrollbar Styling */
.col-sec-inner::-webkit-scrollbar,
.mobile-options-scroll::-webkit-scrollbar,
.col-first::-webkit-scrollbar {
    width: 4px;
}

.col-sec-inner::-webkit-scrollbar-track,
.mobile-options-scroll::-webkit-scrollbar-track,
.col-first::-webkit-scrollbar-track {
    background: transparent;
}

.col-sec-inner::-webkit-scrollbar-thumb,
.mobile-options-scroll::-webkit-scrollbar-thumb,
.col-first::-webkit-scrollbar-thumb {
    background: #d3d3d3;
    border-radius: 4px;
}

.col-sec-inner::-webkit-scrollbar-thumb:hover,
.mobile-options-scroll::-webkit-scrollbar-thumb:hover,
.col-first::-webkit-scrollbar-thumb:hover {
    background: #8e8f8f;
}

/* Focus States */
.popup1 .col-sec ul li.customOptionItem:focus-visible,
.close-popup:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .popup-holder,
    .mobileSlider,
    .mobileCustomOptions {
        animation: none;
    }
}
