/* ============================================
   MOBILE RESPONSIVE FIXES FOR HOME PAGE
   ============================================ */

/* Banner Section Mobile Fix */
@media (max-width: 575px) {
    .s-collection {
        padding: 2rem 0;
    }
    
    .s-collection .row {
        margin-left: -8px;
        margin-right: -8px;
        --bs-gutter-x: 16px;
    }
    
    .s-collection [class*="col-"] {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 16px;
    }
    
    .box-image_V06 {
        margin-bottom: 0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .box-image_V06 .box-image_image {
        height: 180px;
        overflow: hidden;
        display: block;
    }
    
    .box-image_V06 .box-image_image img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .box-image_content {
        padding: 14px;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.6);
        color: white;
    }
    
    .box-image_content .title {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 10px;
        color: white;
    }
    
    .box-image_content .title a {
        color: white !important;
        text-decoration: none;
    }
    
    .tf-btn-line {
        padding: 8px 16px;
        font-size: 12px;
        border: 1px solid white;
        color: white;
        background: transparent;
        border-radius: 4px;
        text-decoration: none;
        display: inline-block;
        transition: all 0.3s ease;
    }
    
    .tf-btn-line:hover {
        background: white;
        color: #333 !important;
        text-decoration: none;
    }

    /* Fix for third item being alone on mobile */
    .s-collection .col-6:nth-child(3) {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

/* REMOVED: Conflicting category grid rules - now handled by mobile-category-fix.css */

/* REMOVED: Conflicting category styles - now handled by mobile-category-fix.css */

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 374px) {
    .category-image-wrapper {
        height: 120px !important;
    }
    
    .category-name {
        font-size: 13px !important;
    }
    
    .category-parent {
        font-size: 10px !important;
    }
    
    .category-info {
        padding: 10px;
    }
    
    .row.g-4 {
        --bs-gutter-x: 8px;
        --bs-gutter-y: 8px;
        margin-left: -4px;
        margin-right: -4px;
    }
    
    .row.g-4 > * {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* Fix for better image loading */
.category-image.lazyload:not(.lazyloaded) {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-image.lazyload:not(.lazyloaded)::before {
    content: 'Loading...';
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

/* Hover effects adjustments for mobile */
@media (hover: hover) {
    .category-card-modern:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    }
    
    .category-card-modern:hover .category-image {
        transform: scale(1.05);
    }
}

/* Touch devices - remove hover effects */
@media (hover: none) {
    .category-card-modern:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .category-card-modern:hover .category-image {
        transform: none;
    }
    
    .category-card-modern:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Section title mobile fixes */
@media (max-width: 575px) {
    .sect-title {
        margin-bottom: 1.5rem !important;
    }
    
    .sect-title .s-title {
        font-size: 24px !important;
        margin-bottom: 8px !important;
    }
    
    .sect-title .sub-title {
        font-size: 14px !important;
        margin-bottom: 0;
    }
    
    .btn-view-all-categories {
        display: none !important;
    }
    
    .sect-title .d-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Mobile View All Button Styling */
@media (max-width: 767px) {
    .text-center.mt-4.d-md-none {
        margin-top: 1.5rem !important;
    }
    
    .btn-outline-primary.btn-lg {
        padding: 12px 24px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        border-width: 2px;
    }
    
    .btn-outline-primary.btn-lg i {
        margin-right: 8px;
    }
}

/* Product Grid Mobile Fix */
@media (max-width: 575px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-card__image {
        aspect-ratio: 1;
        height: auto;
    }
    
    .product-card__content {
        padding: 10px;
    }
    
    .product-card__title {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .product-card__category {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .product-card__price-sale {
        font-size: 14px;
    }
    
    .product-card__cta {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 6px;
    }
}

/* Ensure proper spacing for the section */
@media (max-width: 575px) {
    .flat-spacing-2 {
        padding: 2rem 0 !important;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Fix for banner image heights */
@media (max-width: 575px) {
    .box-image_V06.type-space-2 {
        min-height: 180px;
    }
    
    .box-image_V06 .box-image_image {
        height: 180px;
        overflow: hidden;
    }
    
    .box-image_V06 .box-image_image img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center;
    }
}

/* Animation adjustments for mobile */
@media (max-width: 575px) {
    .wow.fadeInUp {
        animation-duration: 0.6s;
        animation-delay: 0s !important;
    }
    
    .wow.fadeInUp[data-wow-delay] {
        animation-delay: 0.1s !important;
    }
}

/* REMOVED: Emergency fixes - now handled by mobile-category-fix.css */
