/* Product modals — loaded from store layout after styles.css */

#quick_add.popup-quickadd.modalDemo .modal-dialog,
#quick_view.popup-quickview.modalDemo .modal-dialog {
    height: auto !important;
}

#quick_view.popup-quickview .tf-product-info-liveview {
    margin-bottom: 18px;
}

#quick_view.popup-quickview .btns-full strong,
#quick_add.popup-quickadd .btns-full strong {
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Close button + rounded corners (needs modalDemo + popup-quickview together) */
#quick_view.popup-quickview.modalDemo .modal-content {
    position: relative;
    overflow: hidden !important;
    border-radius: 10px;
    margin: 8px;
    padding: 0;
    max-height: calc(100vh - 2rem);
}

#quick_view.popup-quickview.modalDemo .header {
    position: relative;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    z-index: 10;
}

#quick_view.popup-quickview.modalDemo .modal-content .icon-close-popup {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 30px;
    height: 30px;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: rgb(134, 134, 134);
    font-size: 16px;
    z-index: 20;
}

/*
 * Quick view desktop: theme pins the info panel with position:absolute + inner scroll,
 * which clips buy buttons when the product image is short.
 *
 * Left column stretches with the tall options panel and fills with #f8f8f8
 * (matches product photo studio bg). Image uses contain so it is not cropped.
 */
@media (min-width: 768px) {
    #quick_view.popup-quickview.modalDemo .modal-dialog {
        max-height: calc(100vh - 2rem);
    }

    #quick_view.popup-quickview.modalDemo .modal-content {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #quick_view.popup-quickview .modal-dialog .modal-content > .wrap {
        display: flex !important;
        align-items: stretch !important;
    }

    #quick_view.popup-quickview .tf-product-media-wrap {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        align-self: stretch !important;
        flex: 0 0 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        min-height: 100% !important;
        height: auto !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        overflow: hidden;
        background-color: #f8f8f8 !important;
    }

    #quick_view.popup-quickview .tf-product-media-wrap .tf-single-slide,
    #quick_view.popup-quickview .tf-product-media-wrap .swiper,
    #quick_view.popup-quickview .tf-product-media-wrap .swiper-wrapper,
    #quick_view.popup-quickview .tf-product-media-wrap .swiper-slide,
    #quick_view.popup-quickview .tf-product-media-wrap .item {
        width: 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        background-color: #f8f8f8 !important;
    }

    #quick_view.popup-quickview .tf-product-media-wrap .item {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #quick_view.popup-quickview .tf-product-media-wrap .item img {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        object-fit: contain !important;
        object-position: center !important;
        display: block !important;
        background-color: #f8f8f8 !important;
    }

    #quick_view.popup-quickview .tf-product-info-wrap {
        position: relative !important;
        align-self: stretch !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        background-color: #fff;
    }

    #quick_view.popup-quickview .tf-product-info-wrap .tf-product-info-list {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        height: auto !important;
        overflow: visible !important;
        padding: 50px 40px !important;
    }
}

/* Shopping cart drawer — progress bar + truck icon */
.modal-shopping-cart .tf-mini-cart-threshold {
    overflow: visible;
}

.modal-shopping-cart .tf-mini-cart-threshold .tf-progress-bar {
    overflow: visible;
    margin-left: 18px;
    margin-right: 18px;
    width: auto;
}

.modal-shopping-cart .tf-progress-bar span {
    min-width: 36px;
    border-radius: 3px;
}

@media (max-width: 767px) {
    .modal-shopping-cart .tf-mini-cart-threshold .tf-progress-bar {
        margin-left: 15px;
        margin-right: 15px;
    }
}

/* Cart page — progress bar + truck icon */
.tf-page-cart-footer .tf-free-shipping-bar {
    overflow: visible;
}

.tf-page-cart-footer .tf-free-shipping-bar .tf-progress-bar {
    overflow: visible;
    margin-left: 18px;
    margin-right: 18px;
    width: auto;
}

.tf-page-cart-footer .tf-progress-bar span {
    min-width: 36px;
    border-radius: 3px;
}

@media (max-width: 767px) {
    .tf-page-cart-footer .tf-free-shipping-bar .tf-progress-bar {
        margin-left: 15px;
        margin-right: 15px;
    }
}
