/* ==========================================================================
   SECTION 1: EXTRA / UTILITY STYLES, BUTTON HEIGHT & SPACING FIXES
   ========================================================================== */

/* Outer Action Wrapper Container - Adds Gap and Aligns Side-by-Side */
.egc-actions-wrapper,
.egc-global-rx-button-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 14px !important; /* Gap before quantity/Add to Cart */
    vertical-align: middle !important;
}

/* Ensure WooCommerce form.cart aligns side-by-side with gap */
html body .entry-summary form.cart,
html body .summary form.cart,
html body .elementor-widget-woocommerce-product-add-to-cart form.cart,
html body .single_variation_wrap {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 20px !important;
    margin-bottom: 12px !important;
    vertical-align: middle !important;
}

html body .elementor-widget-woocommerce-product-add-to-cart .single_variation_wrap .egc-variable-rx-wrapper {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .elementor-widget-woocommerce-product-add-to-cart .single_variation_wrap .woocommerce-variation-add-to-cart {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 1. CUSTOM PURPLE RX BUTTON - Uniform Height 44px */
html body #egc-open-rx-modal.egc-btn-purple,
html body .egc-btn-purple#egc-open-rx-modal,
html body .elementor-widget-woocommerce-product-add-to-cart .single_variation_wrap #egc-open-rx-modal.egc-btn-purple {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    margin: 0 !important;
    background-color: #800080 !important;
    color: #ffffff !important;
    border: none !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(128, 0, 128, 0.25) !important;
}

#egc-open-rx-modal.egc-btn-purple:hover {
    background-color: #660066 !important;
    box-shadow: 0 4px 10px rgba(128, 0, 128, 0.35) !important;
}

/* 2. WOOCOMMERCE QUANTITY INPUT BOX - Uniform Height 44px */
html body form.cart .quantity,
html body .summary form.cart .quantity,
html body .elementor-widget-woocommerce-product-add-to-cart .single_variation_wrap .quantity {
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 44px !important;
}

html body form.cart .quantity input.qty,
html body .summary form.cart .quantity input.qty,
html body .elementor-widget-woocommerce-product-add-to-cart .single_variation_wrap .quantity input.qty {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    width: 60px !important;
    padding: 0 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 44px !important;
    text-align: center !important;
    border: 1px solid #cccccc !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    background: #ffffff !important;
    color: #111111 !important;
}

/* 3. WOOCOMMERCE "ADD TO CART" BUTTON - Uniform Height 44px */
html body form.cart .single_add_to_cart_button,
html body .summary form.cart .single_add_to_cart_button,
html body .elementor-widget-woocommerce-product-add-to-cart .single_add_to_cart_button {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    margin: 0 !important;
    background-color: #C9A76D !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer !important;
    vertical-align: middle !important;
}

html body form.cart .single_add_to_cart_button:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Single Product Action Buttons Wrapper */
.egc-add-to-cart-form {
    display: inline-flex;
    margin: 0;
}

.egc-qty-cart-container {
    display: flex;
    align-items: stretch;
    height: 44px;
    background-color: #e6a100;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(230, 161, 0, 0.25);
    transition: box-shadow 0.25s ease;
}

.egc-qty-cart-container:hover {
    box-shadow: 0 4px 10px rgba(230, 161, 0, 0.35);
}

.egc-qty-select,
#egc-quantity-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 100%;
    min-width: 56px;
    padding: 0 10px;
    background-color: #cc8f00;
    color: #ffffff;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23ffffff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 22px;
}

.egc-qty-select:focus,
#egc-quantity-select:focus {
    outline: none;
    background-color: #b87e00;
}

/* ==========================================================================
   SECTION 2: EYEGLASS-CUSTOMIZER.PHP / GLOBAL & MODAL LAYOUT STYLES
   ========================================================================== */

/* Fullscreen Modal Overlay + Wizard Takeover */
#egc-fullscreen-modal.egc-fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 999999;
    overflow: hidden;
}

.egc-modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.egc-modal-content {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

#egc-wizard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #ffffff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.egc-modal-open {
    overflow: hidden !important;
    height: 100vh;
}

body.egc-modal-open > *:not(#egc-fullscreen-modal) {
    visibility: hidden;
}

#egc-fullscreen-modal,
#egc-fullscreen-modal #egc-wizard {
    visibility: visible;
}

#egc-close-rx-modal.egc-close-btn {
    position: relative;
}

/* Step Header Bar */
.egc-step-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #ffffff;
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-sizing: border-box;
}

.egc-step-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 1px;
    background-color: #eaeaea;
    pointer-events: none;
}

.egc-step-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

.egc-step-header.egc-nav-hidden #egc-step-back-btn,
.egc-step-header.egc-nav-hidden #egc-close-rx-modal {
    display: none !important;
}

/* Progress Step Bar */
.egc-step-progress {
    display: flex;
    align-items: center;
    gap: 48px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    justify-content: center;
    position: relative;
}

.egc-step-progress::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 8%;
    right: 8%;
    height: 1px;
    background-color: #d9d9d9;
    z-index: 1;
}

.egc-progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999999;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.egc-progress-item .egc-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #d9d9d9;
    display: block;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

.egc-progress-item.is-active {
    color: #2e8b3d;
    font-weight: 600;
}

.egc-progress-item.is-active .egc-progress-dot {
    background-color: #2e8b3d;
    width: 10px;
    height: 10px;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #2e8b3d;
}

.egc-progress-item.is-complete {
    color: #800080;
    font-weight: 500;
}

.egc-progress-item.is-complete .egc-progress-dot {
    background-color: #800080;
}

.egc-nav-btn.egc-back-btn {
    background: #f6b400;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.egc-nav-btn.egc-back-btn:hover {
    background: #dda200;
}

.egc-header-close.egc-close-btn {
    background: #f6b400;
    color: #1a1a1a;
    border: none;
    border-radius: 4px;
    padding: 8px 18px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    height: auto;
    white-space: nowrap;
}

.egc-header-close.egc-close-btn:hover {
    background: #dda200;
}

/* Wizard Body Layout */
.egc-wizard-body {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 68px);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.egc-wizard-left {
    flex: 0 0 320px;
    padding: 24px;
    border-right: 1px solid #eee;
    position: sticky;
    top: 68px;
    align-self: flex-start;
    height: calc(100vh - 68px);
}

.egc-product-image-wrap img {
    width: 100%;
    max-width: 280px;
    display: block;
    margin: 0 auto 20px;
}

.egc-price-summary .egc-price-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.egc-price-summary .egc-price-total-row {
    font-weight: 700;
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 8px;
}

.egc-wizard-right {
    flex: 1 1 auto;
    padding: 24px 40px;
    min-width: 0;
}

.egc-step-panel {
    display: none;
}

.egc-step-panel.is-active {
    display: block;
}

.egc-step-title {
    text-align: center;
    margin-bottom: 4px;
}

.egc-step-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
}

/* PRODUCT COLOR SWATCHES SECTION */
.egc-swatches-wrapper {
    margin: 16px 0 20px 0;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.egc-swatches-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.egc-swatches-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.egc-swatch-item {
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.egc-swatch-item:hover {
    border-color: #C9A76D;
}

.egc-swatch-item.is-selected {
    border-color: #C9A76D !important;
    box-shadow: 0 0 0 2px rgba(201, 167, 109, 0.35);
    background: #ffffff;
}

.egc-swatch-img-box img {
    max-width: 58px;
    max-height: 58px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.egc-swatch-selected-info {
    font-size: 13px;
    color: #1e293b;
    margin-top: 8px;
}

.egc-swatch-selected-title {
    font-weight: 700;
}

.egc-swatch-selected-price {
    font-weight: 600;
    color: #C9A76D;
    margin-left: 6px;
}

/* ==========================================================================
   SECTION 3: RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablet & Mobile Layout Structure */
@media (max-width: 900px) {
    .egc-wizard-body {
        flex-direction: column;
    }

    .egc-wizard-left {
        position: relative !important;
        height: auto !important;
        width: 100% !important;
        flex: 1 1 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #eee !important;
        padding: 20px 16px !important;
        margin-bottom: 100px !important; /* 100px bottom margin */
        text-align: center !important;
        align-self: center !important;
    }

    .egc-product-image-wrap img {
        margin: 0 auto 16px auto !important;
    }

    .egc-price-summary {
        max-width: 320px !important;
        margin: 0 auto !important;
    }

    .egc-wizard-right {
        padding: 16px !important;
        width: 100% !important;
    }
}

/* MOBILE RESPONSIVE HEADER LAYOUT (max-width: 768px) */
/* Step Progress Bar at TOP, Back and Close Buttons at BOTTOM */
@media (max-width: 768px) {
    .egc-step-header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 16px !important;
    }

    /* 1. Progress Bar Moves To TOP Row (Full Width) */
    .egc-step-progress {
        order: 1 !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 14px !important;
        gap: 0 !important;
        justify-content: space-between !important;
    }

    .egc-step-progress::before {
        left: 1px !important;
        right: 1px !important;
    }

    .egc-progress-label {
        font-size: 10px !important;
    }

    /* 2. Back Button - BOTTOM LEFT */
    #egc-step-back-btn,
    .egc-nav-btn.egc-back-btn {
        order: 2 !important;
        margin-right: auto !important;
    }

    /* 3. Close Button - BOTTOM RIGHT */
    #egc-close-rx-modal,
    .egc-header-close.egc-close-btn {
        order: 3 !important;
        margin-left: auto !important;
    }

    .egc-wizard-left {
        text-align: center !important;
        margin-bottom: 100px !important; /* 100px bottom margin */
    }
}

/* Mobile Screen Small Layout (max-width: 480px) */
@media (max-width: 480px) {
    .egc-actions-wrapper,
    .egc-action-buttons-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    #egc-open-rx-modal.egc-btn-purple,
    .egc-add-to-cart-form {
        width: 100%;
    }

    .egc-qty-cart-container {
        width: 100%;
    }

    .egc-btn-add-to-cart.single_add_to_cart_button {
        flex: 1 1 auto;
    }

    .egc-wizard-right {
        padding: 16px;
    }

    .egc-progress-label {
        display: none !important; /* Hide labels on small phones for compact dot bar */
    }
}