/* ============================================
   KANNIKA EXPRESS GROCERY — CUSTOM STYLES
   ============================================ */

/* --- Custom Properties --- */
:root {
    --burgundy-800: #7B2D3B;
    --burgundy-950: #3a0d14;
    --blush-50: #fff8f6;
    --blush-200: #ffe0d4;
    --blush-300: #ffc5ab;
    --blush-400: #ffa177;
    --blush-500: #ff7847;
    --blush-600: #f5501c;
    --neutral-900: #0f0f1a;
    --neutral-850: #1a1a2e;
}

/* --- Base & Resets --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Navbar --- */
#navbar {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
    background: rgba(255, 248, 246, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(123, 45, 59, 0.08);
}

#navbar.dark-mode {
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

#navbar.scrolled #nav-logo-text,
#navbar.dark-mode #nav-logo-text {
    color: #7B2D3B;
}

#navbar.scrolled #nav-sub-text,
#navbar.dark-mode #nav-sub-text {
    color: #a51233;
}

.nav-link {
    color: rgba(123, 45, 59, 0.7);
    position: relative;
}

#navbar.dark-mode .nav-link {
    color: rgba(255, 255, 255, 0.7);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7B2D3B, #ff7847);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

.nav-link:hover {
    color: #7B2D3B;
}

#navbar.dark-mode .nav-link:hover {
    color: #ffc5ab;
}

/* Mobile nav links */
.mobile-nav-link {
    border-left: 3px solid transparent;
}

.mobile-nav-link:hover {
    border-left-color: #7B2D3B;
    padding-left: 1rem;
}

/* --- Hero --- */
.hero-badge {
    opacity: 0;
    animation: fadeInDown 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-title {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.4s;
}

.hero-subtitle {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.6s;
}

.hero-cta {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.8s;
}

.hero-scroll {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 1.2s;
}

.hero-decor {
    opacity: 0;
    animation: floatIn 1.5s ease forwards;
}

.hero-decor-1 { animation-delay: 0.5s; }
.hero-decor-2 { animation-delay: 0.8s; }
.hero-decor-3 { animation-delay: 1.1s; }

/* --- Section Headers --- */
.section-tag {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-title {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.section-subtitle {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

/* --- Feature Items --- */
.feature-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* --- Product Cards --- */
.product-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* --- About Section --- */
.about-images {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-content {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-feature {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* --- Community Section --- */
.community-content {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.community-images {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.community-stat {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* --- Contact Section --- */
.contact-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-form-wrapper {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* --- Footer --- */
footer > div > div:first-child > div > div {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* --- Scroll Reveal (Above-the-fold content is NOT hidden) --- */
/* All hero animations use CSS keyframes (not opacity:0 defaults) so they render immediately */

/* Scroll-triggered reveals for below-the-fold content */
.reveal-active .section-tag {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .section-title {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .section-subtitle {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .feature-item {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .product-card {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .about-images {
    opacity: 1;
    transform: translateX(0);
}

.reveal-active .about-content {
    opacity: 1;
    transform: translateX(0);
}

.reveal-active .about-feature {
    opacity: 1;
    transform: translateX(0);
}

.reveal-active .community-content {
    opacity: 1;
    transform: translateX(0);
}

.reveal-active .community-images {
    opacity: 1;
    transform: translateX(0);
}

.reveal-active .community-stat {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .contact-card {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active .contact-form-wrapper {
    opacity: 1;
    transform: translateY(0);
}

.reveal-active footer > div > div:first-child > div > div {
    opacity: 1;
    transform: translateY(0);
}

/* --- Keyframes --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* --- Back to Top --- */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal-active .section-tag,
    .reveal-active .section-title,
    .reveal-active .section-subtitle,
    .reveal-active .feature-item,
    .reveal-active .product-card,
    .reveal-active .about-images,
    .reveal-active .about-content,
    .reveal-active .about-feature,
    .reveal-active .community-content,
    .reveal-active .community-images,
    .reveal-active .community-stat,
    .reveal-active .contact-card,
    .reveal-active .contact-form-wrapper {
        opacity: 1;
        transform: none;
    }
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #7B2D3B;
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Selection --- */
::selection {
    background: #7B2D3B;
    color: #fff8f6;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #7B2D3B;
}
