:root {
  --cream: #fbf6e9;
  --cream-deep: #f3ead0;
  --paper: #ffffff;
  --paper-warm: #fdf9ec;
  --ink: #1a2e0e;
  --ink-soft: #4a5d3a;
  --leaf: #7cb342;
  --leaf-deep: #5a8a2c;
  --leaf-dark: #3a6b1f;
  --gold: #f5a623;
  --gold-deep: #d68910;
  --citrus: #ffd54a;
  --shadow: rgba(26, 46, 14, 0.1);
  --shadow-lg: rgba(26, 46, 14, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* TOP BAR */
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  border-bottom: 1px solid rgba(26, 46, 14, 0.08);
  background: var(--paper-warm);
}
.delivery-zones-outside {
  background: linear-gradient(135deg, var(--leaf-dark) 0%, var(--leaf-deep) 100%);
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(58, 107, 31, 0.25);
}

.delivery-zones-outside .delivery-zones-text {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 800;
  color: white;
  display: block;
  margin-top: 8px;
}

.delivery-zones-outside .delivery-zones-icon {
  font-size: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-logo {
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.tag {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--leaf-deep);
  font-weight: 700;
}

/* LAYOUT PRINCIPAL */
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* COLUMNA CONSTRUCTOR */
.builder {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* COLUMNA DERECHA (carrito + banner) */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* RECETAS */
.recipes-section {
  background: linear-gradient(135deg, var(--paper) 0%, var(--cream) 100%);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(124, 179, 66, 0.3);
  box-shadow: 0 2px 8px var(--shadow);
}
.recipes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  cursor: pointer;
}
.recipes-title {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--leaf-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.recipes-toggle {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--leaf);
}
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}
.recipes-grid.collapsed {
  display: none;
}
.recipe-card {
  background: var(--paper);
  border: 1px solid rgba(124, 179, 66, 0.3);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.recipe-card:hover {
  background: var(--leaf);
  border-color: var(--leaf-dark);
  transform: translateY(-2px);
}
.recipe-card:hover .recipe-name {
  color: white;
}
.recipe-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
  box-shadow: 0 2px 8px var(--shadow);
}
.recipe-card:hover .recipe-image {
  transform: scale(1.05);
  transition: transform 0.2s;
}
.recipe-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
}
.recipe-price {
  font-size: 12px;
  color: var(--gold-deep);
  font-weight: 600;
}
.recipe-card:hover .recipe-price {
  color: var(--gold);
}
.recipe-desc {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.add-recipe-hint {
  text-align: center;
  padding: 20px;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 13px;
}

/* SELECTOR */
.selector {
  background: var(--paper);
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(26, 46, 14, 0.08);
  box-shadow: 0 4px 14px var(--shadow);
}
.block + .block { margin-top: 14px; }
.block-label {
  display: block;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  color: var(--leaf-dark);
  margin-bottom: 8px;
}

/* Contenedor de tipos de producto con imagen */
.product-types-wrapper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.product-type-card {
  flex: 1;
  min-width: 130px;
  background: transparent;
  border: 1.5px solid rgba(26, 46, 14, 0.15);
  border-radius: 16px;
  padding: 12px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.product-type-card.active {
  background: var(--leaf-dark);
  border-color: var(--leaf-dark);
  color: white;
}
.product-type-card img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
}
.product-type-card span {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

/* Selector de tamaños con precio */
.seg {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border: 1.5px solid rgba(26, 46, 14, 0.15);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
  min-width: 80px;
}
.size-btn:hover {
  border-color: var(--leaf);
  background: var(--cream);
}
.size-btn.active {
  background: var(--leaf-dark);
  color: var(--cream);
  border-color: var(--leaf-dark);
}
.size-name {
  font-size: 16px;
  font-weight: 700;
}
.size-price {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.8;
}
.size-btn.active .size-price {
  color: var(--gold);
}

/* INGREDIENTES */
.ingredients { display: flex; flex-direction: column; gap: 16px; }
.cat-block {
  background: var(--paper);
  border-radius: 18px;
  padding: 14px 14px 16px;
  border: 1px solid rgba(26, 46, 14, 0.08);
  box-shadow: 0 2px 8px var(--shadow);
}
.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(26, 46, 14, 0.15);
}
.cat-name {
  font-family: 'Fraunces', serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--leaf-dark);
}
.cat-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  background: var(--cream);
  padding: 3px 8px;
  border-radius: 999px;
}
.cat-count.full { color: white; background: var(--gold); }
.ing-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ing-chip {
  padding: 7px 12px;
  background: var(--cream);
  border: 1.5px solid rgba(26, 46, 14, 0.1);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ing-chip:hover {
  border-color: var(--leaf);
  background: white;
  transform: translateY(-1px);
}
.ing-chip.selected {
  background: var(--leaf);
  color: white;
  border-color: var(--leaf-deep);
  box-shadow: 0 2px 6px rgba(124, 179, 66, 0.4);
}
.ing-chip.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* PRECIO COMPACTO */
.price-tag-compact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: var(--ink);
  padding: 14px 18px;
  border-radius: 14px;
}
.price-tag-compact .price-label {
  color: var(--cream);
  font-size: 14px;
  font-weight: 500;
  font-style: italic;
}
.price-tag-compact .price-value {
  color: var(--gold);
  font-size: 28px;
  font-weight: 800;
}

/* BOTÓN AGREGAR */
.btn-add {
  background: var(--leaf-dark);
  color: white !important;
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-add span {
  color: white !important;
}
.btn-add:hover:not(:disabled) {
  background: var(--leaf-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 107, 31, 0.3);
}
.btn-add:disabled {
  background: #c0c0c0;
  cursor: not-allowed;
  color: #666 !important;
}
.btn-add:disabled span {
  color: #666 !important;
}

/* CARRITO */
.cart-panel {
  background: var(--paper);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(26, 46, 14, 0.08);
  box-shadow: 0 4px 14px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cream);
}
.cart-title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.cart-count {
  background: var(--leaf);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}
.cart-empty {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  padding: 30px 20px;
  font-size: 13px;
}
.cart-item {
  background: var(--cream);
  border-radius: 12px;
  padding: 12px;
  position: relative;
  border-left: 3px solid var(--leaf);
}
.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.cart-item-name {
  font-weight: 800;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  color: var(--ink);
}
.cart-item-price {
  font-weight: 700;
  color: var(--gold-deep);
  font-size: 14px;
}
.cart-item-desc {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  line-height: 1.4;
}
.cart-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 6px;
}
.cart-item-delete:hover {
  background: rgba(204, 51, 51, 0.1);
  color: #c33;
}
.cart-footer {
  border-top: 2px solid var(--cream);
  padding-top: 16px;
  margin-top: 8px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
}
.cart-total strong {
  font-size: 26px;
  color: var(--gold-deep);
  font-family: 'Fraunces', serif;
}
.btn-checkout {
  width: 100%;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-checkout:hover:not(:disabled) {
  background: var(--gold-deep);
  transform: translateY(-2px);
}
.btn-checkout:disabled {
  background: rgba(26, 46, 14, 0.15);
  cursor: not-allowed;
}

/* BANNER PROMOCIONAL (debajo del carrito) */
.promo-banner {
  background: var(--paper);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px var(--shadow);
}
.promo-banner:hover {
  transform: translateY(-2px);
}
.promo-banner a {
  text-decoration: none;
  display: block;
}
.promo-banner img {
  width: 100%;
  height: auto;
  display: block;
}
.promo-banner .banner-text {
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  background: var(--leaf-dark);
  color: white;
}

/* BANNER FUERA DE ZONA (arriba del todo) */
.out-of-area-banner {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 12px 20px;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.out-of-area-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.out-of-area-icon {
  font-size: 28px;
}
.out-of-area-content div {
  flex: 1;
}
.out-of-area-content strong {
  font-size: 16px;
  display: block;
}
.out-of-area-content p {
  font-size: 13px;
  margin: 4px 0 0;
  opacity: 0.9;
}
.out-of-area-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.out-of-area-close:hover {
  background: rgba(255,255,255,0.4);
}

/* DELIVERY */
.delivery {
  text-align: center;
  padding: 40px 20px 24px;
  position: relative;
  z-index: 1;
}
.delivery-text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--leaf-dark);
  margin-bottom: 16px;
}
.delivery-logos {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.delivery-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 80px;
  background: var(--paper);
  border: 1px solid rgba(26, 46, 14, 0.1);
  border-radius: 14px;
  padding: 12px 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px var(--shadow);
}
.delivery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px var(--shadow-lg);
}
.delivery-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.delivery-fallback {
  display: none;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--ink-soft);
  position: relative;
  z-index: 1;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 46, 14, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--cream);
  border-radius: 22px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(26, 46, 14, 0.08);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.modal-title {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}
.modal-summary {
  background: var(--paper-warm);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 13px;
}
.modal-summary h4 {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--leaf-deep);
  margin: 8px 0 4px;
  font-weight: 800;
}
.modal-summary h4:first-child { margin-top: 0; }
.modal-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 14px;
  margin-bottom: 16px;
  font-family: 'Fraunces', serif;
}
.modal-total span { font-style: italic; font-size: 14px; opacity: 0.8; }
.modal-total strong {
  font-size: 26px;
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.modal-form { display: flex; flex-direction: column; gap: 12px; }
.modal-form label { display: flex; flex-direction: column; gap: 4px; }
.modal-form label > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.modal-form input,
.modal-form textarea {
  padding: 10px 12px;
  border: 1.5px solid rgba(26, 46, 14, 0.15);
  border-radius: 10px;
  background: var(--paper-warm);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
}
.modal-form input:focus,
.modal-form textarea:focus {
  outline: none;
  border-color: var(--leaf);
}
.cta-confirm {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  background: var(--leaf-deep);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(58, 107, 31, 0.35);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .cart-panel {
    position: static;
    max-height: none;
  }
  .topbar { padding: 10px 18px; }
  .brand-logo { height: 44px; }
}