@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bs-primary: #2E7D32;
    /* Rich Organic Green */
    --bs-primary-dark: #1B5E20;
    --bs-secondary: #FBC02D;
    /* Golden Accent */
    --bs-body-bg: #FCFDFA;
    /* Creamy White */
    --bs-body-color: #2D3436;
    --bs-accent-bg: #F1F8E9;
    /* Soft Sage */
    --bs-dark-bg: #1A1C19;
    /* Deep Charcoal for Footer */
    --bs-border-radius: 20px;
}

.section {
    padding: 100px 0;
}

.bg-sage {
    background-color: var(--bs-accent-bg);
}

.text-primary-dark {
    color: var(--bs-primary-dark) !important;
}

.hover-lift {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12) !important;
}

.cta-box {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
    border: none;
    box-shadow: 0 20px 40px rgba(27, 94, 32, 0.2);
}

.footer-custom {
    background-color: var(--bs-dark-bg);
    border-top: 4px solid var(--bs-secondary);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-main {
    color: var(--bs-secondary);
    text-transform: uppercase;
    font-weight: 800;
}

.brand-sub {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
    display: block;
    line-height: 1;
    margin-top: 2px;
}

.navbar-nav .nav-link {
    color: #A5D6A7 !important;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
}

.navbar-nav .nav-link:hover {
    color: var(--bs-secondary) !important;
}

.navbar-nav .nav-link.active {
    color: #A5D6A7 !important;
    font-weight: 700;
}

/* Primary buttons */
.btn-success,
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    font-weight: 700;
    border-radius: 50px;
    padding: 0.6rem 2rem;
    transition: all 0.3s ease;
    text-transform: none;
    /* No all-caps by default */
}

.btn-success:hover {
    background-color: var(--bs-primary-dark);
    box-shadow: 0 10px 20px rgba(46, 125, 50, 0.3);
    transform: translateY(-2px);
}

.text-muted {
    color: #576574 !important;
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    border-radius: 50px;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: white;
}

/* Product Cards */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    background: #ffffff;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background-color: #e2e8f0;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.card-text {
    color: #64748b;
    font-size: 0.95rem;
}

.text-primary {
    color: var(--bs-primary) !important;
    font-weight: 800;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0A5E35 0%, #04C856 100%) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 25px rgba(4, 200, 86, 0.2);
}

.hero-section h1 {
    color: white;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9);
}

.cow-showcase-section {
    margin-top: -0.25rem;
    padding: 2rem 0 0;
}

.cow-gallery-frame {
    position: relative;
    max-width: 1380px;
    height: clamp(400px, 50vw, 750px);
    margin: 0 auto;
    padding: clamp(20px, 2vw, 40px);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(245, 255, 253, 0.96) 0%, rgba(255, 245, 252, 0.96) 100%),
        #ffffff;
    box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.06);
}

.cow-gallery-frame::before {
    content: "";
    position: absolute;
    inset: clamp(46px, 5vw, 74px) clamp(44px, 5vw, 86px);
    border: 5px solid #080808;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.cow-photo-animation {
    position: absolute;
    inset: clamp(76px, 6.6vw, 112px) clamp(28px, 4vw, 70px) clamp(94px, 8vw, 128px);
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.cow-photo-animation::before,
.cow-photo-animation::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    z-index: 20;
    pointer-events: none;
}

.cow-photo-animation::before {
    left: 0;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.cow-photo-animation::after {
    right: 0;
    background: linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
}

.cow-photo-frame {
    --photo-width: clamp(340px, 85vw, 1200px);
    --photo-height: clamp(300px, 42vw, 650px);
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: var(--photo-width);
    height: var(--photo-height);
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    opacity: 0;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
    transform: translate(-50%, -50%) scale(0.7);
    animation: cowStackCarousel calc(var(--cow-count) * 3.6s) linear infinite;
    animation-delay: calc(var(--cow-index) * -3.6s);
    will-change: transform, opacity;
}

.cow-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f8f9fa; /* Light background for gaps */
}

@keyframes cowStackCarousel {
    0% {
        z-index: 10;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    8% {
        z-index: 10;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    15% {
        z-index: 8;
        opacity: 0.92;
        transform: translate(-4%, -50%) scale(0.76);
    }
    22% {
        z-index: 6;
        opacity: 0.78;
        transform: translate(30%, -50%) scale(0.58);
    }
    30% {
        z-index: 4;
        opacity: 0.46;
        transform: translate(62%, -50%) scale(0.44);
    }
    38%,
    60% {
        opacity: 0;
        transform: translate(74%, -50%) scale(0.42);
    }
    68% {
        z-index: 4;
        opacity: 0.46;
        transform: translate(-162%, -50%) scale(0.44);
    }
    76% {
        z-index: 6;
        opacity: 0.78;
        transform: translate(-130%, -50%) scale(0.58);
    }
    88% {
        z-index: 8;
        opacity: 0.92;
        transform: translate(-96%, -50%) scale(0.76);
    }
    100% {
        z-index: 10;
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.cow-photo-animation:hover .cow-photo-frame {
    animation-play-state: paused;
}

.cow-carousel-dots {
    position: absolute;
    left: 50%;
    bottom: clamp(54px, 5.6vw, 82px);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transform: translateX(-50%);
}

.cow-carousel-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #080808;
    opacity: 0.9;
    animation: cowDotPulse calc(var(--cow-count) * 3.6s) linear infinite;
    animation-delay: calc(var(--dot-index) * -3.6s);
}

@keyframes cowDotPulse {
    0%,
    8%,
    100% {
        transform: scale(2.15);
        box-shadow: 0 0 0 3px #ffffff;
    }
    15%,
    92% {
        transform: scale(1);
        box-shadow: none;
    }
}

.btn-light {
    border-radius: 50px;
    font-weight: 700;
    color: #0A5E35;
    padding: 0.75rem 2rem;
}

/* Badges */
.badge.bg-warning {
    background-color: #fbbf24 !important;
    color: #78350f !important;
    border-radius: 50px;
    font-weight: 800;
    padding: 0.35em 0.6em;
}

/* Forms */
.form-control {
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    background-color: #f1f5f9;
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(4, 200, 86, 0.25);
    background-color: #ffffff;
}

.form-label {
    font-weight: 600;
    color: #475569;
}

/* Admin layout tweaks */
.table {
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

/* Cart Specific */
.checkout-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.order-summary {
    background-color: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
}

/* Username Truncation */
.nav-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--bs-primary-dark);
    color: white;
    transform: translateY(-5px);
}

/* Cross-links for Story/About/Team */
.internal-nav-link {
    transition: color 0.3s;
}

.internal-nav-link:hover {
    color: var(--bs-primary) !important;
}

/* Multi-line Truncation Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Brand Marquee Animation */
.brand-strip {
    background-color: #ffffff;
    z-index: 10;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.marquee-item {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-content:hover {
    animation-play-state: paused;
}

/* Walking Cow Animation */
.walking-cow {
    animation: walkAcross 20s linear infinite;
}

@keyframes walkAcross {
    0% { left: -50px; transform: translateY(-50%) rotateY(180deg); }
    45% { left: 100%; transform: translateY(-50%) rotateY(180deg); }
    50% { left: 100%; transform: translateY(-50%) rotateY(0deg); }
    95% { left: -50px; transform: translateY(-50%) rotateY(0deg); }
    100% { left: -50px; transform: translateY(-50%) rotateY(180deg); }
}

/* Hero Animations */
.animate-fade-up {
    animation: fadeUp 1s ease-out forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 1.5s ease-out forwards;
    opacity: 0;
}

.animate-bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    transform: scale(0);
}

.animate-flicker {
    animation: flicker 2s linear infinite;
}

.text-shadow-glow {
    text-shadow: 0 0 15px rgba(255, 193, 7, 0.5);
}

.leaf-1 { top: 10%; left: 5%; animation: float 6s ease-in-out infinite; font-size: 2rem; }
.leaf-2 { top: 30%; right: 10%; animation: float 8s ease-in-out infinite reverse; font-size: 1.5rem; }
.leaf-3 { bottom: 20%; left: 15%; animation: float 7s ease-in-out infinite; font-size: 1.8rem; }

.sun-glow {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(50%, -50%);
    animation: pulse 4s ease-in-out infinite;
}

.hover-lift:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    to { transform: scale(1); }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(10px, 20px) rotate(15deg); }
}

/* Filter Pills */
.filter-pill {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    background: #fff;
    color: #2d5a27;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(45, 90, 39, 0.1);
}

.filter-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(45, 90, 39, 0.15);
    color: #1b3d18;
    background: #f8fff7;
    border-color: #2d5a27;
}

.filter-pill.active {
    background: linear-gradient(135deg, #2d5a27, #1b3d18);
    color: #fff;
    border: none;
    box-shadow: 0 10px 20px rgba(45, 90, 39, 0.3);
}

.filter-pill i {
    transition: transform 0.3s ease;
}

.filter-pill:hover i {
    transform: scale(1.2) rotate(10deg);
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(50%, -50%) scale(1.1); }
}

@media (max-width: 767.98px) {
    .cow-gallery-frame {
        height: 420px;
        padding: 20px;
    }

    .cow-gallery-frame::before {
        inset: 46px 18px 42px;
        border-width: 4px;
        border-radius: 14px;
    }

    .cow-photo-animation {
        inset: 78px 8px 94px;
    }

    .cow-photo-frame {
        --photo-width: clamp(240px, 85vw, 380px);
        --photo-height: clamp(200px, 60vw, 320px);
    }

    .cow-photo-animation::before {
        width: 9%;
    }

    .cow-photo-animation::after {
        width: 9%;
    }

    .cow-carousel-dots {
        bottom: 58px;
        gap: 7px;
    }

    .cow-carousel-dots span {
        width: 6px;
        height: 6px;
    }

}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .cow-gallery-frame {
        height: clamp(340px, 46vw, 500px);
    }

    .cow-photo-frame {
        --photo-width: clamp(320px, 58vw, 680px);
        --photo-height: clamp(195px, 32vw, 340px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cow-photo-frame {
        animation: none;
        opacity: 0;
    }

    .cow-photo-frame:first-child {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .cow-carousel-dots span {
        animation: none;
    }

    .cow-carousel-dots span:first-child {
        transform: scale(2.15);
        box-shadow: 0 0 0 3px #ffffff;
    }
}
