/* ========================================
   Section Spacing and Order Fixes
   ======================================== */

/* Remove excessive padding/margins */
.categories {
    padding: 3rem 0 !important;
    margin-bottom: 0 !important;
}

.newsletter {
    padding: 3rem 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.products {
    padding: 3rem 0 !important;
}

.features {
    padding: 3rem 0 !important;
    background: transparent !important;
}

/* Remove any extra spacing after specific sections */
.categories + *,
.newsletter + * {
    margin-top: 0 !important;
}

/* Fix section transitions */
section + section {
    margin-top: 0;
}

/* ========================================
   Redesigned Features Section (Delivery Zone Style)
   ======================================== */

.features-section-redesigned {
    background: linear-gradient(135deg, #FEF3E2 0%, #FFF8F0 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
    z-index: 5;
}

.features-section-redesigned::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.features-header {
    text-align: center;
    margin-bottom: 3rem;
}

.features-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.features-header h2 {
    font-size: 2.25rem;
    font-family: var(--font-display);
    color: var(--gray-900);
    margin: 0;
}

/* Redesigned Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 0;
}

.feature-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    z-index: 10;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(217, 119, 6, 0.15);
    z-index: 20;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:nth-child(1) {
    background: linear-gradient(135deg, #FFF8F0 0%, #FEF3E2 100%);
    border: 2px solid var(--primary-light);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

.feature-card h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

.feature-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.375rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.feature-card:hover .feature-tag {
    opacity: 1;
}

/* Feature card hover arrow effect */
.feature-card::after {
    content: '→';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    opacity: 0;
    transition: all var(--transition-base);
    color: var(--primary);
    font-size: 1.5rem;
}

.feature-card:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
}

/* Use emoji icons for features */
.feature-icon-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(5px);
    }
}

/* Pattern background for visual interest */
.features-section-redesigned::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(217, 119, 6, 0.03) 10px,
        rgba(217, 119, 6, 0.03) 20px
    );
    pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .features-header h2 {
        font-size: 1.75rem;
    }

    .categories {
        padding: 2rem 0 !important;
    }

    .newsletter {
        padding: 2rem 0 !important;
    }

    .products {
        padding: 2rem 0 !important;
    }

    .features {
        padding: 2rem 0 !important;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Fix any lingering spacing issues */
.section-header {
    margin-bottom: 2rem !important;
}

.section-cta {
    margin-top: 2rem !important;
}

/* Ensure smooth transitions between sections */
.hero + .products {
    margin-top: 0;
}

.products + .features-section-redesigned {
    margin-top: 0;
}

.features-section-redesigned + .categories {
    margin-top: 0;
}

.categories + .delivery-zone-section {
    margin-top: 0;
}

/* Newsletter specific fixes */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 3rem 0;
    margin: 0;
}

.newsletter-section + * {
    margin-top: 0;
}

/* Fix FAQ section spacing */
.faq-section {
    padding: 3rem 0;
    margin: 0;
}

/* Fix testimonials section spacing */
.testimonials {
    padding: 3rem 0;
    margin: 0;
}

/* Fix blog section spacing */
.blog-preview {
    padding: 3rem 0;
    margin: 0;
}

/* Ensure no double backgrounds */
.features {
    background: transparent !important;
}

/* Order adjustment helper classes */
.section-order-1 { order: 1; }
.section-order-2 { order: 2; }
.section-order-3 { order: 3; }
.section-order-4 { order: 4; }
.section-order-5 { order: 5; }
.section-order-6 { order: 6; }

/* Container for flexible section ordering */
.main-content {
    display: flex;
    flex-direction: column;
}

/* Remove any default margins from main semantic elements */
main {
    margin: 0;
    padding: 0;
}

article, aside, section {
    margin-top: 0;
    margin-bottom: 0;
}

/* ========================================
   Universal Spacing Fixes for All Pages
   ======================================== */

/* Fix excessive spacing after navbar on all pages */
body {
    margin: 0;
    padding: 0;
}

/* Consistent hero sections with proper navbar clearance */
/* Total navbar space: 40px (announcement) + 70px (navbar) = 110px */

.hero-section,
.blog-hero,
.about-hero,
.contact-hero,
.products-header {
    padding-top: 110px;
    min-height: 350px; /* Consistent height for all hero sections */
    display: flex;
    align-items: center;
    margin-top: 0;
}

/* Ensure consistent container styling */
.hero-section .container,
.blog-hero .container,
.about-hero .container, 
.contact-hero .container,
.products-header .container {
    text-align: center;
    width: 100%;
}

/* Hero section already has padding-top, just ensure no extra margin */
.hero {
    margin-top: 0 !important;
}

/* Fix Blog specific spacing issues */
.blog-content {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

.newsletter-cta {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

/* Fix FAQ section spacing */
.faq-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    margin: 0 !important;
}

/* Ensure footer has proper spacing */
footer {
    margin-top: 0 !important;
}

/* Fix general section spacing issues */
section + section {
    margin-top: 0 !important;
}

/* Remove excessive padding from hero-like sections */
.page-header,
.section-header,
.blog-hero {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
}