/*
 * Sistema de diseño de Dulce Horno — extraído literalmente del Design canvas
 * (ver sistema_de_diseno.md y pantallas_dulcehorno_completo.md). Sin
 * framework: el propio mockup está hecho con CSS plano, así que no hace
 * falta Tailwind ni un paso de build para reproducirlo tal cual.
 */

body {
  margin: 0;
  background: #FAF7F2;
  font-family: 'Work Sans', system-ui, sans-serif;
  color: #3E2723;
}

a { text-decoration: none; color: inherit; }

.wrap { max-width: 1440px; margin: 0 auto; box-sizing: border-box; }

.btn-amazon {
  display: inline-flex; align-items: center; gap: 8px;
  background: #D4AF37; color: #3E2723; font-weight: 600; font-size: 13.5px;
  padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
}
.btn-amazon.small { padding: 7px 14px; font-size: 12.5px; }
.btn-amazon:disabled { background: #E4D8C4; color: #75634C; cursor: not-allowed; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 6px; background: transparent;
  color: #3E2723; font-weight: 600; font-size: 14px; padding: 11px 4px; border: none; cursor: pointer;
}

.tag {
  font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  border: 1px solid #E4D8C4; color: #75634C;
}

.chip {
  font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 999px;
  background: #F1E6D6; color: #6B5842; border: none; cursor: pointer;
}
.chip.active { background: #3E2723; color: #FAF7F2; }

.card { background: #FFFFFF; border: 1px solid #F0E6D2; border-radius: 14px; position: relative; }

.pin-badge {
  position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 5px;
  background: #E60023; color: #fff; font-size: 11px; font-weight: 600; padding: 5px 10px 5px 8px; border-radius: 999px;
}

.stars { color: #D4AF37; letter-spacing: 1px; }

.divider { height: 1px; background: #F0E6D2; border: none; margin: 0; }

.scallop { position: relative; }
.scallop::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 16px;
  background-image: radial-gradient(circle at 8px 8px, transparent 8px, #FFFFFF 8.5px);
  background-size: 16px 16px; background-repeat: repeat-x;
}

.ticket { position: relative; background: #FFFFFF; border: 1px solid #F0E6D2; border-radius: 12px; }

.step-num {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid #E4D8C4;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  font-weight: 700; color: #75634C; flex-shrink: 0;
}

.page-btn {
  text-decoration: none; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid #F0E6D2; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #8B6F47;
}
.page-btn.active { background: #3E2723; color: #FAF7F2; border-color: #3E2723; }

header nav span.active { color: #D4AF37; border-bottom: 2px solid #D4AF37; padding-bottom: 4px; }

.status-banner {
  background: #F1E6D6; border-radius: 12px; padding: 14px 20px; margin: 20px 80px 0 80px;
  font-size: 13px; color: #6B5842;
}

@media (max-width: 900px) {
  header, section { padding-left: 24px !important; padding-right: 24px !important; }
}

.mega { position: relative; padding: 8px 0; }
.mega-trigger { display: inline-flex; align-items: center; gap: 4px; }
.mega.active .mega-trigger { color: #D4AF37; border-bottom: 2px solid #D4AF37; padding-bottom: 4px; }
.mega-panel {
  display: none; position: absolute; top: 100%; left: -60px; z-index: 60;
  width: 880px; padding: 28px; gap: 28px; background: #FFFFFF;
  border: 1px solid #F0E6D2; border-radius: 14px; box-shadow: 0 18px 40px rgba(62, 39, 35, 0.14);
}
.mega::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; }
.mega:hover .mega-panel, .mega:focus-within .mega-panel { display: flex; }
.mega-col { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.mega-col a { font-size: 14px; font-weight: 500; color: #3E2723; line-height: 1.35; }
.mega-col a:hover { color: #D4AF37; }
.mega-title {
  font-family: 'Fraunces', serif; font-size: 15px; font-weight: 700; color: #3E2723;
  padding-bottom: 8px; border-bottom: 1px solid #F0E6D2; margin-bottom: 4px;
}
.mega-all { font-weight: 700 !important; margin-top: 4px; }
.mega-photo {
  position: relative; width: 240px; flex-shrink: 0; border-radius: 12px; overflow: hidden;
  background: #EAC495; min-height: 200px; display: flex; align-items: flex-end;
}
.mega-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mega-photo span {
  position: relative; padding: 12px 14px; color: #FFFFFF; font-size: 13.5px; font-weight: 600;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  width: 100%; box-sizing: border-box;
}

.mega-photo span {
  position: relative; padding: 12px 14px; color: #FFFFFF; font-size: 13.5px; font-weight: 600;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  width: 100%; box-sizing: border-box;
}

.page-banner {
  height: 210px; overflow: hidden;
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  background-color: #C7772F;
  background-image:
    url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='white' stroke-width='1'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #C7772F 0%, #A9773F 100%);
  background-size: 100px 100px, 100% 100%;
  color: #FFFFFF;
}
.page-banner-text { position: relative; z-index: 1; padding: 0 24px; }
.page-banner h1 { margin: 0 0 10px 0; font-family: 'Fraunces', serif; font-size: 44px; font-weight: 700; line-height: 1.1; }
.page-banner p { margin: 0; font-size: 17px; opacity: 0.95; }

@media (max-width: 900px) {
  .page-banner { height: 160px; }
  .page-banner h1 { font-size: 32px; }
  .mega-panel { width: calc(100vw - 48px); left: -20px; flex-wrap: wrap; }
}

.img-placeholder {
  width: 100%; height: 100%;
  background-color: #EAC495;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='white' stroke-opacity='0.45' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, 286px); justify-content: center; gap: 28px; }
.recipe-card {
  width: 286px; max-width: 100%; display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.recipe-card:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(62, 39, 35, 0.16); }
.recipe-card-img { height: 200px; overflow: hidden; background: #EAC495; flex-shrink: 0; }
.recipe-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.recipe-card:hover .recipe-card-img img { transform: scale(1.06); }
.recipe-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

/* Portada: recetas populares en 4 columnas que ocupan todo el ancho (2 en tableta, 1 en móvil). */
.recipe-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); justify-content: stretch; gap: 24px; }
.recipe-grid--4 .recipe-card { width: auto; }
.recipe-grid--4 .recipe-card-img { height: 180px; }
@media (max-width: 900px) { .recipe-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .recipe-grid--4 { grid-template-columns: 1fr; } }

.btn-amazon, .chip, .page-btn, button {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.btn-amazon:not(:disabled):hover, .chip:hover, .page-btn:hover, button:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(62, 39, 35, 0.18);
}
.btn-outline { transition: transform 0.25s ease, color 0.25s ease; }
.btn-outline:hover { transform: translateY(-3px); color: #D4AF37; }

header nav a { display: inline-block; transition: transform 0.25s ease, color 0.25s ease; }
header nav a:hover { transform: translateY(-2px); color: #D4AF37; }
.mega-trigger { transition: transform 0.25s ease, color 0.25s ease; }
.mega-trigger:hover { transform: translateY(-2px); color: #D4AF37; }
.mega-col a { display: inline-block; transition: transform 0.25s ease, color 0.25s ease; }
.mega-col a:hover { transform: translateX(4px); }
.mega-photo img { transition: transform 0.45s ease; }
.mega-photo:hover img { transform: scale(1.06); }

/* ---------- Móvil (≤ 760 px) ----------
   Las vistas usan estilos en línea pensados para escritorio; estas clases los adaptan:
   m-row (fila → columna), m-full (ancho fijo → completo), m-box (márgenes de 80 px → 24 px),
   m-grid-1 / m-grid-2 (cuadrícula → 1 o 2 columnas), m-stats (datos que pasan a la línea siguiente). */
@media (max-width: 760px) {
  .m-row { flex-direction: column !important; align-items: stretch !important; gap: 24px !important; }
  .m-full { width: 100% !important; max-width: 100% !important; flex: none !important; box-sizing: border-box; }
  .m-hero-img { height: 220px !important; }
  .m-box { margin-left: 24px !important; margin-right: 24px !important; }
  .m-grid-1 { grid-template-columns: 1fr !important; }
  .m-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .m-stats { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px !important; }
  .m-stats > div[style*="width:1px"] { display: none; }
  .m-stats > div { padding: 0 !important; }
  .site-footer { padding-left: 24px !important; padding-right: 24px !important; }
  h1 { overflow-wrap: anywhere; }
  .m-row h1 { font-size: 34px !important; }
  .page-banner { height: auto !important; min-height: 140px; padding: 28px 0; box-sizing: border-box; }
  .page-banner h1 { font-size: 26px !important; }
  .page-banner p { font-size: 14px !important; }
}

/* ---------- Menú en móvil ---------- */
.nav-toggle { display: none; }
@media (max-width: 760px) {
  header { padding-top: 18px !important; padding-bottom: 18px !important; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1px solid #E4D8C4; border-radius: 10px; background: #FFFFFF; color: #3E2723; font-size: 20px; cursor: pointer;
  }
  .nav-toggle:hover { transform: none !important; box-shadow: none !important; }
  .nav-toggle-close, header.nav-open .nav-toggle-open { display: none; }
  header.nav-open .nav-toggle-close { display: inline; }

  header .site-nav { display: none !important; width: 100%; flex-direction: column; align-items: stretch !important; gap: 0 !important; font-size: 15px !important; }
  header.nav-open .site-nav { display: flex !important; }
  .site-nav > span, .site-nav > .mega { border-top: 1px solid #EEE3D2; }
  .site-nav > span > a, .site-nav .mega-trigger { display: flex !important; justify-content: space-between; width: 100%; padding: 14px 2px; box-sizing: border-box; }
  .site-nav a:hover, .site-nav .mega-trigger:hover { transform: none !important; }
  header nav span.active, .mega.active .mega-trigger { border-bottom: none !important; padding-bottom: 14px !important; }
  .mega { padding: 0; }
  .mega::after { display: none; }
  .mega:hover .mega-panel, .mega:focus-within .mega-panel { display: none; }
  .mega.open .mega-panel { display: flex !important; }
  .mega.open .mega-trigger span { transform: rotate(180deg); }
  .mega-panel {
    position: static !important; width: auto !important; left: auto !important; flex-direction: column; gap: 18px;
    padding: 4px 0 18px 12px; border: none; border-radius: 0; box-shadow: none; background: transparent;
  }
  .mega-col a { padding: 4px 0; }
  .mega-photo { display: none !important; }
  .site-nav form { width: 100%; margin: 12px 0 4px; }
  .site-nav form input { width: 100% !important; box-sizing: border-box; padding: 11px 12px !important; font-size: 15px !important; }

  /* Tarjetas de recetas a la mitad: 2 columnas, foto y textos más pequeños */
  .recipe-grid, .recipe-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; justify-content: stretch; }
  .recipe-card { width: auto !important; }
  .recipe-card-img, .recipe-grid--4 .recipe-card-img { height: 110px !important; }
  .recipe-card-body { padding: 10px 11px 12px !important; gap: 4px !important; }
  .recipe-card-body > span:first-child { font-size: 13.5px !important; }
  .recipe-card-body > span { font-size: 11.5px; }
  .recipe-card .scallop::after, .recipe-card.scallop::after { height: 10px; background-size: 10px 10px; }
}
