/* ==========================================================================
   So Mate | Arte en madera (@so.mate.va)
   Diseño UX/UI & Front-End por Fanchin Web Lab
   Estética: Warm Artisanal / Modern Craft
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Paleta Warm Artisanal */
  --bg-cream: #FDFBF7;
  --bg-sand: #F7F4EE;
  --bg-warm-stone: #EFE8DD;
  --surface-card: #FFFFFF;
  
  --color-terracotta: #898F61;
  --color-terracotta-hover: #6E744A;
  --color-wood-dark: #3D261A;
  --color-wood-medium: #6D4833;
  --color-text-main: #2B2623;
  --color-text-muted: #6B625B;
  
  --color-olive: #898F61;
  --color-olive-dark: #5E643E;
  --color-olive-light: #EEF0E5;
  
  --color-clay: #898F61;
  --color-gold-warm: #D4A373;
  --color-gold-soft: #FAF3E0;

  --border-warm: #EADFD0;
  --border-light: rgba(137, 143, 97, 0.15);
  
  --shadow-sm: 0 2px 8px rgba(61, 38, 26, 0.04);
  --shadow-md: 0 8px 24px rgba(61, 38, 26, 0.08);
  --shadow-lg: 0 16px 40px rgba(61, 38, 26, 0.12);
}

/* Reset y Base */
html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-cream);
  color: var(--color-text-main);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-cream);
  overflow-x: hidden;
  position: relative;
}

/* Sutil textura orgánica de fondo tipo papel lino / fibra */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* Tipografía */
.font-serif {
  font-family: var(--font-serif);
}

.font-sans {
  font-family: var(--font-sans);
}

/* Scrollbar Personalizado Cálido */
::-webkit-scrollbar {
  width: 9px;
}

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

::-webkit-scrollbar-thumb {
  background: #C4B1A0;
  border-radius: 6px;
  border: 2px solid #F7F4EE;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-terracotta);
}

/* Animaciones sutiles */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(96, 108, 56, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(96, 108, 56, 0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Botones & Componentes */
.btn-primary {
  background-color: var(--color-terracotta);
  color: #FFFFFF;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background-color: var(--color-terracotta-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(137, 143, 97, 0.35);
}

.btn-whatsapp {
  background-color: #25D366;
  color: #FFFFFF;
  transition: all 0.25s ease;
}

.btn-whatsapp:hover {
  background-color: #20BA5A;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

.btn-secondary {
  background-color: var(--bg-warm-stone);
  color: var(--color-wood-dark);
  border: 1px solid var(--border-warm);
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  background-color: #E2D7C7;
  color: var(--color-wood-dark);
}

/* Tarjetas de Producto */
.product-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border-warm);
  background-color: #FFFFFF;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(137, 143, 97, 0.35);
}

.product-image-container {
  aspect-ratio: 4 / 4.3;
  overflow: hidden;
  position: relative;
  background-color: #F5EFE6;
}

.product-image-container img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-image-container img {
  transform: scale(1.06);
}

/* Badges de Producto */
.badge-hot {
  background-color: #FFF2E8;
  color: #B24800;
  border: 1px solid #FFD8BA;
}

.badge-limited {
  background-color: #F4EFEB;
  color: #6D4833;
  border: 1px solid #DBC9BC;
}

.badge-custom {
  background-color: #EBF0DE;
  color: #384C12;
  border: 1px solid #C4D9A4;
}

.badge-feature {
  background-color: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
}

/* Dialog Nativo con closedby y Backdrop Moderno */
dialog[closedby] {
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(92vw, 680px);
  width: 100%;
}

dialog::backdrop {
  background-color: rgba(43, 38, 35, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Dialog Animation */
dialog[open] {
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Banner de Fanchin Web Lab Pitch */
.pitch-banner {
  background: linear-gradient(135deg, #2B2623 0%, #3D261A 100%);
  color: #F7F4EE;
  border-top: 1px solid rgba(212, 163, 115, 0.3);
}

/* Floating WhatsApp Button */
.whatsapp-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #25D366;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.whatsapp-float-btn:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.5);
  color: #FFFFFF;
}

@media (max-width: 640px) {
  .whatsapp-float-btn span {
    display: none;
  }
  .whatsapp-float-btn {
    padding: 14px;
    bottom: 20px;
    right: 20px;
  }
}
