/**
 * TPB Modal Template CSS
 * Universal styling template for all modal types
 * This file serves as the base styling that all modals inherit from
 */

/* ==========================================================================
   MODAL OVERLAY & CONTAINER
   ========================================================================== */

/* Prevent horizontal scroll when modal is open */
body.tpb-modal-open {
    overflow-x: hidden;
}

/* General overflow prevention for the page */
body {
    overflow-x: hidden;
}

.tpb-qv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* Ensure modal overlay doesn't interfere with cart elements */
.tpb-qv-overlay.is-open {
    z-index: 999999;
}

/* Force cart elements to appear above modal overlay */
body.tpb-modal-open .tpb-qv-overlay.is-open ~ * [class*="cart"],
body.tpb-modal-open .tpb-qv-overlay.is-open ~ * [class*="woocommerce-cart"],
body.tpb-modal-open .tpb-qv-overlay.is-open ~ * [class*="elementor-cart"] {
    z-index: 99999999 !important;
}

.tpb-qv-overlay.show,
.tpb-qv-overlay.is-open {
    opacity: 1;
}

.tpb-qv-overlay.closing {
    opacity: 0;
}

.tpb-qv-modal {
    position: relative;
    width: 85%;
    max-width: min(1400px, 95vw);
    height: 75vh;
    max-height: 90vh;
    background: #fff;
    border-radius: 10px !important;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: row;
    transform: scale(0.9) translateY(20px);
    animation: modalSlideIn 0.4s ease-out forwards;
}

.tpb-qv-overlay.closing .tpb-qv-modal {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease-in, opacity 0.3s ease-in;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   CLOSE BUTTON
   ========================================================================== */

.tpb-qv-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgb(79, 176, 137);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tpb-qv-close:hover {
    background: rgb(60, 140, 110);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.tpb-qv-close:active {
    transform: scale(0.95);
}

/* ==========================================================================
   LEFT PANEL (PRODUCT IMAGE)
   ========================================================================== */

.tpb-qv-left-panel {
    width: 35%;
    height: 100%;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

#tpb-qv-product-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#tpb-qv-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    visibility: hidden;
}

#tpb-qv-product-image img.loaded {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   RIGHT PANEL (CONTENT)
   ========================================================================== */

.tpb-qv-right-panel {
    width: 65%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
}

/* ==========================================================================
   HEADER CONTAINER (TITLE & PRICE)
   ========================================================================== */

.tpb-qv-header-container {
    flex-shrink: 0;
    min-height: 140px;
    height: 140px;
    position: relative;
    z-index: 10;
    background: #fff;
}

.tpb-qv-title {
    margin: 0;
    font-size: 34px;
    font-weight: 600;
    color: #2c3e50;
    padding: 70px 30px 10px 55px;
}

.tpb-qv-title-simplified {
    text-align: center;
    font-size: 48px;
    font-weight: 600;
    color: #2c3e50;
    padding: 50px 30px;
}

.tpb-qv-base-price {
    padding: 0 30px 10px 55px;
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 20px;
    margin-top: -5px;
    margin-left: 3px;
    line-height: 1.25;
    transition: none; /* Let JavaScript handle all transitions */
    min-height: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    position: relative;
}

.tpb-qv-base-price::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30px;
    right: 30px;
    height: 1px;
    background-color: #e3e6ea;
    opacity: 1;
}

.tpb-qv-base-price.has-price {
    font-size: 16px;
    font-weight: 600;
    color: #4fb08f;
}

.tpb-qv-base-price.has-price * {
    color: #4fb08f;
}

.tpb-qv-base-price.updating {
    opacity: 0;
}

/* ==========================================================================
   STEPPER CONTAINER
   ========================================================================== */

.tpb-qv-stepper-container {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    mask: linear-gradient(to bottom, transparent 0px, transparent 30px, black 40px, black 100%);
    -webkit-mask: linear-gradient(to bottom, transparent 0px, transparent 30px, black 40px, black 100%);
}

.tpb-qv-stepper-container .tpb-qv-native {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    padding: 20px;
    overflow-x: hidden;
    color: #333 !important;
}

.tpb-qv-native {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    padding: 20px;
    overflow-x: hidden;
    color: #333 !important;
}

/* ==========================================================================
   STEPPER STEPS
   ========================================================================== */

.tpb-step {
    margin: 0;
    padding: 40px 0 0px 40px;
    max-width: 100%;
    box-sizing: border-box;
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    color: #333 !important;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.tpb-step:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
}

.tpb-step.entering {
    opacity: 0;
    transform: translateY(20px);
    animation: stepEnter 0.4s ease-out forwards;
}

@keyframes stepEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tpb-step[hidden] {
    display: none !important;
}

.tpb-step:not([hidden]) {
    display: block !important;
}

/* ==========================================================================
   GRID LAYOUT
   ========================================================================== */

.tpb-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    margin-top: 35px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.tpb-qv-modal .tpb-card {
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
    text-align: left;
    max-width: 100% !important;
    box-sizing: border-box;
    color: #333 !important;
    transform: scale(0.85) !important;
    transform-origin: top left !important;
}

.tpb-qv-modal .tpb-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(0.85) translateY(-2px) !important;
}

.tpb-qv-modal .tpb-card-horizontal {
    display: flex !important;
    gap: 24px !important;
    align-items: flex-start !important;
    padding: 24px !important;
    min-height: 200px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    color: #333 !important;
}

/* ==========================================================================
   CARD IMAGES
   ========================================================================== */

.tpb-qv-modal .tpb-card-image {
    position: relative;
    padding-bottom: 75%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
}

.tpb-qv-modal .tpb-card-horizontal .tpb-card-image {
    flex: 0 0 200px !important;
    width: 200px !important;
    height: 200px !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.tpb-qv-modal .tpb-card-horizontal .tpb-card-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 180px !important;
    padding-left: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
    color: #333 !important;
}

.tpb-qv-modal .tpb-card-horizontal .tpb-actions {
    display: flex !important;
    gap: 16px !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    margin-top: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

.tpb-hint {
    color: #6b7280 !important;
    font-size: 15px;
    margin: 4px 0 8px;
    text-align: left;
}

.tpb-title {
    font-weight: 700;
    font-size: 18px;
    margin: 8px 0;
    text-align: left;
    color: #333 !important;
}

.tpb-qv-modal .tpb-card-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    min-height: 40px;
    line-height: 1.3;
    text-align: center;
    color: #333 !important;
}

.tpb-qv-modal .tpb-card-horizontal .tpb-card-title {
    font-size: 22px !important;
    text-align: left !important;
    color: #333 !important;
}

.tpb-qv-modal .tpb-card-title .parenthetical {
    font-size: 14px;
    font-weight: 400;
    display: block;
    margin-top: 2px;
    color: #666 !important;
}

.tpb-qv-modal .tpb-card-price {
    color: rgb(79 176 137) !important;
    font-weight: 600;
    font-size: 16px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    text-align: center;
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.tpb-select {
    margin-top: 6px;
    text-align: left;
    border: 2px solid #e3e6ea !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

.tpb-select:hover {
    border-color: #4fb08f !important;
}

.tpb-select:focus {
    outline: none !important;
    border-color: #4fb08f !important;
    box-shadow: 0 0 0 3px rgba(79, 176, 143, 0.1) !important;
}

.tpb-radio {
    margin-top: 6px;
    text-align: left;
    border: none !important;
    border-bottom: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    color: #333 !important;
}

/* ==========================================================================
   ACTIONS & BUTTONS
   ========================================================================== */

.tpb-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    color: #333 !important;
}

.tpb-qty {
    color: #333 !important;
}

.tpb-qty span {
    color: #333 !important;
}

.tpb-qty input {
    color: #333 !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
}

.tpb-bottom-section {
    color: #333 !important;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.tpb-hint.entering {
    opacity: 0;
    transform: translateY(15px);
    animation: textEnter 0.3s ease-out forwards;
}

@keyframes textEnter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tpb-base-price {
    transition: all 0.3s ease-in-out;
    color: #333 !important;
    margin-bottom: 0 !important;
}

.tpb-base-price.updating {
    opacity: 0.7;
    transform: scale(0.98);
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal) {
    opacity: 0;
    transform: translateY(15px);
    animation: cardReveal 0.5s ease-out forwards;
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal):nth-child(1) {
    animation-delay: 0.1s;
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal):nth-child(2) {
    animation-delay: 0.2s;
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal):nth-child(3) {
    animation-delay: 0.3s;
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal):nth-child(4) {
    animation-delay: 0.4s;
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal):nth-child(5) {
    animation-delay: 0.5s;
}

.tpb-qv-modal .tpb-card:not(.tpb-card-horizontal):nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tpb-qv-modal .tpb-card-horizontal {
    opacity: 1;
    transform: none;
    animation: none;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.tpb-qv-stepper-container {
    padding-top: 0 !important;
}

.sr-live {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.tpb-toast {
    position: fixed;
    right: 12px;
    bottom: 12px;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    opacity: .95;
    z-index: 99999;
}

/* ==========================================================================
   LANDING PAGE PRODUCT CARDS - NO HOVER EFFECTS
   ========================================================================== */

/* Landing page product cards - remove all hover effects and borders */
.elementor-widget .tpb-card,
.elementor-widget-container .tpb-card,
.landing-page .tpb-card {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Landing page product cards - no hover effects */
[data-tpb-quickview]:focus,
[data-tpb-quickview]:active,
[data-tpb-quickview]:hover {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Remove any teal border from buttons that might be selected */
button:focus,
button:active,
button:hover {
    outline: none !important;
}

/* Remove white border from Flower Station Configure Now button */
[href*="flower-station-configure-now"]:focus,
[href*="flower-station-configure-now"]:active,
[href*="flower-station-configure-now"]:hover,
[data-tpb-modal="flower-station"]:focus,
[data-tpb-modal="flower-station"]:active,
[data-tpb-modal="flower-station"]:hover {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   MODAL PRODUCT CARDS - KEEP HOVER EFFECTS
   ========================================================================== */

/* Modal product cards - keep existing hover effects */
.tpb-qv-modal .tpb-card:focus,
.tpb-qv-modal .tpb-card:active,
.tpb-qv-modal .tpb-card:hover {
    outline: none !important;
    border: 1px solid #e3e6ea !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .tpb-qv-modal {
        width: 95%;
        height: 95%;
        margin: 2.5%;
        flex-direction: column;
    }
    
    .tpb-qv-left-panel {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .tpb-qv-right-panel {
        width: 100%;
        height: 60%;
    }
    
    .tpb-qv-close {
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
        font-size: 16px;
    }
    
    .tpb-qv-title {
        font-size: 28px;
        padding: 30px 20px 10px 20px;
    }
    
    .tpb-qv-title-simplified {
        font-size: 36px;
        padding: 30px 20px;
    }
    
    .tpb-qv-base-price {
        padding: 0 20px 10px 20px;
        font-size: 16px;
    }
    
    .tpb-qv-base-price::after {
        left: 20px;
        right: 20px;
    }
    
    .tpb-qv-stepper-container {
        padding: 15px;
    }
    
    .tpb-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .tpb-qv-modal .tpb-card {
        transform: scale(1) !important;
    }
    
    .tpb-qv-modal .tpb-card:hover {
        transform: scale(1) translateY(-2px) !important;
    }
}

/* ==========================================================================
   CART BUTTON STYLING
   ========================================================================== */

/* Add to Cart Button */
.tpb-card .tpb-add-cart,
.tpb-card button[onclick*="addCart"],
.tpb-card .add-to-cart-btn {
    background: rgb(79, 176, 137) !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
    min-width: 120px !important;
}

.tpb-card .tpb-add-cart:hover,
.tpb-card button[onclick*="addCart"]:hover,
.tpb-card .add-to-cart-btn:hover {
    background: rgb(65, 150, 120) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(79, 176, 137, 0.3) !important;
}

.tpb-card .tpb-add-cart:disabled,
.tpb-card button[onclick*="addCart"]:disabled,
.tpb-card .add-to-cart-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Add to Quote Button */
.tpb-card .tpb-add-quote,
.tpb-card button[onclick*="addQuote"],
.tpb-card .add-to-quote-btn {
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
    min-width: 120px !important;
    margin-left: 10px !important;
}

.tpb-card .tpb-add-quote:hover,
.tpb-card button[onclick*="addQuote"]:hover,
.tpb-card .add-to-quote-btn:hover {
    background: #5a6268 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}

.tpb-card .tpb-add-quote:disabled,
.tpb-card button[onclick*="addQuote"]:disabled,
.tpb-card .add-to-quote-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Button Container */
.tpb-card .tpb-card-actions,
.tpb-card .card-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 15px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

/* Ensure button text is visible */
.tpb-card button {
    color: white !important;
    text-shadow: none !important;
}

/* Loading state */
.tpb-card button:disabled {
    position: relative !important;
}

.tpb-card button:disabled::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 16px !important;
    height: 16px !important;
    margin: -8px 0 0 -8px !important;
    border: 2px solid transparent !important;
    border-top: 2px solid white !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Z-INDEX MANAGEMENT - CART & NOTIFICATIONS ABOVE MODAL OVERLAY
   ========================================================================== */

/* Ensure cart stays above modal overlay (z-index: 999999) */
.woocommerce-cart-widget,
.elementor-widget-woocommerce-cart,
.floating-cart,
.cart-widget,
.woocommerce-mini-cart,
.elementor-cart-widget,
.elementor-widget-container .woocommerce-cart-widget,
.elementor-widget-container .elementor-widget-woocommerce-cart,
.elementor-widget-container .floating-cart,
.elementor-widget-container .cart-widget,
.elementor-widget-container .woocommerce-mini-cart,
.elementor-widget-container .elementor-cart-widget,
.elementor-widget .woocommerce-cart-widget,
.elementor-widget .elementor-widget-woocommerce-cart,
.elementor-widget .floating-cart,
.elementor-widget .cart-widget,
.elementor-widget .woocommerce-mini-cart,
.elementor-widget .elementor-cart-widget {
    z-index: 9999999 !important;
}

/* Ensure cart count badges stay above modal overlay */
.cart-count,
.cart-counter,
.woocommerce-cart-count,
.elementor-cart-count,
.woocommerce-cart-count-badge,
.elementor-widget-container .cart-count,
.elementor-widget-container .cart-counter,
.elementor-widget-container .woocommerce-cart-count,
.elementor-widget-container .elementor-cart-count,
.elementor-widget-container .woocommerce-cart-count-badge,
.elementor-widget .cart-count,
.elementor-widget .cart-counter,
.elementor-widget .woocommerce-cart-count,
.elementor-widget .elementor-cart-count,
.elementor-widget .woocommerce-cart-count-badge {
    z-index: 99999999 !important;
}

/* Ensure cart icons and buttons stay above modal overlay */
.cart-icon,
.cart-button,
.woocommerce-cart-icon,
.elementor-cart-icon,
.elementor-cart-button,
.elementor-widget-container .cart-icon,
.elementor-widget-container .cart-button,
.elementor-widget-container .woocommerce-cart-icon,
.elementor-widget-container .elementor-cart-icon,
.elementor-widget-container .elementor-cart-button,
.elementor-widget .cart-icon,
.elementor-widget .cart-button,
.elementor-widget .woocommerce-cart-icon,
.elementor-widget .elementor-cart-icon,
.elementor-widget .elementor-cart-button {
    z-index: 99999999 !important;
}

/* General rule for any cart-related elements */
[class*="cart"],
[class*="woocommerce-cart"],
[class*="elementor-cart"],
[data-widget_type*="cart"],
.elementor-widget[data-widget_type*="cart"] {
    z-index: 9999999 !important;
}

/* Force page content below modal when modal is open */
body.tpb-modal-open > *:not(.tpb-qv-overlay):not([class*="cart"]) {
    z-index: auto !important;
}

/* Force buttons specifically below modal (exclude modal close button) */
body.tpb-modal-open button:not([class*="cart"]):not(.tpb-qv-close) {
    z-index: 1 !important;
}

/* Force Elementor containers below modal */
body.tpb-modal-open .elementor-widget:not([class*="cart"]),
body.tpb-modal-open .elementor-element:not([class*="cart"]),
body.tpb-modal-open .elementor-section,
body.tpb-modal-open .elementor-container,
body.tpb-modal-open .elementor-column {
    z-index: 1 !important;
}

/* Force cart elements above modal overlay when modal is open */
body.tpb-modal-open [class*="cart"],
body.tpb-modal-open [class*="woocommerce-cart"],
body.tpb-modal-open [class*="elementor-cart"],
body.tpb-modal-open [data-widget_type*="cart"],
body.tpb-modal-open .elementor-widget[data-widget_type*="cart"],
body.tpb-modal-open .woocommerce-cart-widget,
body.tpb-modal-open .elementor-widget-woocommerce-cart,
body.tpb-modal-open .floating-cart,
body.tpb-modal-open .cart-widget,
body.tpb-modal-open .woocommerce-mini-cart,
body.tpb-modal-open .elementor-cart-widget,
body.tpb-modal-open .elementor-widget-container [class*="cart"],
body.tpb-modal-open .elementor-widget-container [class*="woocommerce-cart"],
body.tpb-modal-open .elementor-widget-container [class*="elementor-cart"] {
    z-index: 99999999 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure toast notifications stay above modal overlay */
.toast,
.tpb-toast,
.notification,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
    z-index: 1000002 !important;
    position: fixed !important;
}

/* Elegant toast notification styling */
.toast {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
    z-index: 1000002 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    max-width: 200px !important;
    word-wrap: break-word !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    animation: slideInRight 0.3s ease-out !important;
    opacity: 0.95 !important;
    line-height: 1.4 !important;
    text-align: center !important;
}

/* Success toast styling */
.toast.success {
    background: rgba(79, 176, 137, 0.9) !important;
    border: 1px solid rgba(79, 176, 137, 0.3) !important;
}

/* Error toast styling */
.toast.error {
    background: rgba(220, 53, 69, 0.9) !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
}

/* Toast animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 0.95;
    }
}

/* Toast fade out animation */
.toast.fade-out {
    animation: slideOutRight 0.3s ease-in forwards !important;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 0.95;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Ensure cart buttons in modals work properly */
.tpb-qv-modal .tpb-add-cart,
.tpb-qv-modal button[onclick*="addCart"],
.tpb-qv-modal .add-to-cart-btn {
    z-index: 1 !important;
    position: relative !important;
}

/* Ensure any cart-related overlays stay above modal */
.cart-overlay,
.cart-popup,
.cart-drawer,
.woocommerce-cart-overlay {
    z-index: 1000003 !important;
}

/* Ensure Elementor cart widget stays above modal */
.elementor-widget-woocommerce-cart .woocommerce-cart-widget,
.elementor-widget-woocommerce-cart .elementor-cart-widget {
    z-index: 1000000 !important;
}

/* Ensure cart fragments stay above modal */
.woocommerce-cart-fragments,
.cart-fragments {
    z-index: 1000000 !important;
}

/* Ensure any cart-related modals stay above TPB modals */
.woocommerce-cart-modal,
.cart-modal,
.checkout-modal {
    z-index: 1000004 !important;
}

/* Fix squished remove buttons in cart drawer */
.elementor-menu-cart__product-remove,
.elementor-menu-cart__product-remove button,
.woocommerce-cart-item__remove,
.woocommerce-cart-item__remove a,
.elementor-menu-cart__toggle_button .remove {
    width: auto !important;
    min-width: 32px !important;
    height: auto !important;
    min-height: 32px !important;
    padding: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
