/* ============================================
   Mercadito Chapin Eterna Primavera
   Custom Styles
   ============================================ */

/* --- Custom Properties --- */
:root {
    --burgundy-700: #800020;
    --burgundy-950: #2d0009;
    --blush-300: #f4c2c2;
    --cream: #FDF8F4;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Navigation --- */
#navbar {
    background: rgba(253, 248, 244, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(128, 0, 32, 0.08);
}

#navbar.scrolled {
    background: rgba(253, 248, 244, 0.95);
    box-shadow: 0 4px 30px rgba(128, 0, 32, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--burgundy-700);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu */
#mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.active .mobile-link {
    animation: fadeUp 0.4s ease forwards;
}

#mobile-menu .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* Hamburger animation */
.menu-line {
    transition: all 0.3s ease;
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-btn.active .menu-line:nth-child(3) {
    width: 20px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* --- Hero Section --- */
.hero-shape {
    position: absolute;
    pointer-events: none;
}

.shape-circle-1 {
    top: 10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 194, 194, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.shape-circle-2 {
    bottom: 5%;
    right: 5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(128, 0, 32, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
}

.shape-rect-1 {
    top: 20%;
    right: 3%;
    width: 80px;
    height: 80px;
    background: rgba(128, 0, 32, 0.06);
    border-radius: 20px;
    transform: rotate(45deg);
    animation: spin-slow 20s linear infinite;
}

.shape-triangle {
    bottom: 25%;
    left: 5%;
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid rgba(244, 194, 194, 0.2);
    animation: float 6s ease-in-out infinite;
}

.shape-dots {
    top: 40%;
    left: 48%;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(circle, rgba(128, 0, 32, 0.1) 2px, transparent 2px);
    background-size: 16px 16px;
    opacity: 0.6;
    animation: float 7s ease-in-out infinite reverse;
}

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

@keyframes spin-slow {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

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

.hero-badge span:first-child {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* Hero content animations */
#hero > .max-w-7xl > div > div:first-child > div:first-child {
    animation: slideInLeft 0.8s ease 0.2s both;
}

#hero > .max-w-7xl > div > div:first-child > div:nth-child(2) {
    animation: slideInLeft 0.8s ease 0.35s both;
}

#hero > .max-w-7xl > div > div:first-child > div:nth-child(3) {
    animation: slideInLeft 0.8s ease 0.5s both;
}

#hero > .max-w-7xl > div > div:first-child > div:nth-child(4) {
    animation: slideInLeft 0.8s ease 0.65s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Product Cards --- */
.product-card {
    transform-style: preserve-3d;
}

/* --- Feature Cards --- */
.feature-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section Headings --- */
section h2 {
    position: relative;
}

/* --- Scroll Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Back to Top --- */
#back-to-top.active {
    opacity: 1;
    pointer-events: all;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .shape-circle-1 {
        width: 250px;
        height: 250px;
    }
    
    .shape-circle-2 {
        width: 180px;
        height: 180px;
    }
    
    .shape-rect-1 {
        width: 50px;
        height: 50px;
    }
    
    .shape-triangle {
        display: none;
    }
}

@media (max-width: 640px) {
    html {
        scroll-padding-top: 70px;
    }
}

/* --- Selection --- */
::selection {
    background: rgba(128, 0, 32, 0.15);
    color: var(--burgundy-950);
}

/* --- Focus styles --- */
:focus-visible {
    outline: 2px solid var(--burgundy-700);
    outline-offset: 2px;
}

/* --- Print --- */
@media print {
    #navbar, #back-to-top, .hero-shape {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
