/* ===== CSS OVERRIDE FOR CONTAINER SPACING ===== */

/* Force full width containers - override all other styles */
.site-wrapper .container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
}

/* Featured Products Section Specific Styles */
.featured-products {
    padding: 60px 0 !important;
    background: #f8f9fa !important;
}

.featured-products .container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.featured-products .section-title {
    text-align: center !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 3rem !important;
    color: #333 !important;
}

.featured-products .product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    width: 100% !important;
}

.featured-products .product-card {
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.featured-products .product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.featured-products .product-image {
    position: relative !important;
    height: 250px !important;
    overflow: hidden !important;
}

.featured-products .product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.featured-products .product-card:hover .product-image img {
    transform: scale(1.05) !important;
}

.featured-products .product-actions {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.featured-products .product-card:hover .product-actions {
    opacity: 1 !important;
}

.featured-products .action-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: white !important;
    border: 1px solid #ddd !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    color: #333 !important;
}

.featured-products .action-btn:hover {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

.featured-products .out-of-stock-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: rgba(255,0,0,0.8) !important;
    color: white !important;
    padding: 5px 10px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}

.featured-products .product-info {
    padding: 20px !important;
}

.featured-products .product-name {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin: 0 0 8px 0 !important;
    color: #333 !important;
    line-height: 1.4 !important;
}

.featured-products .product-category {
    color: #666 !important;
    font-size: 0.9rem !important;
    margin: 0 0 10px 0 !important;
}

.featured-products .product-rating {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-bottom: 10px !important;
    font-size: 0.9rem !important;
    color: #666 !important;
}

.featured-products .product-rating i {
    color: #ffc107 !important;
}

.featured-products .product-price {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
}

.featured-products .current-price {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #333 !important;
}

.featured-products .original-price {
    font-size: 1rem !important;
    color: #999 !important;
    text-decoration: line-through !important;
}

.featured-products .discount-badge {
    background: #28a745 !important;
    color: white !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}

.featured-products .add-to-cart-btn {
    width: 100% !important;
    padding: 12px !important;
    background: #667eea !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.featured-products .add-to-cart-btn:hover {
    background: #5a67d8 !important;
}

/* Responsive adjustments for featured products */
@media (max-width: 1200px) {
    .featured-products .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
    }
}

@media (max-width: 768px) {
    .featured-products .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .featured-products .section-title {
        font-size: 2rem !important;
    }
}

@media (max-width: 576px) {
    .featured-products .product-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .featured-products .section-title {
        font-size: 1.5rem !important;
    }
}

/* Override any Tailwind or other framework spacing */
.site-wrapper .container.categories,
.site-wrapper .container.featured-products,
.site-wrapper .container.newsletter,
.site-wrapper .container.footer-content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
}

/* Remove any conflicting padding/margins */
.site-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
}

/* Force sections to use full width */
.categories,
.featured-products,
.newsletter,
.main-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 40px 0 !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
}

/* Desktop specific - minimal spacing */
@media (min-width: 768px) {
    .site-wrapper .container {
        padding: 0 12px !important;
    }
    
    /* Increase search bar width on desktop */
    .header-search-inline {
        max-width: 800px !important;
        margin: 0 var(--spacing-md) !important;
    }
    
    /* Apply mobile cart design to desktop */
    .cart-link {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        background: var(--primary-color, #6366f1) !important;
        color: white !important;
        border-radius: 50% !important;
        font-size: 18px !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
        transition: all 0.3s ease !important;
        border: 2px solid white !important;
    }
    
    .cart-link:hover {
        background: var(--primary-dark, #4f46e5) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5) !important;
    }
    
    .cart-badge {
        position: absolute !important;
        top: -2px !important;
        right: -2px !important;
        background: #ef4444 !important;
        color: white !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        padding: 3px 6px !important;
        border-radius: 12px !important;
        min-width: 20px !important;
        height: 20px !important;
        text-align: center !important;
        line-height: 1 !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
    }
    
    /* Increase product image height on desktop */
    .product-card img {
        height: 250px !important; /* Taller on desktop */
        object-fit: cover !important;
        width: 100% !important;
    }
}

@media (min-width: 1024px) {
    .site-wrapper .container {
        padding: 0 16px !important;
    }
    
    /* Increase search bar width even more on larger desktop */
    .header-search-inline {
        max-width: 900px !important;
        margin: 0 var(--spacing-lg) !important;
    }
    
    /* Maintain enhanced cart design on larger desktop */
    .cart-link {
        width: 44px !important;
        height: 44px !important;
        background: var(--primary-color, #6366f1) !important;
        color: white !important;
        border-radius: 50% !important;
        font-size: 18px !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
        border: 2px solid white !important;
    }
    
    .cart-link:hover {
        background: var(--primary-dark, #4f46e5) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5) !important;
    }
    
    .cart-badge {
        background: #ef4444 !important;
        color: white !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
    }
    
    /* Increase product image height on larger desktop */
    .product-card img {
        height: 280px !important; /* Even taller on large desktop */
        object-fit: cover !important;
        width: 100% !important;
    }
}

/* Mobile - prevent horizontal scrolling */
@media (max-width: 767px) {
    .site-wrapper .container {
        padding: 0 12px !important;
    }
    
    /* Prevent horizontal overflow on mobile */
    body {
        overflow-x: hidden !important;
    }
    
    .site-wrapper {
        overflow-x: hidden !important;
    }
    
    /* FORCE mobile search bar visibility with stronger rules */
    .header-search {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        padding: 12px 16px !important;
        margin: 0 !important;
        background: var(--white) !important;
        border-bottom: 1px solid var(--gray-200) !important;
        z-index: 999 !important;
        height: auto !important;
        min-height: 60px !important;
    }
    
    /* Hide inline search completely on mobile */
    .header-search-inline {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Force mobile search bar styling */
    .header-search .search-bar {
        width: 100% !important;
        max-width: none !important;
        background: var(--gray-50) !important;
        border: 2px solid var(--gray-200) !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .header-search .search-input {
        font-size: 14px !important;
        padding: 12px 16px !important;
        border: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        flex: 1 !important;
        outline: none !important;
    }
    
    .header-search .search-btn {
        padding: 12px 16px !important;
        border-radius: 0 !important;
        background: var(--primary-color, #6366f1) !important;
        color: white !important;
        border: none !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .header-search .search-btn:hover {
        background: var(--primary-dark, #4f46e5) !important;
    }
    
    /* Force mobile grid layouts to be responsive */
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        width: 100% !important;
    }
    
    /* Ensure product cards don't overflow */
    .product-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Increase product image height */
    .product-card img {
        height: 220px !important; /* Increased from default */
        object-fit: cover !important;
        width: 100% !important;
    }
    
    .category-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Header mobile fixes */
    .header-top {
        padding: 8px 12px !important;
        justify-content: space-between !important;
    }
    
    .header-left {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    
    .header-actions {
        order: 1 !important; /* Keep cart on right side */
        margin-left: 12px !important;
    }
    
    .cart-link {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        background: var(--primary-color, #6366f1) !important;
        color: white !important;
        border-radius: 50% !important;
        font-size: 18px !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
        transition: all 0.3s ease !important;
        border: 2px solid white !important;
    }
    
    .cart-link:hover {
        background: var(--primary-dark, #4f46e5) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5) !important;
    }
    
    .cart-badge {
        position: absolute !important;
        top: -2px !important;
        right: -2px !important;
        background: #ef4444 !important;
        color: white !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        padding: 3px 6px !important;
        border-radius: 12px !important;
        min-width: 20px !important;
        height: 20px !important;
        text-align: center !important;
        line-height: 1 !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
    }
    
    /* Header mobile fixes */
    .header-top {
        padding: 8px 12px !important;
        justify-content: space-between !important;
    }
    
    .header-left {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    
    .header-actions {
        order: 1 !important; /* Keep cart on right side */
        margin-left: 12px !important;
    }
    
    .cart-link {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        background: var(--primary-color, #6366f1) !important;
        color: white !important;
        border-radius: 50% !important;
        font-size: 18px !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
        transition: all 0.3s ease !important;
        border: 2px solid white !important;
    }
    
    .cart-link:hover {
        background: var(--primary-dark, #4f46e5) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5) !important;
    }
    
    .cart-badge {
        position: absolute !important;
        top: -2px !important;
        right: -2px !important;
        background: #ef4444 !important;
        color: white !important;
        font-size: 11px !important;
        font-weight: 700 !important;
        padding: 3px 6px !important;
        border-radius: 12px !important;
        min-width: 20px !important;
        height: 20px !important;
        text-align: center !important;
        line-height: 1 !important;
        border: 2px solid white !important;
        box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3) !important;
    }
    .footer-content {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .footer-section {
        width: 100% !important;
    }
}
