/* ============================================
   KANNAMMAL AGRO — Living Earth Design System
   ============================================ */

/* ---------- Base Styles ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

::selection {
    background: #2D6A4F;
    color: #FEFAE0;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9990;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ---------- Preloader ---------- */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

#preloader.loaded {
    opacity: 0;
    pointer-events: none;
}

/* ---------- Custom Cursor ---------- */
#custom-cursor {
    transform: translate(-50%, -50%);
    mix-blend-mode: multiply;
    transition: width 0.2s, height 0.2s;
}

/* ---------- Navigation ---------- */
#navbar {
    background: transparent;
}

/* Default (transparent bg) — white text for visibility over dark hero */
.nav-logo-text {
    color: #FFFFFF;
}
.nav-logo-sub {
    color: rgba(255, 255, 255, 0.85);
}

#navbar.scrolled {
    background: rgba(254, 250, 224, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .nav-logo-text {
    color: #283618;
}
#navbar.scrolled .nav-logo-sub {
    color: #2D6A4F;
}
#navbar.scrolled .nav-link {
    color: #283618;
}
#navbar.scrolled .nav-link:hover {
    color: #2D6A4F;
    background: rgba(45, 106, 79, 0.06);
}
#navbar.scrolled .nav-link.active {
    color: #2D6A4F;
}
#navbar.scrolled .nav-link::after {
    background: #2D6A4F;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 50%;
    width: 0;
    height: 2px;
    background: #FFFFFF;
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 50%;
}

.nav-link:hover {
    color: #FEFAE0;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #FFFFFF;
    font-weight: 600;
}

.nav-link-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #FEFAE0;
    background: linear-gradient(135deg, #2D6A4F, #1B4332);
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.3);
}

.nav-link-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 106, 79, 0.4);
}

/* Hamburger */
.hamburger-line {
    display: block;
    position: absolute;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-line.top { transform: translateY(-6px); }
.hamburger-line.middle {}
.hamburger-line.bottom { transform: translateY(6px); }

#mobile-menu-btn.active .hamburger-line.top {
    transform: rotate(45deg);
}
#mobile-menu-btn.active .hamburger-line.middle {
    opacity: 0;
}
#mobile-menu-btn.active .hamburger-line.bottom {
    transform: rotate(-45deg);
}

#navbar.scrolled .nav-mobile-btn {
    background: rgba(45, 106, 79, 0.1);
    color: #2D6A4F;
}

/* ---------- Hero Section ---------- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(40, 54, 24, 0.85) 0%, rgba(45, 106, 79, 0.7) 50%, rgba(40, 54, 24, 0.8) 100%),
        url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?w=1920&q=80') center/cover no-repeat;
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(254, 250, 224, 0.3);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ---------- Section Styles ---------- */
.section-wave-top {
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    line-height: 0;
}

.section-wave-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    line-height: 0;
    transform: rotate(180deg);
}

.section-heading {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(45, 106, 79, 0.08);
    border: 1px solid rgba(45, 106, 79, 0.15);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2D6A4F;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

/* ---------- Product Cards ---------- */
.product-card {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(45, 106, 79, 0.08);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(40, 54, 24, 0.12);
    border-color: rgba(45, 106, 79, 0.15);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2D6A4F, #D4A373, #BC6C25);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.08);
}

.product-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #BC6C25, #D4A373);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---------- Category Cards ---------- */
.category-card {
    position: relative;
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(45, 106, 79, 0.08);
    overflow: hidden;
}

.category-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to top, rgba(45, 106, 79, 0.05), transparent);
    transition: height 0.3s ease;
}

.category-card:hover::after {
    height: 100%;
}

.category-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px rgba(40, 54, 24, 0.1);
}

.category-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.1), rgba(45, 106, 79, 0.05));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2D6A4F;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    background: #2D6A4F;
    color: #FEFAE0;
    transform: rotate(-5deg) scale(1.1);
}

/* ---------- Stat Counter ---------- */
.stat-card {
    position: relative;
    text-align: center;
    padding: 2rem;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(254, 250, 224, 0.2), transparent);
}

.stat-card:last-child::after {
    display: none;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #FEFAE0;
    line-height: 1;
}

/* ---------- Testimonial Swiper ---------- */
.testimonial-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    position: relative;
    border: 1px solid rgba(45, 106, 79, 0.08);
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    box-shadow: 0 15px 35px rgba(40, 54, 24, 0.08);
    border-color: rgba(45, 106, 79, 0.15);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    color: rgba(45, 106, 79, 0.06);
    line-height: 1;
}

.testimonial-stars {
    color: #D4A373;
}

/* ---------- Gallery ---------- */
.gallery-item {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(40, 54, 24, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* ---------- Timeline ---------- */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, #2D6A4F, #D4A373, transparent);
    transform: translateX(-50%);
}

.timeline-dot {
    width: 1rem;
    height: 1rem;
    background: #2D6A4F;
    border: 3px solid #FEFAE0;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #2D6A4F;
    z-index: 1;
}

/* ---------- Contact Form ---------- */
.form-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(254, 250, 224, 0.5);
    border: 2px solid rgba(45, 106, 79, 0.1);
    border-radius: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #1B1B1B;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #2D6A4F;
    background: white;
    box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.08);
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* ---------- Glassmorphism ---------- */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #2D6A4F, #1B4332);
    color: #FEFAE0;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.3);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(45, 106, 79, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: transparent;
    color: #FEFAE0;
    font-weight: 600;
    border-radius: 9999px;
    border: 2px solid rgba(254, 250, 224, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(254, 250, 224, 0.1);
    border-color: rgba(254, 250, 224, 0.7);
    transform: translateY(-2px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #2D6A4F;
    font-weight: 600;
    border-radius: 9999px;
    border: 2px solid #2D6A4F;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-outline:hover {
    background: #2D6A4F;
    color: #FEFAE0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(45, 106, 79, 0.3);
}

/* ---------- Footer ---------- */
.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(254, 250, 224, 0.08);
    color: rgba(254, 250, 224, 0.6);
    transition: all 0.3s ease;
}

.footer-social-link:hover {
    background: #2D6A4F;
    color: #FEFAE0;
    transform: translateY(-3px);
}

.footer-link {
    display: flex;
    align-items: center;
    color: rgba(254, 250, 224, 0.6);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #D4A373;
    transform: translateX(4px);
}

/* ---------- Organic Blob Shapes ---------- */
.blob-1 {
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    animation: blob-morph 8s ease-in-out infinite;
}

.blob-2 {
    border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
    animation: blob-morph 10s ease-in-out infinite reverse;
}

@keyframes blob-morph {
    0%, 100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; }
    25% { border-radius: 55% 45% 40% 60% / 55% 65% 35% 45%; }
    50% { border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
    75% { border-radius: 65% 35% 45% 55% / 50% 40% 60% 50%; }
}

/* ---------- Animations ---------- */
@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-slide-in-right {
    animation: slide-in-right 0.5s ease-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(45, 106, 79, 0.2); }
    50% { box-shadow: 0 0 40px rgba(45, 106, 79, 0.4); }
}

/* ---------- Page Header (for inner pages) ---------- */
.page-header {
    position: relative;
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #283618 0%, #2D6A4F 100%);
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5C30 5 42 15 40 27C38 37 22 37 20 27C18 15 30 5 30 5Z' fill='rgba(254,250,224,0.03)'/%3E%3C/svg%3E") repeat;
}

/* ---------- Filter Tabs ---------- */
.filter-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #283618;
    background: transparent;
    border: 1px solid rgba(45, 106, 79, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.filter-tab:hover {
    background: rgba(45, 106, 79, 0.08);
    border-color: #2D6A4F;
    color: #2D6A4F;
}

.filter-tab.active {
    background: #2D6A4F;
    color: #FEFAE0;
    border-color: #2D6A4F;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FEFAE0;
}

::-webkit-scrollbar-thumb {
    background: #2D6A4F;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1B4332;
}

/* ---------- Swiper Custom ---------- */
.swiper-pagination-bullet {
    background: #2D6A4F !important;
    opacity: 0.3 !important;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    transform: scale(1.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2rem;
    }

    .stat-card::after {
        display: none;
    }

    .timeline-line {
        left: 1rem;
    }

    .hero-section {
        min-height: 90vh;
    }
}

/* ---------- Product Placeholder ---------- */
.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #2D6A4F;
}

/* ---------- Team Card ---------- */
.team-card {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: white;
    border: 1px solid rgba(45, 106, 79, 0.08);
    transition: all 0.4s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(40, 54, 24, 0.1);
}

.team-card-photo {
    height: 280px;
    overflow: hidden;
    position: relative;
}

.team-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.team-card:hover .team-card-photo img {
    transform: scale(1.05);
}

.team-card-photo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(40, 54, 24, 0.6), transparent);
}

/* ---------- Loading Shimmer ---------- */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.shimmer {
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 104px;
}

/* ---------- Parallax ---------- */
.parallax-element {
    will-change: transform;
}

/* ---------- Leaf Decoration ---------- */
.leaf-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.06;
}

/* ---------- Map Container ---------- */
.map-container {
    border-radius: 1.5rem;
    overflow: hidden;
    border: 3px solid rgba(45, 106, 79, 0.1);
}

.map-container iframe {
    border: none;
    width: 100%;
    height: 100%;
}
