/* ==========================================================================
   Dr. Agro Organics - Premium CSS Enhancements
   ========================================================================== */

/* --- Glassmorphism Sticky Header & Smooth Transitions --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

/* Header scrolled state applied dynamically via JS */
.site-header.header-scrolled .main-header {
    background-color: var(--white);
    border-bottom: 1px solid rgba(14, 159, 61, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2px 0; /* Sleeker height when scrolled */
    transition: var(--transition);
}

.site-header.header-scrolled .site-logo img,
.site-header.header-scrolled .site-logo .custom-logo {
    max-height: 80px !important;
}

.site-header.header-scrolled .top-bar {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* --- Premium Interactive Hover States --- */
.btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Cards Hover Elevate Effect */
.choose-card, 
.category-card, 
.testimonial-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                border-color 0.4s ease;
}

.choose-card:hover, 
.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 30px rgba(8, 117, 44, 0.08);
    border-color: var(--primary-green);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
    border-color: rgba(14, 159, 61, 0.3);
}

/* Timeline steps micro-interactions */
.timeline-step {
    transition: transform 0.3s ease;
}

.timeline-step:hover {
    transform: translateY(-5px);
}

.timeline-step:hover .step-num {
    background-color: var(--dark-green);
    transform: scale(1.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}

/* Custom properties enhancements */
:root {
    --shadow-premium-glow: 0 0 20px rgba(14, 159, 61, 0.2);
}

/* --- Mobile First Responsiveness Fixes --- */

/* 320px & 375px Mobile Screen Viewports */
@media (max-width: 576px) {
    .top-bar-inner {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
    
    .top-contact-info {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }
    
    .top-bar-right {
        display: none; /* Hide non-critical tagline to save space on small screens */
    }

    /* Fluid Typography adjustment to prevent hero header clipping */
    .hero-title-main {
        font-size: clamp(1.8rem, 6.5vw, 2.5rem);
        line-height: 1.3;
    }

    .hero-lead {
        font-size: 1.15rem;
    }

    .hero-subtext {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .hero-section {
        padding: 100px 0 110px 0;
    }

    /* Squished preview metrics fix */
    .preview-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .metric-card {
        padding: 12px;
    }

    /* Section padding normalization for smaller viewports */
    .section-padding {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.85rem;
    }
}

/* 768px Tablet Viewports */
@media (min-width: 577px) and (max-width: 768px) {
    .preview-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .metric-card .num {
        font-size: 1.5rem;
    }

    .hero-title-main {
        font-size: 2.75rem;
    }
}

/* 1024px Laptop & 1440px Desktop Transitions */
@media (min-width: 1024px) {
    html {
        scroll-behavior: smooth;
    }
    
    /* Interactive cursor focus indicators */
    a:focus-visible, 
    button:focus-visible {
        outline: 3px solid var(--primary-green);
        outline-offset: 4px;
        border-radius: 4px;
    }
}

/* --- Navigation Dropdown & Sub-Menu Enhancements --- */
.nav-menu li {
    position: relative;
}

@media (min-width: 992px) {
    /* Hide sub-menu by default on desktop, style dropdown */
    .nav-menu .sub-menu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 240px;
        background-color: #ffffff;
        border: 1px solid var(--border-color);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        padding: 10px 0;
        margin: 0;
        list-style: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        border-radius: 6px;
    }
    
    /* Reveal sub-menu on hover */
    .nav-menu li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-menu .sub-menu li {
        width: 100%;
    }
    
    .nav-menu .sub-menu a {
        padding: 10px 20px;
        font-size: 0.9rem;
        color: var(--text-dark);
        white-space: nowrap;
        display: block;
        border-bottom: 1px solid var(--bg-light);
        transition: all 0.2s ease;
    }
    
    .nav-menu .sub-menu li:last-child a {
        border-bottom: none;
    }
    
    .nav-menu .sub-menu a:hover {
        background-color: var(--garlic-cream);
        color: var(--primary-green) !important;
        padding-left: 25px;
    }
    
    /* Indicator arrow for items with children */
    .nav-menu .menu-item-has-children > a::after {
        content: " ▾";
        font-size: 0.8em;
        vertical-align: middle;
        opacity: 0.7;
    }
}

/* Mobile sub-menu toggle behavior */
@media (max-width: 991px) {
    .nav-menu .sub-menu {
        list-style: none;
        padding-left: 15px;
        margin-top: 5px;
        display: none;
        background: var(--bg-light);
        border-radius: 4px;
    }
    .nav-menu .menu-item-has-children.active-submenu > .sub-menu {
        display: block;
    }
    .nav-menu .menu-item-has-children > a::after {
        content: " ▾";
        float: right;
    }
}
