/* ==============================
   Variables globales
============================== */
:root {
  --accent: #c76a3b;
  --accent-hover: #a9542d;
  --muted: #f6f4f1;
  --text: #222;
  --bg: #fff;
  --bgs: #fff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
  --shadow: 0 6px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.18);

  --font-base: 'Poppins', sans-serif;
  --font-title: 'Playfair Display', serif;

  --transition: all .25s ease;

  --z-header: 1000;
  --z-overlay: 1100;
  --z-modal: 1500;
  --z-loader: 2000;
}

/* ==============================
   Reset & base
============================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible {
  outline: 3px solid rgba(199,106,59,.18);
  outline-offset: 3px;
}

/* ==============================
   Header & navegación
============================== */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: var(--z-header);
  box-shadow: var(--shadow-sm);
}
.logo { display: flex; gap: 12px; align-items: center; font-family: var(--font-title); }
.logo img { height: 52px; }
.menu-toggle {
  font-size: 26px;
  border: 0; cursor: pointer; padding: 8px; margin-left: auto;
}

nav.desktop-nav { display: flex; gap: 14px; align-items: center; }
nav.desktop-nav a {
  margin: 0 8px; font-weight: 500; position: relative; padding: 6px 4px;
}
nav.desktop-nav a::after {
  content:""; position: absolute; left: 0; bottom: -6px;
  height: 2px; width: 0; background: var(--accent); transition: width .25s;
}
nav.desktop-nav a:hover::after,
nav.desktop-nav a:focus-visible::after { width: 100%; }

/* ==============================
   Botones
============================== */
.cta, button, .btn {
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: var(--radius);
  border: 0; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: var(--transition);
}
.cta:hover, button:hover, .btn:hover {
  background: var(--accent-hover); transform: translateY(-2px);
}
.btn-outline {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid #ddd; background: transparent;
}

/* ==============================
   Hero
============================== */
.hero {
  display: grid; grid-template-columns: 1fr; gap: 28px;
  padding: 48px 0; align-items: center;
}
.hero .copy h1 {
  font-family: var(--font-title);
  font-size: 36px; line-height: 1.15; margin-bottom: 12px;
}
.hero .copy p { color: #555; margin-bottom: 12px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.highlights { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.highlights > div {
  background: var(--bgs); padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid #eee; font-size: 14px;
}

/* ==============================
   Grid & cards
============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 12px;
}
.card {
  background: var(--bgs); padding: 0; border-radius: var(--radius);
  overflow: hidden; border: 1px solid #eee; box-shadow: var(--shadow);
}
.card img { width: 100%; height: 160px; object-fit: cover; }
.card .card-body { padding: 12px; }
.card p { color: #666; font-size: 14px; margin-top: 6px; }

/* ==============================
   Sections & animation
============================== */
section { padding: 48px 0;
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.product, #testimonios .card {
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.visible { opacity: 1!important; transform: translateY(0)!important; }
section h2 {
  font-family: var(--font-title);
  font-size: 26px; margin-bottom: 12px; position: relative;
}
section h2::after {
  content:""; display: block; width: 56px; height: 3px;
  background: var(--accent); margin-top: 8px;
}

/* ==============================
   Productos
============================== */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: 18px;
}
.product {
  position: relative;
  background: var(--bgs); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.discountb{
  position: absolute;
  top:10px;
  right: 10px;
  background-color: yellow;
  height: 72px;
  width: 72px;
  clip-path: polygon(50% 0%, 40% 17%, 30% 4%, 25% 23%, 11% 19%, 12% 39%, 0% 50%, 11% 59%, 10% 79%, 23% 75%, 30% 96%, 40% 82%, 50% 100%, 60% 82%, 70% 96%, 76% 76%, 89% 81%, 87% 63%, 100% 50%, 87% 38%, 88% 18%, 74% 23%, 70% 4%, 60% 18%
);
  animation: parpadeo 3s linear infinite; /* 1s de duración, infinita */
  /* Opcional: para compatibilidad con navegadores antiguos */
  -webkit-animation: parpadeo 3s linear infinite;
}
.discount{
  position: absolute;
  top:13px;
  right: 13px;
  background-color: red;
  color:#fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 66px;
  width:66px;
  clip-path: polygon(50% 0%, 40% 17%, 30% 4%, 25% 23%, 11% 19%, 12% 39%, 0% 50%, 11% 59%, 10% 79%, 23% 75%, 30% 96%, 40% 82%, 50% 100%, 60% 82%, 70% 96%, 76% 76%, 89% 81%, 87% 63%, 100% 50%, 87% 38%, 88% 18%, 74% 23%, 70% 4%, 60% 18%
);
  animation: parpadeo 3s linear infinite; /* 1s de duración, infinita */
  /* Opcional: para compatibilidad con navegadores antiguos */
  -webkit-animation: parpadeo 3s linear infinite;
}
.product img { height: 180px; object-fit: cover; }
.product .info { padding: 14px; flex: 1; }
.price { font-weight: 700; color: var(--accent); font-size: 16px; margin-top: 10px; }
@keyframes parpadeo {
  0% { opacity: 1; }   /* Visible al inicio */
  50% { opacity: 0; }  /* Invisible a mitad del ciclo */
  100% { opacity: 1; } /* Visible al final */
}

/* ==============================
   Formularios
============================== */
form { display: grid; gap: 10px; }
input, textarea, select {
  padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid #ddd; font-size: 15px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(199,106,59,.08);
  outline: none;
}

/* ==============================
   Testimonios & secciones pequeñas
============================== */
.catering-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.catering-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.form-box {
  background: var(--bgs); padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid #eee; box-shadow: 0 4px 12px rgba(0,0,0,.03);
}
.form-msg {
  display: none; margin-top: 10px; padding: 10px;
  border-radius: var(--radius-sm); background: #f0f8f6; color: #0b6f57;
}
.testimonials { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ==============================
   Footer
============================== */
.footer-content {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px; padding: 18px 0;
}

/* ==============================
   WhatsApp flotante
============================== */
.whatsapp {
  position: fixed; right: 18px; bottom: 18px;
  background: #25D366; border-radius: 50%;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-header);
}
.whatsapp a { color: #fff; font-weight: 700; }

/* ==============================
   Loader
============================== */
#loader {
  position: fixed; inset: 0;
  background: linear-gradient(135deg,var(--accent),var(--accent-hover));
  /*background-image: url("../../assets/4245965-fire.jpg");
  background-size: 100vw auto;
  background-position: 0px 0px;
  animation: fondo 6s infinite;*/
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-loader); transition: opacity .45s, visibility .45s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none;}
#loader img {
  width: 110px; animation: pulse 1.5s infinite;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.28));
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); opacity: .85; }
}

/* ==============================
   Modal
============================== */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: var(--z-modal); padding-top: 48px;
}
.modal .modal-content {
  background: var(--bgs); margin: 0 auto; border-radius: var(--radius);
  padding: 18px; max-width: 660px; position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
}
.modal .cerrar {
  position: absolute; top: 12px; right: 12px;
  background: none; border: 0; font-size: 22px; cursor: pointer;
}

/* ==============================
   Carrito + pestaña (corregido)
============================== */
#carrito-panel {
  position: fixed;
  right: -100%;
  bottom: 18px;
  width: 280px;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-header);
  transition: right .3s ease;
  display: flex;
  flex-direction: column;
}
#carrito-panel.active { right: 18px; }
#carrito-panel h3 { margin: 0 0 8px; }
#carrito-lista {
  list-style: none; padding: 0; margin: 0;
  overflow-y: auto;
}
#carrito-lista li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid #f1f1f1;
}
.qty-controls { display: flex; gap: 6px; }
.qty-btn {
  background: #eee; border: 0; padding: 6px 8px;
  border-radius: var(--radius-sm); cursor: pointer;
}
.qty-btn:hover { background: #ddd; }
#whatsapp-btn.disabled {
  pointer-events: none; opacity: .5; background: #9bdab0;
}

/* Pestaña flotante del carrito */
#carrito-tab {
  position: fixed;
  right: 0; top: 50%; transform: translateY(-50%);
  background: #c76a3b; color: #fff;
  display: none; /* oculta en desktop */
  align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  cursor: pointer; font-size: 14px;
  z-index: 1600;
}
#carrito-tab .cart-badge {
  display: inline-block; min-width: 18px; height: 18px;
  line-height: 18px; font-size: 12px; text-align: center;
  background: #fff; color: #000; border-radius: 50%;
  padding: 0 5px; box-shadow: var(--shadow-sm);
}

/* ==============================
   Toasts
============================== */
.toast {
  position: fixed; background: var(--accent); color: #fff;
  padding: 12px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); font-weight: 500;
  z-index: 3000; opacity: 0; transform: translateY(120%);
  transition: all .35s ease;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.center {
  bottom: 80px; left: 50%; transform: translateX(-50%) translateY(120%);
}
.toast.side {
  right: 78px; top: 50%; transform: translateY(-50%) translateX(100%);
}
.toast.side.visible { transform: translateY(-50%) translateX(0); }

/* ==============================
   Overlay & menú inferior móvil
============================== */
#overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: var(--z-overlay);
}
#overlay.active { opacity: 1; visibility: visible; }
#bottom-menu {
  position: fixed; left: 0; bottom: -100%; width: 100%;
  background: var(--bg); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px; box-shadow: 0 -8px 30px rgba(0,0,0,.12);
  transition: transform .25s ease, bottom .25s ease;
  z-index: calc(var(--z-overlay) + 2); will-change: transform;
}
#bottom-menu.active { bottom: 0; transform: none; }
#bottom-menu .menu-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px;
}
#bottom-menu a {
  display: block; padding: 12px; border-radius: var(--radius-sm);
  font-weight: 600;
}
#bottom-menu a:hover { background: var(--muted); }

/* Confirmación WhatsApp */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}
.confirm-box {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius);
  max-width: 340px;
  width: 90%;
  box-shadow: var(--shadow);
  text-align: center;
}
.confirm-box button {
  margin: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
.confirm-box .btn { background: var(--primary); color: #fff; }
.confirm-box .btn-outline { background: #eee; color: var(--dark); }

/* ==============================
   Responsive
============================== */
@media(max-width:767px){
  /* Carrito ocupa lateral derecho en mobile */
  #carrito-panel {
    top: 0; bottom: 0;
    height: 100%;
    width: 80%; max-width: 340px;
    border-radius: 0;
    right: -100%;
  }
  #carrito-panel.active { right: 0; }
  /* Pestaña visible en mobile */
  #carrito-tab { display: inline-flex; }
  .menu-toggle { display: block; }
  /* Nav de escritorio se oculta en móviles */
  nav.desktop-nav { display: none; }
}

@media(min-width:768px){
  .menu-toggle { display: none; }
  #bottom-menu { display: none; }
   /* Nav de escritorio se muestra en desktop */
  nav.desktop-nav {
    display: flex;
    gap: 24px; /* separa mejor los links */
    margin-left: auto; /* empuja el nav a la derecha del header */
  }

  .hero { grid-template-columns: 1fr 480px; }
  .catering-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .testimonials { grid-template-columns: 1fr 1fr; }
  .contact-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
  }

  #carrito-panel { width: 300px; }
  #carrito-tab { display: none; }
}

@media(min-width:1024px){
  .hero .copy h1 { font-size: 46px; }
  section h2 { font-size: 32px; }
  .products { grid-template-columns: repeat(3,1fr); }
  .testimonials { grid-template-columns: repeat(3,1fr); }
}
