/* ============================================
   GUFTER Chile — Custom Styles
   ============================================ */

:root {
    --color-brand: #facc15;
    --header-height: 52px;
}

@media (min-width: 640px) {
    :root {
        --header-height: 56px;
    }
}

/* ============================================
   BASE
   ============================================ */

html {
    scroll-behavior: smooth;
}

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

/* ============================================
   ANIMATIONS
   ============================================ */

.animate-fade {
    animation: fadeIn 0.45s ease-out;
}

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

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

/* ============================================
   MOBILE HAMBURGER MENU
   ============================================ */

#mobile-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobile-menu.menu-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#mobile-menu > button,
#mobile-menu > div {
    animation: slideDown 0.4s ease-out backwards;
}

#mobile-menu > button:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu > button:nth-child(2) { animation-delay: 0.12s; }
#mobile-menu > div:nth-child(3)    { animation-delay: 0.2s; }

/* Prevent body scroll when menu is open */
body.menu-is-open {
    overflow: hidden;
}

/* ============================================
   NAV ACTIVE STATE
   ============================================ */

.nav-link {
    position: relative;
    padding-bottom: 4px;
}

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

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

/* ============================================
   SCROLL TARGETS
   ============================================ */

#quienes-somos {
    scroll-margin-top: var(--header-height);
}

#catalogo {
    scroll-margin-top: var(--header-height);
}

/* ============================================
   PRODUCT IMAGES
   ============================================ */

img.product-img {
    image-rendering: -webkit-optimize-contrast;
}

/* ============================================
   FOCUS STYLES
   ============================================ */

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

/* ============================================
   HERO SECTION (mobile tweaks)
   ============================================ */

@media (max-width: 639px) {
    .hero-section {
        min-height: 340px;
        height: auto;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* ============================================
   CARD HOVER EFFECTS (enhanced)
   ============================================ */

.card-category {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-category:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card-product {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-product:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

/* ============================================
   CTA BUTTONS (enhanced)
   ============================================ */

.cta-whatsapp {
    position: relative;
    overflow: hidden;
}

.cta-whatsapp::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.cta-whatsapp:hover::after {
    left: 100%;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .animate-fade { animation: none; }
    #mobile-menu { transition: none; }
    #mobile-menu > button,
    #mobile-menu > div { animation: none; }
    .card-category,
    .card-product { transition: none; }
    .cta-whatsapp::after { display: none; }
    .nav-link::after { transition: none; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    footer,
    #mobile-menu,
    .no-print { display: none !important; }
    body { background: white !important; color: black !important; }
    main { padding: 1rem; }
    img { max-width: 300px; }
}
