/* ================= Tokens ================= */
:root {
  --pink-bg: #FFF1F6;
  --pink-soft: #FFE1EC;
  --pink: #F97EA6;
  --pink-deep: #E8578A;
  --teal: #5FB3C4;
  --teal-deep: #2E6B8A;
  --amber: #F3A93B;
  --ink: #3A2E36;
  --ink-soft: #7A6B72;
  --white: #FFFFFF;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(232, 87, 138, 0.15);
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ================= Animaciones ================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-10px) rotate(2deg); }
}
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes bump {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.35) rotate(-8deg); }
  60%      { transform: scale(0.95) rotate(4deg); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes flyFade {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--fly-x), var(--fly-y)) scale(.3); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--pink-bg);
}

img { max-width: 100%; display: block; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--pink-deep);
  color: var(--white);
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: 0 12px 26px rgba(232,87,138,.28); }

/* ================= Header (mobile first) ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--pink-soft);
  box-shadow: 0 0 0 rgba(58,46,54,0);
  transition: box-shadow .25s ease;
}
.site-header.scrolled {
  box-shadow: 0 6px 18px rgba(58,46,54,.08);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}
.brand-logo { height: 40px; width: auto; }

.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  position: relative;
  padding: 8px;
  color: var(--ink);
}
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 34px;
}
.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--pink-deep);
  color: var(--white);
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.site-nav {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--pink-soft);
}
.site-nav.open { display: flex; }
.nav-link {
  padding: 14px 18px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--pink-bg);
}
.nav-link.active { color: var(--pink-deep); }

/* ================= Hero ================= */
.hero {
  padding: 36px 18px 28px;
  text-align: center;
}
.hero-eyebrow {
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--teal-deep);
  font-weight: 700;
  margin: 0 0 10px;
  opacity: 0;
  animation: fadeUp .6s ease .05s forwards;
}
.hero-text h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 14px;
  opacity: 0;
  animation: fadeUp .6s ease .15s forwards;
}
.hero-sub {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 22px;
  opacity: 0;
  animation: fadeUp .6s ease .25s forwards;
}
.hero-text .btn {
  opacity: 0;
  animation: fadeUp .6s ease .35s forwards;
}
.hero-art { margin-top: 26px; }
.hero-logo-art {
  max-width: 220px;
  margin: 0 auto;
  filter: drop-shadow(0 12px 20px rgba(95,179,196,.25));
  opacity: 0;
  animation: fadeUp .7s ease .3s forwards, bob 4.5s ease-in-out 1s infinite;
}

/* ================= Catalog ================= */
.catalog { padding: 10px 16px 40px; }
.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.catalog-head h2 { font-size: 20px; margin: 0; }
.category-select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--pink-soft);
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(58,46,54,.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease, box-shadow .25s ease;
  transition-delay: var(--reveal-delay, 0s);
}
.product-card.show {
  opacity: 1;
  transform: translateY(0);
}
.product-card:hover {
  box-shadow: 0 14px 28px rgba(58,46,54,.14);
  transform: translateY(-4px);
}
.product-media {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  background: var(--pink-soft);
  transition: transform .35s ease;
}
.product-card:hover .product-media { transform: scale(1.08) rotate(-3deg); }
.product-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-cat {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--teal-deep);
  font-weight: 700;
}
.product-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  min-height: 36px;
}
.product-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--pink-deep);
  margin-top: auto;
}
.add-btn {
  margin-top: 8px;
  width: 100%;
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: 999px;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.add-btn:active { transform: scale(0.97); }
.add-btn.added {
  background: var(--pink-deep);
  animation: pop .4s ease;
}

/* Ícono que "vuela" del botón al carrito */
.fly-icon {
  position: fixed;
  font-size: 22px;
  z-index: 80;
  pointer-events: none;
  animation: flyFade .6s ease forwards;
}

.cart-toggle.bump { animation: bump .5s ease; }

/* ================= Footer ================= */
.site-footer {
  text-align: center;
  padding: 34px 18px 40px;
  color: var(--ink-soft);
  font-size: 13px;
}
.footer-logo { height: 30px; margin: 0 auto 10px; opacity: .85; }
.footer-note { font-size: 11px; opacity: .7; margin-top: 6px; }

/* ================= Cart Drawer ================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(58,46,54,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 60;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 88%;
  max-width: 380px;
  background: var(--white);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--pink-soft);
}
.cart-head h2 { font-size: 18px; margin: 0; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}
.cart-empty { color: var(--ink-soft); font-size: 14px; text-align: center; margin-top: 30px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pink-bg);
  animation: fadeUp .3s ease;
}
.cart-item-media {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--pink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 700; margin: 0 0 2px; }
.cart-item-price { font-size: 12px; color: var(--ink-soft); }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--pink-soft);
  background: var(--white);
  cursor: pointer;
  font-weight: 700;
  color: var(--pink-deep);
  line-height: 1;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 6px;
}

.cart-summary {
  padding: 16px 18px 22px;
  border-top: 1px solid var(--pink-soft);
}
.cart-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 12px;
}
.btn-checkout { width: 100%; }

/* ================= Toasts ================= */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 0 16px;
}
.toast {
  background: var(--ink);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  animation: toastIn .3s ease forwards;
  max-width: 320px;
  text-align: center;
}
.toast.out { animation: toastIn .25s ease reverse forwards; }

/* ================= Tablet ================= */
@media (min-width: 768px) {
  .header-inner { padding: 0 28px; }
  .menu-toggle { display: none; }
  .site-nav {
    display: flex !important;
    flex-direction: row;
    border-top: none;
    justify-content: center;
    gap: 4px;
  }
  .nav-link { border-bottom: none; padding: 10px 14px; border-radius: 999px; }
  .nav-link:hover { background: var(--pink-soft); }

  .hero {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 40px;
    padding: 60px 40px;
  }
  .hero-text { flex: 1; }
  .hero-text h1 { font-size: 38px; }
  .hero-art { flex: 1; margin-top: 0; }
  .hero-logo-art { max-width: 320px; }

  .catalog { padding: 20px 40px 60px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* ================= Desktop ================= */
@media (min-width: 1024px) {
  .header-inner { padding: 0 56px; }
  .hero { padding: 80px 56px; }
  .hero-text h1 { font-size: 46px; }
  .hero-sub { font-size: 17px; max-width: 480px; }
  .catalog { padding: 30px 56px 80px; max-width: 1200px; margin: 0 auto; }
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .cart-drawer { width: 400px; }
}
