/* ==========================================================================
   Agway Research — Site Stylesheet
   Consolidated from header.php + index.php inline <style> blocks so the
   browser can cache it once and reuse it across every page, instead of
   re-downloading/re-parsing the same CSS on every request.
   Dead rule removed: .card-hover-lift (defined but never used in markup).
   ========================================================================== */

/* ---- Site-wide (from header.php) ---- */
:root {
            --agway-blue:      #1e35d9;
            --agway-blue-dark: #121f8f;
            --agway-green:     #007002;
            --agway-green-dark:#0b5c23;
            --agway-navy:      #0b1440;
        }

        /* ---- Bootstrap Core Styling Remaps ---- */
        .btn-primary { background-color: var(--agway-blue) !important; border-color: var(--agway-blue) !important; }
        .btn-primary:hover, .btn-primary:focus { background-color: var(--agway-blue-dark) !important; border-color: var(--agway-blue-dark) !important; }
        .btn-outline-primary { color: var(--agway-blue) !important; border-color: var(--agway-blue) !important; }
        .btn-outline-primary:hover { background-color: var(--agway-blue) !important; color: #fff !important; }
        .text-primary { color: var(--agway-blue) !important; }
        .bg-primary { background-color: var(--agway-blue) !important; }
        .border-primary { border-color: var(--agway-blue) !important; }
        .badge.bg-primary { background-color: var(--agway-blue) !important; }
        a { color: var(--agway-blue); }

        /* ---- Header Top Utilities Bar ---- */
        .top-bar {
            background: var(--agway-navy);
            color: #cbd5e1;
            font-size: 0.85rem;
            border-bottom: 3px solid transparent;
            border-image: linear-gradient(90deg, var(--agway-blue), var(--agway-green)) 1;
        }
        .top-bar a { color: #cbd5e1; text-decoration: none; }
        .top-bar svg { color: var(--agway-green) !important; }
        .top-bar .badge-brand {
            background: linear-gradient(90deg, var(--agway-blue), var(--agway-green));
            color: #fff; font-weight: 600; letter-spacing: 0.02em;
        }

        /* ---- Primary Site Layout Navigation Strip ---- */
        .site-header-primary-section-wrap {
            position: sticky; top: 0; z-index: 1030;
            background:
                radial-gradient(circle at 8% 0%, rgba(30,53,217,0.06), transparent 45%),
                radial-gradient(circle at 95% 100%, rgba(0,112,2,0.07), transparent 45%),
                #ffffff;
            box-shadow: 0 4px 18px -8px rgba(11,20,64,0.12);
        }
        .navbar-brand img {
            height: 58px; width: 58px; object-fit: contain;
            border-radius: 50%;
            box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(26,51,232,0.12);
            transition: box-shadow 0.2s ease, transform 0.2s ease;
        }
        .navbar-brand:hover img {
            box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(26,51,232,0.28);
            transform: scale(1.04);
        }
        .navbar-brand .brand-name { color: var(--agway-navy) !important; line-height: 1.1; }
        .navbar-brand .brand-sub { color: var(--agway-green); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

        .ast-nav-menu .nav-link {
            color: #334155 !important; font-weight: 500; font-size: 0.95rem;
            transition: color 0.15s ease, background 0.15s ease, padding 0.15s ease;
            position: relative; border-radius: 999px;
            padding-top: 0.4rem !important;
            padding-bottom: 0.4rem !important;
            padding-left: 0.9rem !important;
            padding-right: 0.9rem !important;
        }
        
        /* Desktop Hover Actions for Normal Dropdowns */
        @media (min-width: 992px) {
            .ast-nav-menu .dropdown:hover > .dropdown-menu {
                display: block;
                margin-top: 0 !important;
                animation: dropdownFade 0.15s ease-out;
            }
        }
        
        .ast-nav-menu .nav-link:hover, .ast-nav-menu .nav-link.active {
            color: #ffffff !important;
            background: linear-gradient(135deg, var(--agway-blue), var(--agway-green));
            box-shadow: 0 6px 14px -6px rgba(26,51,232,0.45);
            padding-top: 0.3rem !important;
            padding-bottom: 0.3rem !important;
        }
        .ast-nav-menu .nav-link.active { font-weight: 700; }
        .ast-nav-menu .nav-link.dropdown-toggle::after { transition: transform 0.2s ease; }
        .ast-nav-menu .dropdown:hover .nav-link.dropdown-toggle::after,
        .ast-nav-menu .nav-item.show .nav-link.dropdown-toggle::after { transform: rotate(180deg); }

        .dropdown-menu {
            border: none; border-top: 3px solid var(--agway-blue);
            box-shadow: 0 16px 30px -10px rgba(11,20,64,0.2);
            border-radius: 10px; padding: 0.5rem;
            animation: dropdownFade 0.15s ease-out;
        }
        @keyframes dropdownFade {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .dropdown-item {
            font-size: 0.9rem; padding: 0.55rem 1rem; color: #475569 !important;
            border-radius: 6px; transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
        }
        .dropdown-item:hover {
            background: linear-gradient(135deg, var(--agway-blue), var(--agway-green));
            color: #ffffff !important;
            padding-left: 1.25rem;
        }

        /* ---- Desktop Sizing Synchronization For Buttons ---- */
        .custom-hover-auth .dropdown-toggle-btn {
            border: 1px solid var(--agway-blue) !important;
            background-color: transparent !important;
            color: var(--agway-blue) !important;
            font-size: 0.95rem !important;
            font-weight: 500 !important;
            padding: 0.3rem 1.1rem !important; /* Perfect height match with Register button */
            line-height: 1.5 !important;
            border-radius: 999px !important;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            height: auto;
        }

        @media (min-width: 992px) {
            .custom-hover-auth:hover > .dropdown-menu {
                display: block !important;
                margin-top: 0 !important;
                animation: dropdownFade 0.15s ease-out;
            }
            .custom-hover-auth .dropdown-toggle::after {
                transition: transform 0.2s ease;
            }
            .custom-hover-auth:hover .dropdown-toggle::after {
                transform: rotate(180deg);
            }
            .custom-hover-auth:hover .dropdown-toggle-btn {
                color: #ffffff !important;
                background: linear-gradient(135deg, var(--agway-blue), var(--agway-green)) !important;
                border-color: transparent !important;
                box-shadow: 0 6px 14px -6px rgba(26,51,232,0.45);
            }
        }

        /* ---- Mobile View Clean Fixes ---- */
        @media (max-width: 991.98px) {
            .custom-hover-auth {
                border-bottom: 1px solid #eef1f6 !important;
                width: 100%;
                padding: 0.25rem 0 !important;
            }
            .ast-nav-menu .custom-hover-auth .nav-link.dropdown-toggle-btn {
                background: transparent !important;
                border: none !important;
                color: #334155 !important;
                box-shadow: none !important;
                padding: 0.9rem 0.25rem !important;
                text-align: left !important;
                width: 100%;
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-radius: 0 !important;
            }
            .ast-nav-menu .custom-hover-auth .nav-link.dropdown-toggle-btn:hover {
                color: var(--agway-blue) !important;
            }
            
            /* FIXED: Dropdown menu container styling rules inside the mobile list */
            .custom-hover-auth .dropdown-menu {
                background: #f8faff !important;
                box-shadow: none !important;
                border: none !important;
                margin-top: 0 !important;
                padding: 0.25rem 0.5rem !important;
                position: static !important;
                width: 100%;
                display: none; /* Controlled cleanly by our micro JS trigger below */
            }
            
            /* Class dynamically added when user taps the button on mobile */
            .custom-hover-auth .dropdown-menu.show-mobile-active {
                display: block !important;
            }
            
            .custom-hover-auth .dropdown-item {
                font-size: 0.9rem;
                padding: 0.6rem 1rem !important;
                color: #475569 !important;
                background: transparent !important;
                border-radius: 8px;
            }
            .custom-hover-auth .dropdown-item:hover {
                background: #eef2ff !important;
                color: var(--agway-blue) !important;
                padding-left: 1.25rem !important;
            }
            .mobile-auth-actions {
                width: 100% !important;
                border-bottom: none !important;
                padding-top: 0.75rem !important; /* Restores top margin separation */
                margin-top: 0.25rem !important;
            }
            .ast-nav-menu .mobile-auth-actions .btn-register-brand {
                display: inline-flex !important;
                justify-content: center !important;
                align-items: center !important;
                width: 100% !important;
                text-align: center !important; /* Centers text alignment */
                background: linear-gradient(90deg, var(--agway-blue), var(--agway-green)) !important; /* Restores the signature brand gradient background */
                color: #ffffff !important; /* Sets text color back to visible white */
                border: none !important;
                box-shadow: 0 6px 14px -5px rgba(26,51,232,0.45) !important;
                padding: 0.6rem 1.25rem !important; /* Gives the button clear structural height and padding */
                border-radius: 999px !important; /* Matches pill-shaped geometry design curves */
                font-weight: 600 !important;
            }
            .ast-nav-menu .mobile-auth-actions .btn-register-brand:hover {
                opacity: 0.95 !important;
                box-shadow: 0 8px 18px -5px rgba(26,51,232,0.55) !important;
            }

        }

        /* ---- Shopping Cart Visual Components ---- */
        .cart-nav-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            padding: 0 !important;
            border-radius: 999px;
        }
        .cart-icon-stack {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .cart-icon-stack i {
            font-size: 1.75rem;
            line-height: 1;
        }
        .cart-qty {
            position: absolute;
            top: -7px;
            right: -12px;
            background: #f97316;
            color: #ffffff !important;
            font-size: 0.68rem;
            font-weight: 800;
            line-height: 1;
            min-width: 18px;
            height: 18px;
            padding: 0 4px;
            border-radius: 999px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 0 2px #ffffff;
        }
        .cart-nav-link:hover i, .cart-nav-link.active i { color: #ffffff !important; }
        .cart-nav-link:hover .cart-qty, .cart-nav-link.active .cart-qty { box-shadow: 0 0 0 2px var(--agway-green); }

        .mobile-cart-toggle-wrap { gap: 0.85rem; }
        .mobile-cart-toggle-wrap .cart-nav-link { width: 42px; height: 42px; color: #334155; }
        .mobile-cart-toggle-wrap .cart-nav-link i { font-size: 1.5rem; }
        .mobile-cart-toggle-wrap .cart-nav-link:hover, .mobile-cart-toggle-wrap .cart-nav-link.active {
            background: linear-gradient(135deg, var(--agway-blue), var(--agway-green));
        }

        /* ---- Register Button Styling ---- */
        .btn-register-brand {
            background: linear-gradient(90deg, var(--agway-blue), var(--agway-green));
            border: none; color: #fff !important; font-weight: 600;
            box-shadow: 0 6px 14px -5px rgba(26,51,232,0.45);
            transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
            font-size: 0.95rem !important;
            padding: 0.3rem 1.3rem !important;
            line-height: 1.5 !important;
            border-radius: 999px !important;
            display: inline-flex;
            align-items: center;
            height: auto;
        }
        .btn-register-brand:hover {
            opacity: 1; color: #fff !important;
            transform: translateY(-1px);
            box-shadow: 0 8px 18px -5px rgba(26,51,232,0.55);
        }

        /* ---- Breadcrumbs Bar Layout ---- */
        .agway-breadcrumb-bar { background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
        .agway-breadcrumb-bar .breadcrumb { font-size: 0.85rem; }
        .agway-breadcrumb-bar .breadcrumb-item a { color: var(--agway-blue); text-decoration: none; font-weight: 500; }
        .agway-breadcrumb-bar .breadcrumb-item a:hover { text-decoration: underline; }
        .agway-breadcrumb-bar .breadcrumb-item.active { color: var(--agway-green); font-weight: 600; }
        .agway-breadcrumb-bar .breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }

        /* ---- Mobile Screen Breakpoint Overwrites ---- */
        @media (max-width: 991.98px) {
            .navbar-brand img { height: 44px; width: 44px; }
            .navbar-brand .brand-name { font-size: 1.05rem; }
        }
        @media (max-width: 400px) {
            .navbar-brand img { height: 38px; width: 38px; }
            .navbar-brand .brand-name { font-size: 0.92rem; }
        }
        @media (max-width: 991.98px) {
            .navbar-collapse {
                margin-top: 1rem;
                background: #ffffff;
                border-radius: 16px;
                padding: 0.5rem 1.25rem 1.25rem;
                box-shadow: 0 14px 30px -12px rgba(11,20,64,0.18);
            }
            .ast-nav-menu { width: 100%; }
            .ast-nav-menu > .nav-item { width: 100%; border-bottom: 1px solid #eef1f6; }
            .ast-nav-menu > .nav-item:last-of-type { border-bottom: none; }
            .cart-desktop-only { display: none !important; }
            .ast-nav-menu .nav-link { padding: 0.9rem 0.25rem !important; }
            .ast-nav-menu .nav-link:hover, .ast-nav-menu .nav-link.active {
                background: linear-gradient(135deg, var(--agway-blue), var(--agway-green));
                color: #ffffff !important; border-radius: 8px; padding-left: 0.75rem !important;
            }
            .ast-nav-menu .dropdown-menu { border: none; box-shadow: none; background: #f8faff; border-radius: 10px; margin: 0.25rem 0 0.5rem; }
            .mobile-auth-actions { border-bottom: none !important; padding-top: 0.9rem; margin-top: 0.25rem; }
            .mobile-auth-actions .btn { width: 100%; }
        }

        /* ---- Loader Animations ---- */
        .so-page-loader {
            position: fixed; inset: 0; z-index: 9999; background: #f8fafc;
            display: flex; align-items: center; justify-content: center;
            transition: opacity .25s ease, visibility .25s ease;
        }
        .so-page-loader.so-loader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
        .so-loader-logo {
            width: 68px; height: 68px; object-fit: contain; border-radius: 50%;
            background: #ffffff; padding: 8px; box-shadow: 0 4px 16px rgba(11,20,64,0.18);
            animation: so-logo-spin 2.2s linear infinite;
        }
        html { background: #f8fafc; }
        @keyframes so-logo-spin { to { transform: rotate(360deg); } }

/* Keeps anchor targets (Journey, Mission, About) from landing underneath the
   sticky header when jumped to directly, e.g. index.php#mission-section from
   another page. Height matches the sticky nav's rendered height. */
#about-section, #journey-section, #mission-section {
    scroll-margin-top: 90px;
}

/* ---- Homepage-specific (from index.php) ---- */
/* Entrance animation used across sections for a richer, less static feel */
    .reveal-up {
        opacity: 0;
        transform: translateY(18px);
        animation: revealUp 0.6s ease-out forwards;
    }
    @keyframes revealUp {
        to { opacity: 1; transform: translateY(0); }
    }

    /* Hero carousel */
    .hero-carousel-shell {
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 20px 40px -16px rgba(11,20,64,0.35);
        margin: 1rem auto 0;
        max-width: 1400px;
    }
    .hero-slide { padding: 0; min-height: 0; line-height: 0; overflow: hidden; position: relative; }
    .hero-slide img { width: 100%; height: auto; max-height: 520px; object-fit: cover; }
    .hero-slide::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.25) 100%);
        pointer-events: none;
    }
    #heroCarousel .carousel-control-prev, #heroCarousel .carousel-control-next {
        width: 56px;
        height: 56px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        background: rgba(11,20,64,0.55);
        border-radius: 50%;
        opacity: 0.85;
        transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    }
    #heroCarousel .carousel-control-prev { left: 18px; }
    #heroCarousel .carousel-control-next { right: 18px; }
    #heroCarousel .carousel-control-prev:hover,
    #heroCarousel .carousel-control-next:hover {
        background: linear-gradient(135deg, #1e35d9, #007002);
        opacity: 1;
        transform: translateY(-50%) scale(1.06);
    }
    #heroCarousel .carousel-control-prev-icon,
    #heroCarousel .carousel-control-next-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    #heroCarousel .carousel-indicators { margin-bottom: 1rem; }
    #heroCarousel .carousel-indicators [data-bs-target] {
        box-sizing: border-box;
        background-color: #007002;
        width: 9px;
        height: 9px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        padding: 0;
        margin: 0 5px;
        opacity: 0.85;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
    #heroCarousel .carousel-indicators [data-bs-target].active {
        opacity: 1;
        transform: scale(1.15);
    }

    /* Mobile hero carousel: the desktop sizing (56px round arrows, height
       driven purely by the image's natural aspect ratio) doesn't hold up
       on small screens — arrows end up looking oversized relative to a
       narrow slide, and a very wide/short banner image can render at only
       a few pixels tall, making it look like the image "isn't there". Pin
       a sensible fixed height on mobile and shrink the controls to match. */
    @media (max-width: 576px) {
        .hero-carousel-shell {
            border-radius: 12px;
            margin-top: 0.5rem;
        }
        .hero-slide img {
            height: 200px;
            max-height: none;
            object-fit: cover;
            object-position: center;
        }
        #heroCarousel .carousel-control-prev,
        #heroCarousel .carousel-control-next {
            width: 34px;
            height: 34px;
        }
        #heroCarousel .carousel-control-prev { left: 8px; }
        #heroCarousel .carousel-control-next { right: 8px; }
        #heroCarousel .carousel-control-prev-icon,
        #heroCarousel .carousel-control-next-icon {
            width: 0.85rem;
            height: 0.85rem;
        }
        #heroCarousel .carousel-indicators {
            margin-bottom: 0.6rem;
        }
        #heroCarousel .carousel-indicators [data-bs-target] {
            width: 6px;
            height: 6px;
            margin: 0 3px;
        }
    }

    @media (min-width: 577px) and (max-width: 768px) {
        .hero-slide img {
            height: 280px;
            max-height: none;
            object-fit: cover;
        }
        #heroCarousel .carousel-control-prev,
        #heroCarousel .carousel-control-next {
            width: 42px;
            height: 42px;
        }
    }

    /* About section: highlight card + stat strip */
    .about-highlight-card {
        background: linear-gradient(150deg, #1e35d9 0%, #16279c 45%, #007002 100%);
        border-radius: 22px;
        padding: 2rem 1.75rem;
        box-shadow: 0 15px 30px -10px rgba(11,20,64,0.4);
        overflow: hidden;
    }
    .about-highlight-pattern {
        position: absolute;
        inset: 0;
        background-image:
            radial-gradient(circle at 15% 15%, rgba(255,255,255,0.10) 0, transparent 22%),
            radial-gradient(circle at 85% 25%, rgba(255,255,255,0.08) 0, transparent 25%),
            radial-gradient(circle at 25% 90%, rgba(255,255,255,0.08) 0, transparent 28%);
        pointer-events: none;
    }
    .about-highlight-card p { color: #fff !important; opacity: 0.9; }
    .about-highlight-card .text-warning { color: #ffc107 !important; }
    .about-stat-card {
        border-radius: 16px;
        padding: 1.75rem 1rem;
        text-align: center;
        box-shadow: 0 10px 20px -8px rgba(0,0,0,0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .about-stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 24px -8px rgba(0,0,0,0.14); }
    .about-stat-icon {
        display: flex; align-items: center; justify-content: center;
        width: 56px; height: 56px; margin: 0 auto 0.75rem;
        font-size: 1.5rem;
        box-shadow: 0 6px 14px -4px rgba(0,0,0,0.25);
        border-radius: 50%;
    }

    /* Mission section */
    .mission-card {
        padding: 1rem;
    }
    .mission-card--dark {
        background: linear-gradient(135deg, #0b1440 0%, #1e35d9 55%, #007002 100%);
        border-radius: 24px;
        padding: 2.25rem 2rem;
        overflow: hidden;
    }
    .mission-card-pattern {
        position: absolute;
        inset: 0;
        background-image:
            radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0, transparent 24%),
            radial-gradient(circle at 80% 80%, rgba(255,255,255,0.08) 0, transparent 26%);
        pointer-events: none;
    }
    .mission-text {
        font-family: inherit;
        font-size: 1.05rem;
        font-weight: 400;
        line-height: 1.7;
        max-width: 820px;
        margin-left: auto;
        margin-right: auto;
    }
    .mission-icon {
        width: 64px; height: 64px;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.75rem;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 50%;
    }

    /* Colorful brand cards */
    .brand-card {
        border-radius: 16px;
        padding: 2rem 1.25rem;
        box-shadow: 0 10px 20px -8px rgba(0,0,0,0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .brand-card:hover { transform: translateY(-6px); box-shadow: 0 16px 28px -8px rgba(0,0,0,0.18); }
    .brand-card-icon {
        display: flex; align-items: center; justify-content: center;
        width: 92px; height: 92px; margin: 0 auto 0.9rem;
        font-size: 1.9rem;
        box-shadow: 0 6px 14px -4px rgba(0,0,0,0.25);
        border-radius: 50%;
    }
    .brand-logo-img {
        width: 88%; height: 88%;
        object-fit: contain;
    }

    /* Colorful journey timeline cards */
    .journey-card {
        border-radius: 16px;
        padding: 1.75rem 1.5rem;
        box-shadow: 0 10px 20px -8px rgba(0,0,0,0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .journey-card:hover { transform: translateY(-6px); box-shadow: 0 16px 28px -8px rgba(0,0,0,0.18); }

    /* "View All Products" button */
    .view-more-btn {
        background: linear-gradient(135deg, #1e35d9, #007002);
        color: #ffffff;
        border: none;
        border-radius: 10px;
        padding: 0.65rem 1.1rem;
        font-weight: 600;
        box-shadow: 0 8px 18px -6px rgba(30,53,217,0.4);
        transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    }
    .view-more-btn:hover {
        color: #ffffff;
        transform: translateY(-1px);
        box-shadow: 0 10px 22px -6px rgba(30,53,217,0.5);
    }
    .view-more-btn:active,
    .view-more-btn:focus,
    .view-more-btn:focus-visible {
        color: #ffffff !important;
        background: linear-gradient(135deg, #1e35d9, #007002) !important;
        box-shadow: 0 0 0 3px rgba(30,53,217,0.25) !important;
        filter: brightness(0.95);
        outline: none;
    }