/* ============================================================
   Tu Tienda MMD — estilos v2 (restyle 2026-12-05)
   Marca: rosa (logo MD Shoes) + negro + blanco.
   Moderno y ergonómico, móvil primero: objetivos táctiles
   amplios (44 px+), respiración generosa, jerarquía clara.
   ============================================================ */
:root {
  --pink: #e91e63;
  --pink-deep: #ad1457;
  --pink-dark: #c2185b;
  --pink-soft: #fdeef3;
  --pink-mist: #fce4ec;
  --pink-glow: #f8bbd0;
  --black: #161016;
  --ink: #241a20;
  --ink-soft: #4a3a42;
  --muted: #8a757e;
  --line: #f2e3e9;
  --line-strong: #e8cdd8;
  --bg: #fff9fb;
  --card: #ffffff;
  --green: #25d366;
  --green-dark: #1da851;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(22, 16, 22, .05), 0 4px 16px rgba(233, 30, 99, .07);
  --shadow-hover: 0 2px 4px rgba(22, 16, 22, .06), 0 12px 32px rgba(233, 30, 99, .13);
  --shadow-lg: 0 12px 40px rgba(22, 16, 22, .18);
  --ring: 0 0 0 4px rgba(233, 30, 99, .14);
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 320px at 50% -80px, rgba(233, 30, 99, .10), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
}
a { color: var(--pink-dark); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font-family: inherit; font-size: 16px; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(233, 30, 99, .06), 0 6px 20px rgba(22, 16, 22, .05);
}
.topbar::after {
  content: ""; display: block; height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--pink-glow), var(--pink));
}
.topbar-in {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--black); min-width: 0; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 14px; object-fit: cover; flex: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--pink-glow), 0 4px 12px rgba(233, 30, 99, .22);
}
.brand-name {
  font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.02;
  display: flex; flex-direction: column; letter-spacing: -.2px;
}
.brand-name b { color: var(--pink); }
.brand-name small {
  font-family: var(--font-body); font-weight: 800; font-size: 10.5px; color: var(--muted);
  letter-spacing: 1.6px; text-transform: uppercase; margin-top: 2px;
}
.spacer { flex: 1; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 9px 15px; font-weight: 800; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--pink); box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(.97); }
.wa-btn { background: var(--green); border-color: var(--green); color: #fff; }
.wa-btn:hover { background: var(--green-dark); border-color: var(--green-dark); box-shadow: 0 6px 18px rgba(37, 211, 102, .35); }
.announce {
  background: var(--black); color: #fff; text-align: center;
  font-weight: 700; font-size: 13.5px; padding: 9px 14px; letter-spacing: .2px;
}
.announce b { color: var(--pink-glow); }
@media (max-width: 480px) {
  .icon-btn span { display: none; }
  .icon-btn { min-width: 44px; padding: 9px 11px; font-size: 17px; }
  .brand-name { font-size: 19px; }
  .brand-name small { font-size: 9px; letter-spacing: .8px; white-space: nowrap; }
  .brand-logo { width: 44px; height: 44px; }
}

/* ---------- Layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }
.skeleton {
  height: 220px; border-radius: var(--radius); margin-bottom: 14px;
  background: linear-gradient(90deg, var(--pink-soft), #fff, var(--pink-soft));
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.hero { text-align: center; padding: 26px 8px 8px; }
.hero-eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 900; letter-spacing: 2.2px;
  text-transform: uppercase; color: var(--pink-dark);
  background: var(--pink-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(30px, 6.4vw, 46px);
  margin: 0 0 8px; color: var(--black); line-height: 1.04; letter-spacing: -.5px;
}
.hero h1 em { font-style: normal; color: var(--pink); }
.hero p { margin: 0 auto 20px; color: var(--muted); max-width: 580px; font-weight: 600; font-size: 16.5px; }
.search-row { display: flex; gap: 8px; max-width: 580px; margin: 0 auto 18px; }
.search-row input {
  flex: 1; min-height: 52px; border: 2px solid var(--line-strong); border-radius: 999px;
  padding: 12px 20px; background: #fff; outline: none; font-size: 16px;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.search-row input:focus { border-color: var(--pink); box-shadow: var(--ring); }
.search-row input::placeholder { color: #b39aa4; }
.chips {
  display: flex; gap: 8px; margin: 0 -16px 20px; padding: 2px 16px 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 720px) {
  .chips { flex-wrap: wrap; justify-content: center; margin: 0 auto 20px; overflow: visible; }
}
.chip {
  border: 1.5px solid var(--line-strong); background: #fff; border-radius: 999px;
  min-height: 40px; padding: 8px 16px; font-weight: 800; font-size: 14px; color: var(--ink-soft);
  white-space: nowrap; scroll-snap-align: start;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.chip:hover { border-color: var(--pink); color: var(--pink-dark); }
.chip:active { transform: scale(.96); }
.chip.active {
  background: var(--pink); border-color: var(--pink); color: #fff;
  box-shadow: 0 6px 16px rgba(233, 30, 99, .32);
}
.count-line { text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; margin: 0 0 16px; }

/* ---------- Product grid: 3 en 3 ---------- */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.card-photo { aspect-ratio: 1 / 1; background: var(--pink-soft); position: relative; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-photo img { transform: scale(1.045); }
.card-photo .no-photo {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--pink), var(--black));
  color: #fff; font-weight: 800; text-align: center; padding: 12px; font-size: 14px;
}
.card-photo .no-photo small { font-weight: 600; opacity: .85; }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat {
  font-size: 11px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--pink-dark);
}
.card-name { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; line-height: 1.22; color: var(--black); }
.card-price { font-weight: 900; font-size: 19px; color: var(--black); letter-spacing: -.2px; }
.card-price.consultar { color: var(--pink-dark); font-size: 15.5px; }
.card-sizes { font-size: 13px; color: var(--muted); font-weight: 700; }
.card-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.btn {
  border: none; border-radius: var(--radius-sm); min-height: 48px; padding: 12px 16px;
  font-weight: 900; font-size: 15px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, box-shadow .15s, transform .15s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn-wa { background: var(--green); color: #fff; flex: 1; box-shadow: 0 4px 14px rgba(37, 211, 102, .28); }
.btn-wa:hover { background: var(--green-dark); }
.btn-pink { background: var(--pink); color: #fff; box-shadow: 0 4px 14px rgba(233, 30, 99, .28); }
.btn-pink:hover { background: var(--pink-dark); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--pink); color: var(--pink-dark); }
.btn-dark { background: var(--black); color: #fff; }
.btn-danger { background: #fff; border: 1.5px solid #f3b8c6; color: #c62828; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-more {
  font-size: 13px; font-weight: 800; color: var(--muted); background: none; border: none;
  padding: 6px 2px; text-align: center; min-height: 32px;
}
.link-more:hover { color: var(--pink-dark); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty b { display: block; font-size: 21px; color: var(--black); margin-bottom: 6px; font-family: var(--font-display); }

/* ---------- Footer ---------- */
.footer { background: var(--black); color: #fff; margin-top: 16px; border-top: 3px solid var(--pink); }
.footer-in { max-width: 1120px; margin: 0 auto; padding: 36px 16px 44px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .footer-in { grid-template-columns: 1fr; gap: 24px; } }
.footer h3 { font-family: var(--font-display); margin: 0 0 12px; font-size: 17px; color: var(--pink-glow); letter-spacing: .2px; }
.footer p { margin: 5px 0; color: #e8dfe3; font-size: 14.5px; line-height: 1.6; }
.footer a { color: #fff; }
.footer .cat-list { list-style: none; margin: 0; padding: 0; columns: 2; }
.footer .cat-list li { margin-bottom: 9px; }
.footer .cat-list button {
  background: none; border: none; color: #fff; font-weight: 700; font-size: 14.5px;
  padding: 4px 0; text-align: left; min-height: 32px;
}
.footer .cat-list button:hover { color: var(--pink-glow); text-decoration: underline; }
.footer .brand-row { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.footer .brand-row img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.footer .brand-row b { font-family: var(--font-display); font-size: 19px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14); padding: 16px; text-align: center;
  font-size: 13px; color: #c9b8c0;
}
.footer-bottom a { color: var(--pink-glow); font-weight: 800; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22, 16, 22, .62); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 20px; } }
.modal {
  background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .modal { border-radius: 24px; } }
.modal h2 { font-family: var(--font-display); margin: 0 0 4px; font-size: 23px; color: var(--black); letter-spacing: -.3px; }
.modal .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; font-weight: 600; }
.modal-photo { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; background: var(--pink-soft); }
.modal-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 900; font-size: 13.5px; margin-bottom: 6px; color: var(--black); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border: 2px solid var(--line-strong); border-radius: 12px;
  padding: 11px 13px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--pink); outline: none; box-shadow: var(--ring); }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 5px; }
.size-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.size-chip {
  border: 2px solid var(--line-strong); background: #fff; border-radius: 12px;
  min-width: 48px; min-height: 44px; padding: 9px 14px; font-weight: 900; font-size: 14.5px;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.size-chip:active { transform: scale(.95); }
.size-chip.sel { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 4px 12px rgba(233, 30, 99, .3); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.modal-close {
  float: right; background: var(--pink-soft); border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 17px; font-weight: 900; color: var(--pink-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--pink-mist); }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 880px; margin: 0 auto; }
.admin-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { font-family: var(--font-display); margin: 0; font-size: 27px; color: var(--black); letter-spacing: -.3px; }
.admin-head .btn { margin-left: auto; min-height: 44px; }
.mode-badge {
  font-size: 12px; font-weight: 900; padding: 5px 11px; border-radius: 999px;
  background: #fff3cd; color: #7a5b00; border: 1px solid #ffe08a;
}
.mode-badge.live { background: #dcf5e3; color: #146c2e; border-color: #9edcb0; }
.admin-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.admin-card h2 { font-family: var(--font-display); margin: 0 0 12px; font-size: 20px; color: var(--black); letter-spacing: -.2px; }
.admin-card h3 { margin: 16px 0 8px; font-size: 15.5px; }
.prov-flag {
  display: inline-block; background: #fff3cd; color: #7a5b00; border: 1px solid #ffe08a;
  font-size: 11.5px; font-weight: 900; border-radius: 999px; padding: 2px 8px; margin-left: 6px;
  vertical-align: middle;
}
.hidden-flag {
  display: inline-block; background: #f0ecee; color: #6d5b64; font-size: 11.5px; font-weight: 900;
  border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle;
}
.prod-row { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.prod-row:first-of-type { border-top: none; }
.prod-thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--pink-soft); flex: none; }
.prod-thumb.ph { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--pink), var(--black)); color: #fff; font-size: 11px; font-weight: 900; text-align: center; padding: 4px; }
.prod-info { flex: 1; min-width: 0; }
.prod-info b { font-size: 15.5px; color: var(--black); }
.prod-info .meta { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.prod-actions { display: flex; flex-direction: column; gap: 8px; }
.prod-actions .btn { min-height: 44px; padding: 8px 14px; font-size: 13.5px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.check-line { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; margin: 10px 0; min-height: 32px; }
.check-line input { width: 20px; height: 20px; accent-color: var(--pink); flex: none; }
.error { background: #fdecea; color: #a21313; border: 1px solid #f5b5b0; border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.notice { background: #eef7f0; color: #146c2e; border: 1px solid #bfe6c8; border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.muted-note { font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.55; }

/* ---------- Toast ---------- */
#toastRoot {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translateX(-50%); z-index: 200; width: min(92vw, 440px);
}
.toast {
  background: var(--black); color: #fff; border-radius: 14px; padding: 13px 18px;
  font-weight: 800; font-size: 14.5px; box-shadow: var(--shadow-lg); text-align: center;
}
.toast.ok { background: #146c2e; }
.toast.err { background: #a21313; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
