/* ===========================================
   BARA & CO - ESTILOS GLOBALES
   =========================================== */

/* ---------- VARIABLES GLOBALES ---------- */
:root {
    --color-bg: #FFFFFF;
    --color-bg-secondary: #F5F5F5;
    --color-text-primary: #0A0A0A;
    --color-text-secondary: #6B6B6B;
    --color-accent: #7C8C7D;
    --color-accent-light: rgba(124, 140, 125, 0.1);
    --color-border: #E0E0E0;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --container-max: 1440px;
    --border-radius: 4px;
    --transition-slow: all 0.8s cubic-bezier(0.65, 0, 0.35, 1);
    --transition-smooth: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ---------- RESET ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/*
  NOTA: body NO tiene background aquí.
  Cada página define su propio fondo (oscuro o claro).
  Esto evita que páginas oscuras (index, tienda, etc.)
  muestren franjas blancas por conflicto de estilos.
*/
body {
    font-family: var(--font-sans);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---------- TIPOGRAFÍA ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
a { text-decoration: none; color: inherit; }
img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* ---------- CONTAINER ---------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ---------- HEADER GLOBAL ----------
   SIN mix-blend-mode — causaba fondo blanco en páginas oscuras.
   SIN background blanco — cada página lo define en su propio <style>.
*/
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 2rem;
    transition: var(--transition-smooth);
    background: transparent;
    /* mix-blend-mode: ELIMINADO — rompía páginas oscuras */
}

header.scrolled {
    /* Solo en páginas claras (interior) este estilo aplica.
       Las páginas oscuras lo sobreescriben con !important en su propio CSS. */
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

/* Páginas CLARAS (interior): header scrolled blanco */
body.interior header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-text-primary);
}

.header-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-link {
    font-weight: 400;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: currentColor;
    transition: width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link.active { font-weight: 600; }

.header-icons {
    display: flex;
    gap: 1.5rem;
}

.header-icons i {
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.header-icons i:hover {
    transform: scale(1.1);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ---------- FOOTER GLOBAL ---------- */
footer {
    border-top: 1px solid rgba(255,255,255,.06);
}

/* Footer en páginas claras */
body.interior footer {
    background: var(--color-text-primary);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.footer-text { color: #AAAAAA; font-size: 0.95rem; margin-bottom: var(--spacing-sm); }
.footer-title { font-weight: 600; margin-bottom: var(--spacing-sm); font-size: 1.1rem; color: white; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: #AAAAAA; transition: var(--transition-smooth); }
.footer-links a:hover { color: white; }

.newsletter-input {
    display: flex;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
    margin-top: var(--spacing-sm);
}

.newsletter-input input {
    background: transparent; border: none; color: white;
    font-size: 1rem; width: 100%; padding: 0.5rem 0; outline: none;
}

.newsletter-input input::placeholder { color: #777; font-weight: 300; }

.newsletter-input button {
    background: transparent; border: none; color: white;
    font-size: 1.2rem; cursor: pointer; transition: var(--transition-smooth);
}

.newsletter-input button:hover { transform: translateX(5px); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid #222;
    color: #777;
    font-size: 0.85rem;
}

.legal-info { display: flex; gap: var(--spacing-md); }

.social-icons { display: flex; gap: var(--spacing-sm); }

.social-icons i {
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: #AAA;
}

.social-icons i:hover { color: white; transform: translateY(-3px); }

/* ---------- CARRITO FLOTANTE GLOBAL ---------- */
.cart-icon {
    position: fixed; bottom: 30px; right: 30px;
    width: 70px; height: 70px;
    background: var(--color-text-primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: var(--transition-bounce);
    border: 2px solid transparent;
}

.cart-icon:hover { transform: scale(1.1); background: var(--color-accent); border-color: white; }
.cart-icon i { color: white; font-size: 1.8rem; }

.cart-count {
    position: absolute; top: -5px; right: -5px;
    background: var(--color-accent); color: white;
    width: 25px; height: 25px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; border: 2px solid white;
}

/*
  cart-panel: SIN fondo blanco hardcodeado.
  Las páginas oscuras definen su propio background en su CSS.
  Las páginas claras (interior) lo heredan de aquí.
*/
.cart-panel {
    position: fixed;
    top: 0; right: -500px;
    width: min(450px, 100%);
    height: 100vh;
    z-index: 1001;
    transition: right 0.4s cubic-bezier(.16,1,.3,1);
    display: flex;
    flex-direction: column;
}

body.interior .cart-panel { background: white; box-shadow: -10px 0 40px rgba(0,0,0,0.05); padding: 30px; }

.cart-panel.open { right: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.cart-title { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 600; }

.close-cart { font-size: 1.5rem; cursor: pointer; transition: transform 0.3s; background: none; border: none; }
.close-cart:hover { transform: rotate(90deg); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    animation: slideIn 0.3s ease;
}

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

.item-image { width: 76px; height: 96px; overflow: hidden; flex-shrink: 0; }
.item-image img { width: 100%; height: 100%; object-fit: cover; }
.item-details h4 { font-weight: 600; margin-bottom: 5px; }
.item-details p { color: var(--color-text-secondary); font-size: 0.9rem; }

.item-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.item-quantity { display: flex; align-items: center; gap: 10px; }

.qty-btn {
    width: 30px; height: 30px;
    border: 1px solid #ddd; background: white;
    cursor: pointer; transition: all 0.2s;
}
.qty-btn:hover { background: var(--color-text-primary); color: white; border-color: var(--color-text-primary); }

.remove-item { color: #999; cursor: pointer; font-size: 0.9rem; transition: color 0.2s; background: none; border: none; }
.remove-item:hover { color: #ff4444; }

.cart-footer { margin-top: 30px; padding-top: 20px; }

.subtotal { display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 1.2rem; font-weight: 600; }

.checkout-btn {
    width: 100%; padding: 18px;
    background: var(--color-text-primary); color: white;
    border: none; font-weight: 600; letter-spacing: 2px;
    text-transform: uppercase; cursor: pointer;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.checkout-btn:hover { background: var(--color-accent); transform: translateY(-2px); }

/* Toast notificación */
.cart-notification {
    position: fixed; bottom: 90px; right: 24px;
    padding: 13px 20px; border-radius: 6px;
    display: flex; align-items: center; gap: 10px; max-width: 280px;
    transform: translateX(120%); opacity: 0;
    transition: transform 0.4s cubic-bezier(.16,1,.3,1), opacity 0.4s;
    z-index: 1100; box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.cart-notification.show { transform: translateX(0); opacity: 1; }

.overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden;
    transition: all 0.3s; z-index: 1000;
    backdrop-filter: blur(5px);
}
.overlay.active { opacity: 1; visibility: visible; }

/* ---------- CURSOR PERSONALIZADO ---------- */
.custom-cursor {
    width: 40px; height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .3s, height .3s, background .3s, border .3s;
    opacity: 0; backdrop-filter: blur(4px);
}
.custom-cursor.active { width: 60px; height: 60px; background: rgba(124, 140, 125, 0.1); border: 1px solid var(--color-accent); }

.cursor-dot {
    width: 8px; height: 8px; background: white; border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width .2s, height .2s, background .2s;
    opacity: 0;
}
.cursor-dot.active { width: 12px; height: 12px; background: var(--color-accent); }

/* ---------- BOTONES GLOBALES ---------- */
.btn {
    display: inline-block; padding: 16px 48px;
    background: var(--color-text-primary); color: white;
    font-weight: 500; letter-spacing: 2px; text-transform: uppercase;
    border: none; cursor: pointer; transition: var(--transition-smooth);
    font-size: 0.9rem; position: relative; overflow: hidden; z-index: 1;
}
.btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: var(--color-accent); transition: left 0.4s cubic-bezier(0.65, 0, 0.35, 1); z-index: -1; }
.btn:hover { color: white; transform: translateY(-3px); box-shadow: 0 20px 30px -10px rgba(0,0,0,0.2); }
.btn:hover::before { left: 0; }
.btn-secondary { background: transparent; color: var(--color-text-primary); border: 1px solid var(--color-text-primary); }
.btn-secondary:hover { background: var(--color-text-primary); color: white; }

/* ---------- ANIMACIONES ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }

.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s, transform 0.8s; }
.fade-up.revealed { opacity: 1; transform: translateY(0); }

/* ---------- WHATSAPP FLOAT ---------- */
.whatsapp-float {
    position: fixed; bottom: 28px; right: 28px; z-index: 400;
    width: 52px; height: 52px; border-radius: 50%;
    background: #25d366; border: none; cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 4px 20px rgba(37,211,102,.35);
    transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,.5); }
.whatsapp-float i { font-size: 22px; color: #fff; }
.whatsapp-tooltip {
    position: absolute; right: 70px;
    background: #131310; color: #ede9e1;
    padding: 8px 15px; border-radius: 30px; font-size: 0.8rem;
    white-space: nowrap; opacity: 0; pointer-events: none;
    transition: all 0.3s; border: 1px solid rgba(255,255,255,.06);
}
.whatsapp-float:hover .whatsapp-tooltip { opacity: 1; right: 80px; }

/* ---------- UTILIDADES ---------- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .cart-panel { width: min(400px, 100%); }
}

@media (max-width: 768px) {
    .container { padding: 0 var(--spacing-sm); }
    .nav-menu { display: none; position: absolute; top: 80px; left: 0; width: 100%; flex-direction: column; padding: 20px; }
    .nav-menu.show { display: flex; }
    .menu-toggle { display: block; }
    .header-icons { gap: 1rem; }
    .cart-panel { width: 100%; right: -100%; }
    .footer-grid { grid-template-columns: 1fr; gap: var(--spacing-lg); }
    .footer-bottom { flex-direction: column; gap: var(--spacing-sm); text-align: center; }
    .legal-info { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
    .logo { font-size: 1.5rem; }
    .cart-icon { width: 60px; height: 60px; bottom: 20px; right: 20px; }
    .cart-icon i { font-size: 1.5rem; }
}

/* Sin cursor custom en táctil */
@media (hover: none) and (pointer: coarse) {
    .custom-cursor, .cursor-dot, [class*="cursor"] { display: none !important; }
    body { cursor: auto !important; }
}
