/* ============================================================
   Virtual Mart Mobile Final Overrides
   Loaded after custom.css
   Purpose: mobile product cards + Trive Revo Slick slider
   ============================================================ */

@media (max-width: 767px) {

    html,
    body,
    .page-wrapper,
    .page-main,
    .columns,
    .column.main {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .page-main {
        padding-left: 8px !important;
        padding-right: 8px !important;
        box-sizing: border-box !important;
    }

    .columns,
    .column.main,
    .sidebar,
    .sidebar-main,
    .sidebar-additional {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        clear: both !important;
        display: block !important;
    }

    /* ========================================================
       General mobile product grid cards
       ======================================================== */

    body.page-products .products-grid .product-items,
    body.catalog-category-view .products-grid .product-items,
    body.catalogsearch-result-index .products-grid .product-items {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        margin-left: -4px !important;
        margin-right: -4px !important;
        gap: 0 !important;
    }

    body.page-products .products-grid .product-item,
    body.catalog-category-view .products-grid .product-item,
    body.catalogsearch-result-index .products-grid .product-item {
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
        padding: 4px !important;
        margin: 0 0 10px 0 !important;
        box-sizing: border-box !important;
        display: flex !important;
    }

    body.page-products .products-grid .product-item-info,
    body.catalog-category-view .products-grid .product-item-info,
    body.catalogsearch-result-index .products-grid .product-item-info {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 315px !important;
        height: auto !important;
        padding: 8px !important;
        border-radius: 12px !important;
        background: #fff !important;
        border: 1px solid #e6e6e6 !important;
        box-shadow: 0 4px 14px rgba(0,0,0,0.06) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }

    body.page-products .products-grid .product-item-photo,
    body.catalog-category-view .products-grid .product-item-photo,
    body.catalogsearch-result-index .products-grid .product-item-photo,
    body.page-products .products-grid .product-image-container,
    body.catalog-category-view .products-grid .product-image-container,
    body.catalogsearch-result-index .products-grid .product-image-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
        margin: 0 auto 7px auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.page-products .products-grid .product-image-wrapper,
    body.catalog-category-view .products-grid .product-image-wrapper,
    body.catalogsearch-result-index .products-grid .product-image-wrapper {
        width: 100% !important;
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
        padding-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    body.page-products .products-grid .product-image-photo,
    body.catalog-category-view .products-grid .product-image-photo,
    body.catalogsearch-result-index .products-grid .product-image-photo {
        position: static !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 112px !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    /* Badge must stay horizontal */
    .products-grid .vm-delivery-badge,
    .product-items .vm-delivery-badge,
    .block-product-slider .vm-delivery-badge {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        max-width: 100% !important;
        min-height: 20px !important;
        padding: 4px 6px !important;
        margin: 0 0 5px 0 !important;
        border-radius: 999px !important;
        font-size: 8.5px !important;
        line-height: 1.05 !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        writing-mode: horizontal-tb !important;
        transform: none !important;
    }

    .products-grid .vm-delivery-badge:before,
    .product-items .vm-delivery-badge:before,
    .block-product-slider .vm-delivery-badge:before {
        font-size: 8.5px !important;
        margin-right: 3px !important;
    }

    .products-grid .product-item-details,
    .product-items .product-item-details {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .products-grid .product-item-name,
    .product-items .product-item-name,
    .products-grid .product.name.product-item-name {
        font-size: 11.5px !important;
        line-height: 1.25 !important;
        min-height: 34px !important;
        max-height: 36px !important;
        overflow: hidden !important;
        margin: 0 0 5px 0 !important;
        text-align: left !important;
    }

    .products-grid .product-item-name a,
    .product-items .product-item-name a {
        display: block !important;
        color: #222 !important;
        text-decoration: none !important;
    }

    .products-grid .price-box,
    .product-items .price-box {
        margin: 0 0 6px 0 !important;
        min-height: auto !important;
    }

    .products-grid .price,
    .product-items .price,
    .price-box .price {
        font-size: 12.5px !important;
        line-height: 1.2 !important;
        color: #e53935 !important;
        font-weight: 900 !important;
    }

    .products-grid .product-item-actions,
    .product-items .product-item-actions {
        margin-top: auto !important;
        width: 100% !important;
        display: block !important;
    }

    .products-grid .action.tocart,
    .product-items .action.tocart {
        width: 100% !important;
        max-width: 100% !important;
        height: 34px !important;
        min-height: 34px !important;
        line-height: 34px !important;
        padding: 0 8px !important;
        margin: 0 !important;
        border-radius: 8px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    /* ========================================================
       Trive Revo Slick slider mobile fix
       This is the active What’s New slider, not Owl Carousel.
       ======================================================== */

    .block-product-slider,
    .block-product-slider .block-content,
    .block-product-slider .products.wrapper,
    .block-product-slider .products-grid {
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .block-product-slider .slick-slider {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .block-product-slider .slick-list {
        overflow: hidden !important;
        margin: 0 -4px !important;
        padding: 0 !important;
    }

    .block-product-slider .slick-track {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
    }

    .block-product-slider .slick-slide {
        height: auto !important;
        padding: 0 4px !important;
        box-sizing: border-box !important;
        float: none !important;
        display: block !important;
    }

    .block-product-slider .slick-slide > div {
        height: 100% !important;
    }

    .block-product-slider .slick-slide li.product-item,
    .block-product-slider .slick-slide .product-item,
    .block-product-slider .products.list.items > li.product-item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    .block-product-slider .product-item-info,
    .block-product-slider [class*="product-item-info"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 305px !important;
        min-height: 305px !important;
        max-height: 305px !important;
        padding: 8px !important;
        border-radius: 12px !important;
        background: #fff !important;
        border: 1px solid #e6e6e6 !important;
        box-shadow: 0 4px 14px rgba(0,0,0,0.06) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }

    .block-product-slider .product-item-photo,
    .block-product-slider .product-image-container {
        width: 100% !important;
        height: 110px !important;
        min-height: 110px !important;
        max-height: 110px !important;
        margin: 0 auto 7px auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .block-product-slider .product-image-wrapper {
        width: 100% !important;
        height: 110px !important;
        min-height: 110px !important;
        max-height: 110px !important;
        padding-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .block-product-slider .product-image-photo {
        position: static !important;
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 102px !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    .block-product-slider .product-item-details {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .block-product-slider .product-item-name,
    .block-product-slider .product.name.product-item-name {
        font-size: 11.5px !important;
        line-height: 1.25 !important;
        min-height: 34px !important;
        max-height: 36px !important;
        overflow: hidden !important;
        margin: 0 0 5px 0 !important;
        text-align: left !important;
    }

    .block-product-slider .price-box {
        margin: 0 0 6px 0 !important;
        min-height: auto !important;
        max-height: 36px !important;
        overflow: hidden !important;
    }

    .block-product-slider .price {
        font-size: 12.5px !important;
        line-height: 1.2 !important;
        color: #e53935 !important;
        font-weight: 900 !important;
    }

    .block-product-slider .product-item-actions {
        margin-top: auto !important;
        width: 100% !important;
        display: block !important;
    }

    .block-product-slider .action.tocart {
        width: 100% !important;
        max-width: 100% !important;
        height: 34px !important;
        min-height: 34px !important;
        line-height: 34px !important;
        padding: 0 8px !important;
        margin: 0 !important;
        border-radius: 8px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    .block-product-slider .slick-prev,
    .block-product-slider .slick-next {
        width: 30px !important;
        height: 30px !important;
        z-index: 20 !important;
        background: #fff !important;
        border-radius: 50% !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.18) !important;
    }

    .block-product-slider .slick-prev {
        left: 2px !important;
    }

    .block-product-slider .slick-next {
        right: 2px !important;
    }

    /* Product detail mobile stack */
    .catalog-product-view .product.media,
    .catalog-product-view .product-info-main {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        clear: both !important;
        margin: 0 0 14px 0 !important;
        padding: 14px !important;
        box-sizing: border-box !important;
        border-radius: 14px !important;
    }

    .catalog-product-view .box-tocart .action.tocart {
        width: 100% !important;
        min-height: 46px !important;
        border-radius: 12px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 360px) {
    body.page-products .products-grid .product-item,
    body.catalog-category-view .products-grid .product-item,
    body.catalogsearch-result-index .products-grid .product-item {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .block-product-slider .product-item-info,
    .block-product-slider [class*="product-item-info"] {
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }
}

/* ============================================================
   End Virtual Mart Mobile Final Overrides
   ============================================================ */
