/* ============================================================
   BakeryCloud - Tema "Kokoro"
   Colores inspirados en Kokoro Cakes (@kokorocakess):
   rosa empolvado, blanco rosado y frambuesa. Estilo coquette.
   ============================================================ */

:root {
  --crema:        #fff7f5;
  --beige:        #d9b8ac;
  --beige-hover:  #c9a294;
  --frambuesa:    #8a4a5e;
  --rosa:         #c0527a;
  --negro:        #2b2625;
  --blanco:       #ffffff;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Cormorant Garamond', Georgia, serif;
  --radius:       14px;
  --shadow:       0 10px 30px rgba(43, 38, 37, 0.10);
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--crema);
  color: var(--negro);
  font-size: 18px;
  line-height: 1.6;
}

/* ---------- Barra de anuncios ---------- */
.announcement-bar {
  background: var(--rosa);
  color: var(--blanco);
  text-align: center;
  padding: 10px 16px;
  font-size: 15px;
  letter-spacing: 0.05em;
}

/* ---------- Header / Nav ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 239, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(104, 20, 20, 0.12);
  transition: transform 0.3s ease;
}
.header.hide { transform: translateY(-100%); }

.nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  transition: padding 0.25s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-menu {
  display: none;
}

.nav-menu-head {
  display: none;
}

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  color: var(--rosa);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: font-size 0.25s ease;
}

.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rosa);
  flex-shrink: 0;
  transition: width 0.25s ease, height 0.25s ease;
}

.nav-link {
  color: var(--negro);
  text-decoration: none;
  font-size: 17px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--beige-hover); }

/* Overlay del menú lateral (drawer izquierdo, como el carrito) */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 90;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }

.cart-btn {
  background: none;
  border: 1px solid var(--frambuesa);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--frambuesa);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.cart-btn:hover { background: var(--frambuesa); color: var(--blanco); }

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--rosa);
  color: var(--blanco);
  font-size: 12px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px;
}

.hero-eyebrow,
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 13px;
  color: var(--beige);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  font-weight: 400;
  margin-bottom: 18px;
}
.hero h1 em { color: var(--rosa); }

.hero-sub {
  font-size: 20px;
  color: #4a453e;
  max-width: 460px;
  margin-bottom: 28px;
}

.hero-image {
  height: 420px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), transparent 40%),
    radial-gradient(circle at 70% 60%, #e8a9c0, transparent 45%),
    radial-gradient(circle at 50% 80%, #c0527a, transparent 50%),
    linear-gradient(160deg, #f9e0e6, #ecb4c9);
  box-shadow: var(--shadow);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 17px;
  padding: 12px 26px;
  border-radius: 999px;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--rosa);
  color: var(--blanco);
}
.btn-primary:hover { background: #a63d63; transform: translateY(-2px); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--beige);
  color: var(--blanco);
  transform: none;
}
.btn-full { width: 100%; }

/* ---------- Secciones ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}
.section-head h2,
.nosotros h2 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 400;
}

.section-dark {
  background: var(--frambuesa);
  color: var(--blanco);
  max-width: none;
  border-radius: 0;
}
.section-dark .section-eyebrow { color: #cbc4b4; }

.nosotros {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  text-align: center;
}
.nosotros-text { max-width: 620px; font-size: 20px; }

/* ---------- Categorías ---------- */
.categorias {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.cat-chip {
  background: none;
  border: 1px solid var(--beige);
  border-radius: 999px;
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--frambuesa);
  cursor: pointer;
  transition: all 0.2s;
}
.cat-chip:hover { border-color: var(--rosa); color: var(--rosa); }
.cat-chip.active { background: var(--rosa); border-color: var(--rosa); color: var(--blanco); }
.cat-chip:active { transform: scale(0.93); }

/* ---------- Grid de productos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.card {
  background: var(--blanco);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 14px 34px rgba(43, 38, 37, 0.16); }

/* Animación de entrada escalonada al filtrar categorías */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card-in {
  animation: cardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.card-image {
  height: 180px;
  background: linear-gradient(150deg, #f7d6dd, #e8a9c0);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-cat {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--beige);
}

.card-name {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
}

.card-desc {
  font-size: 15px;
  color: #5a544c;
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.card-price { font-size: 20px; font-weight: 600; color: var(--rosa); }

.btn-add {
  background: var(--frambuesa);
  color: var(--blanco);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add:hover { background: var(--rosa); }

.card-soldout { opacity: 0.55; pointer-events: none; }

/* ---------- Contacto ---------- */
.contact-text { text-align: center; margin-bottom: 24px; font-size: 19px; }

.contact-form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 17px;
  padding: 12px 16px;
  border: 1px solid var(--beige);
  border-radius: 10px;
  background: var(--blanco);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--rosa); border-color: transparent; }

/* ---------- Footer ---------- */
.footer {
  background: var(--negro);
  color: #b9b2a6;
  text-align: center;
  padding: 28px 24px;
  font-size: 15px;
}

/* ---------- Drawer del carrito ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 90;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--crema);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.2);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(104,20,20,0.15);
}
.drawer-head h3 { font-family: var(--font-heading); font-size: 24px; font-weight: 600; }

.drawer-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: var(--rosa);
  cursor: pointer;
}

.drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-empty { text-align: center; color: var(--beige); margin-top: 40px; }

.drawer-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--blanco);
  border-radius: 10px;
  padding: 12px;
}

.drawer-item .di-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(150deg, #f7d6dd, #e8a9c0);
  flex-shrink: 0;
}

.drawer-item .di-info { flex: 1; }
.drawer-item .di-name { font-weight: 600; font-family: var(--font-heading); }
.drawer-item .di-price { font-size: 15px; color: var(--rosa); }

.di-qty { display: flex; align-items: center; gap: 8px; }
.di-qty button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--beige);
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--frambuesa);
}
.di-qty button:hover { background: var(--frambuesa); color: var(--blanco); }
.di-qty .qty { min-width: 20px; text-align: center; }

.di-remove {
  background: none;
  border: none;
  color: var(--rosa);
  cursor: pointer;
  font-size: 18px;
}

.drawer-foot {
  padding: 20px 24px;
  border-top: 1px solid rgba(104,20,20,0.15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 600;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkout-form input {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 11px 14px;
  border: 1px solid var(--beige);
  border-radius: 10px;
  background: var(--blanco);
}

.drawer-msg { text-align: center; font-size: 15px; color: var(--frambuesa); }
.drawer-msg.error { color: var(--rosa); }

/* ---------- Modal de detalle de producto ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 37, 0.55);
  backdrop-filter: blur(3px);
  z-index: 120;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(43, 38, 37, 0.35);
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  z-index: 125;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.modal.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  background: var(--blanco);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--frambuesa);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(43, 38, 37, 0.15);
}
.modal-close:hover { color: var(--rosa); }

.modal-image {
  height: 300px;
  background: linear-gradient(150deg, #f7d6dd, #e8a9c0);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-image img { width: 100%; height: 100%; object-fit: cover; }

.modal-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-cat {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rosa);
}

.modal-name {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 600;
  color: var(--negro);
  margin: 0;
}

.modal-desc {
  color: var(--frambuesa);
  font-size: 17px;
  line-height: 1.5;
  margin: 0;
}

.modal-ing-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--negro);
  margin: 6px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(104, 20, 20, 0.12);
}

.modal-ing {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-ing li {
  background: var(--crema);
  border: 1px solid var(--beige);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--frambuesa);
}

.modal-foot {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.modal-price {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 600;
  color: var(--rosa);
}
.modal-foot .btn { font-size: 16px; padding: 12px 26px; }

/* ---------- Configurador de tarta personalizada ---------- */
.modal-config { width: min(860px, calc(100vw - 40px)); }

.config-head {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(104, 20, 20, 0.12);
}
.config-head .modal-name { margin-top: 4px; }

.config-steps {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.config-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--beige);
  background: var(--crema);
  font-size: 14px;
  color: var(--beige-hover);
  cursor: pointer;
  transition: all 0.2s;
}
.config-step .num {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--beige);
  color: var(--blanco);
}
.config-step.done { color: var(--frambuesa); border-color: var(--rosa); }
.config-step.done .num { background: var(--rosa); }
.config-step.active { background: var(--rosa); border-color: var(--rosa); color: var(--blanco); }
.config-step.active .num { background: var(--blanco); color: var(--rosa); }
.config-step:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.config-body {
  padding: 24px 28px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
}
.config-step-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--negro);
  margin: 0 0 4px;
}
.config-step-hint {
  color: var(--beige-hover);
  font-size: 15px;
  margin: 0 0 18px;
}

.config-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.config-option {
  text-align: left;
  background: var(--crema);
  border: 1.5px solid var(--beige);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
}
.config-option:hover { border-color: var(--rosa); }
.config-option.selected {
  border-color: var(--rosa);
  background: #fdeef3;
  box-shadow: 0 0 0 1px var(--rosa);
}
.config-option .opt-name { display: block; font-size: 16px; font-weight: 600; color: var(--negro); }
.config-option .opt-desc { display: block; font-size: 13.5px; color: var(--beige-hover); margin-top: 2px; line-height: 1.35; }
.config-option .opt-price { display: block; font-size: 14px; color: var(--rosa); margin-top: 6px; font-weight: 600; }
.config-option .opt-price.gratis { color: var(--beige-hover); font-weight: 400; }

.config-foot {
  border-top: 1px solid rgba(104, 20, 20, 0.12);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.config-resumen { font-size: 15px; color: var(--frambuesa); line-height: 1.5; }
.config-resumen strong { color: var(--rosa); font-size: 22px; font-family: var(--font-heading); }

.config-nav { display: flex; gap: 10px; }
.btn-ghost {
  background: none;
  border: 1.5px solid var(--beige);
  color: var(--frambuesa);
}
.btn-ghost:hover { border-color: var(--rosa); color: var(--rosa); }

@media (max-width: 760px) {
  .modal-config { width: calc(100vw - 24px); }
  .config-body { padding: 18px; max-height: calc(100vh - 300px); }
  .config-options { grid-template-columns: 1fr; }
  .config-foot { flex-direction: column; align-items: stretch; }
  .config-nav { justify-content: space-between; }
  .config-nav .btn { flex: 1; }
}

/* ---------- Toasts de aviso ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--blanco);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(43, 38, 37, 0.22);
  border: 1px solid var(--beige);
  font-size: 15px;
  line-height: 1.45;
  color: var(--negro);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.error { border-color: var(--rosa); }
.toast.success { border-color: #6fae7a; }

.toast-icon { flex-shrink: 0; font-size: 18px; line-height: 1.3; }

.toast-body { flex: 1; }

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--beige-hover);
  cursor: pointer;
  padding: 0 0 0 6px;
}
.toast-close:hover { color: var(--rosa); }

.toast.leaving { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(24px) scale(0.96); }
}

@media (max-width: 760px) {
  .toast-container { top: 12px; right: 12px; left: 12px; max-width: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 40px 20px; }
  .hero-image { height: 260px; }
  .nav { flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 12px 16px; }
  .header.shrink .nav { padding: 8px 16px; }
  .header.shrink .logo { font-size: 16px; }
  .header.shrink .logo-img { width: 32px; height: 32px; }
  .header.shrink .cart-btn { font-size: 13px; padding: 5px 12px; }
  .logo { font-size: 19px; }
  .logo-img { width: 40px; height: 40px; }
  .cart-btn { font-size: 14px; padding: 7px 14px; }
  .nav-links { display: none; }
  .nav-menu {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85%);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--crema);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s;
    box-shadow: 10px 0 40px rgba(0,0,0,0.2);
    overflow-y: auto;
  }
  .nav-menu.open { transform: translateX(0); }
  .nav-menu-head { display: flex; }
  .nav-menu .nav-link {
    font-size: 18px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(104,20,20,0.08);
  }
  body { font-size: 17px; }
  .modal { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .modal-image { height: 220px; }
  .modal-body { padding: 20px; }
  .modal-name { font-size: 24px; }
}
