/* Mobile Responsive Fixes */

/* General Mobile Styles */
@media (max-width: 767px) {

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
        /* Add padding to bottom so content isn't hidden behind fixed mobile menu */
        padding-bottom: 80px;
    }

    /* Ensure container padding is consistent */
    .container,
    .container-fluid {
        padding-right: 15px;
        padding-left: 15px;
    }

    /* Make all images responsive by default */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix overlapping content in some sections */
    section {
        overflow: hidden;
    }

    /* Adjust font sizes for better readability on small screens if needed */
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 20px;
    }

    h4 {
        font-size: 18px;
    }

    /* Ensure tables roll on mobile if wide */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide top banner on mobile screens only */
    .top-header {
        display: none !important;
    }

    /* Mobile-optimized deals popup notification */
    .cookie-bar-section.veg-cookiebar {
        position: fixed !important;
        bottom: 80px !important;
        /* Above mobile nav */
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 30px) !important;
        max-width: 350px !important;
        border-radius: 12px !important;
        padding: 12px 15px !important;
        z-index: 999 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    }

    .cookie-bar-section.veg-cookiebar .content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        position: relative !important;
    }

    .cookie-bar-section.veg-cookiebar .content p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 0 0 12px 0 !important;
        padding-right: 25px !important;
        color: #e3dcc7 !important;
    }

    .cookie-bar-section.veg-cookiebar .cookie-buttons {
        width: 100% !important;
    }

    .cookie-bar-section.veg-cookiebar .cookie-buttons button {
        width: 100% !important;
        padding: 10px 20px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
    }

    .cookie-bar-section.veg-cookiebar .deals-close-btn {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 14px !important;
        color: #e3dcc7 !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 50% !important;
    }

    .cookie-bar-section.veg-cookiebar .deals-close-btn:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #fff !important;
    }

    /* Hide when notification is closing */
    .cookie-bar-section.veg-cookiebar.hiding {
        opacity: 0 !important;
        transform: translateX(-50%) translateY(100px) !important;
    }

    /* Mobile Login Button Responsive Styles - Match Cart Button Height */
    .login-btn,
    .cart-dropdown .btn-spacing {
        padding: 6px 10px !important;
        font-size: 13px !important;
        min-width: auto !important;
        white-space: nowrap !important;
        line-height: 1.4 !important;
        height: auto !important;
    }

    .login-btn i,
    .cart-dropdown .btn-spacing i {
        width: 16px !important;
        height: 16px !important;
        margin-right: 4px !important;
    }

    .login-btn span,
    .cart-dropdown .btn-spacing span {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    /* Mobile Header Overlap Fix - Ensure header stays on top of hero section */
    header {
        position: relative;
        z-index: 999 !important;
        background: white;
    }

    /* Prevent hero/poster section from overlapping header */
    .poster-section-6,
    section.pt-0.poster-section-6 {
        margin-top: 0 !important;
        padding-top: 20px !important;
        position: relative;
        z-index: 1;
    }

    /* Ensure main header has proper positioning */
    .main-header {
        position: relative;
        z-index: 998;
        background: white;
    }

    /* Mobile menu should be above everything */
    .mobile-menu {
        position: fixed;
        bottom: 0;
        z-index: 1000 !important;
    }

    /* Hero Section Slider Arrows - Make them orange on mobile as requested */
    .poster-image.classic-arrow-1 .custom-arrow.next,
    .poster-image.classic-arrow-1 .custom-arrow.next i,
    .poster-image.classic-arrow-1 .custom-arrow.next span,
    .poster-image.classic-arrow-1 .custom-arrow.prev,
    .poster-image.classic-arrow-1 .custom-arrow.prev i,
    .poster-image.classic-arrow-1 .custom-arrow.prev span {
        color: #ff6f00 !important;
        opacity: 1 !important;
    }
}

@media (max-width: 575px) {

    /* Additional small screen fixes */
    header {
        margin-bottom: 10px;
    }

    .poster-section-6 {
        margin-top: 10px !important;
    }
}

/* Quick View Modal Responsive Fixes */
@media (max-width: 991px) {
    .quick-view-modal .modal-dialog {
        max-width: 95% !important;
        margin: 10px auto !important;
    }

    .quick-view-modal .modal-content {
        max-height: 90vh;
        overflow: hidden;
    }

    .quick-view-modal .modal-body {
        padding: 15px !important;
        max-height: calc(90vh - 60px);
        /* Subtract header/close button space */
        overflow-y: auto;
    }

    /* Force stacking if not already happening */
    .quick-view-modal .col-lg-6 {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Image adjustments */
    .quick-view-image {
        margin-bottom: 15px;
    }

    .quick-view-image .quick-view-slider img {
        height: auto !important;
        max-height: 250px !important;
        object-fit: contain !important;
        margin: 0 auto;
    }

    /* Thumbnail nav adjustments */
    .quick-view-image .quick-nav {
        margin-top: 10px;
        justify-content: center;
    }

    .quick-view-image .quick-nav img {
        height: 60px;
        width: auto;
    }

    /* Content adjustments */
    .quick-view-modal .product-right {
        text-align: center;
        padding: 0 10px;
    }

    .quick-view-modal .product-right h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .quick-view-modal .product-right .rating,
    .quick-view-modal .product-right .price {
        justify-content: center;
    }

    .quick-view-modal .product-right .product-btns {
        justify-content: center;
        margin-bottom: 20px;
    }
}