/* Section Spacing Optimization - Admin Controlled */
/* Consistent spacing: Only top margins to avoid double spacing */

/* Global rule: Remove all bottom spacing from sections */
section[class*="section"],
.home-section,
.content-section,
.page-section {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* First section (home slider) - no top margin */
.home-slider-section {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* All other sections - consistent top margin only */
.home-section, 
section[class*="section"]:not(.home-slider-section), 
.content-section,
.page-section {
    margin-top: var(--admin-section-spacing, 2rem) !important;
    margin-bottom: 0 !important;
}

/* Specific home page sections - consistent top spacing */
.featured-products-section,
.category-showcase-section,
.testimonial-section,
.brand-showcase-section,
.blog-section,
.newsletter-section,
.quick-highlights-section,
.quick-highlights,
.hero-banner-section,
.promotional-banner-section,
.video-section,
.organic-wall-section {
    margin-top: var(--admin-section-spacing, 2rem) !important;
    margin-bottom: 0 !important;
    padding-top: var(--admin-section-padding, 2.5rem) !important;
    padding-bottom: var(--admin-section-padding, 2.5rem) !important;
}

/* Padding within sections - admin controlled */
.section-content,
.container-fluid > .row,
.home-content {
    padding-top: calc(var(--admin-section-padding, 2.5rem) * 0.6) !important;
    padding-bottom: calc(var(--admin-section-padding, 2.5rem) * 0.6) !important;
}

/* Section headers spacing - admin controlled */
.section-header,
.section-title {
    margin-bottom: calc(var(--admin-section-spacing, 2rem) * 0.75) !important;
    margin-top: calc(var(--admin-section-spacing, 2rem) * 0.25) !important;
}

/* Reduce spacing around cards and product grids */
.product-grid,
.card-grid {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* Tighten up footer spacing */
.footer {
    margin-top: 2rem !important; /* Reduced from 3rem */
    padding-top: 1.5rem !important; /* Reduced from 2rem */
    padding-bottom: 1.5rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .home-slider-section {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .home-section, 
    section[class*="section"]:not(.home-slider-section), 
    .content-section,
    .page-section {
        margin-top: 1.5rem !important;
        margin-bottom: 0 !important;
    }
    
    .featured-products-section,
    .category-showcase-section,
    .testimonial-section,
    .testimonials-section,
    .brand-showcase-section,
    .blog-section,
    .newsletter-section,
    .quick-highlights-section,
    .quick-highlights,
    .hero-banner-section,
    .promotional-banner-section,
    .video-section,
    .organic-wall-section {
        margin-top: 1.5rem !important;
        margin-bottom: 0 !important;
        padding-top: 1.5rem !important;
        padding-bottom: 0 !important;
    }
    
    .section-content,
    .container-fluid > .row,
    .home-content {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .section-header,
    .section-title {
        margin-bottom: 1rem !important;
        margin-top: 0.25rem !important;
    }
    
    .footer {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .home-slider-section {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    .home-section, 
    section[class*="section"]:not(.home-slider-section) {
        margin-top: 1rem !important;
        margin-bottom: 0 !important;
    }
    
    .section-content {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Remove unnecessary spacing from specific Bootstrap classes */
.mb-5 { margin-bottom: 2rem !important; }
.mt-5 { margin-top: 1.5rem !important; }
.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }

/* Optimize container spacing */
.container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 768px) {
    .container, .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
}
