:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --accent2: #0f3460;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #222;
  --muted: #777;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
}

/* ===== Header / marca reutilizable (igual en todas las páginas) ===== */
.app-header {
  position: relative;
  z-index: 50;
  background: var(--primary);
  color: #fff;
  flex: 0 0 auto;
  padding: calc(env(safe-area-inset-top)) 0 0;
}

.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.app-header .brand {
  font-family: 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  letter-spacing: 0.5px;
  line-height: 1.05;
  user-select: none;
  text-align: left;
  transition: opacity 0.3s ease, max-width 0.3s ease, margin 0.3s ease;
  max-width: 400px;
}

.app-header .brand strong {
  color: var(--accent);
  font-weight: 900;
}

/* ===== Lupa animada en el header (catálogo) ===== */
.search-anim {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  contain: layout style;
  will-change: width;
  transition: width 0.32s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.search-anim .search_item {
  height: 38px;
  width: 100%;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 19px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  color: transparent;
  caret-color: transparent;
  text-indent: 0;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}

.search-anim .search_item::placeholder {
  color: transparent;
}

.app-header.search-active .search-anim {
  width: min(100%, 380px);
}

.app-header.search-active .search-anim .search_item {
  padding-left: 42px;
  background-color: rgba(255, 255, 255, 0.08);
  background-position: left 14px center;
  color: rgba(255, 255, 255, 0.6);
  caret-color: #fff;
  cursor: text;
}

.app-header.search-active .search-anim .search_item::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* En móvil se oculta el logo cuando se busca */
@media (max-width: 767px) {
  .app-header.search-active .brand {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    margin-right: 0;
  }
  .app-header.search-active .brand-row {
    flex-wrap: nowrap;
  }
  .app-header.search-active .brand-actions {
    flex: 1 1 auto;
  }
}

.page {
  flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.page-title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
  margin: 4px 0 14px;
  color: var(--text);
}

.logo-ico {
  width: 1.3em;
  height: 1.3em;
  flex: 0 0 auto;
  color: var(--accent);
}

/* ===== Scrollbar discreto: solo el indicador de posición ===== */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
  overflow-x: hidden;
}

html,
body,
div {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track,
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: transparent !important;
  box-shadow: none;
  border: none;
}

*::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* iOS Safari: el indicador de scroll nativo del viewport no se puede ocultar
   con CSS. Movemos el scroll al contenedor .page (ver body/.page) y aquí
   ocultamos su scrollbar, que iOS sí controla por ::-webkit-scrollbar. */
@supports (-webkit-touch-callout: none) {
  html,
  body {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
  .page {
    scrollbar-width: none;
  }
  .page::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
  }
  .page::-webkit-scrollbar-track,
  .page::-webkit-scrollbar-track-piece,
  .page::-webkit-scrollbar-thumb {
    background: transparent !important;
    display: none;
  }
}

header {
  background: linear-gradient(135deg, var(--primary), var(--accent2));
  color: #fff;
  padding: 24px 16px;
  text-align: center;
}

header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ico {
  width: 1em;
  height: 1em;
  vertical-align: -2px;
  margin-right: 4px;
}

.loc-ico {
  width: 1em;
  height: 1em;
  vertical-align: -2px;
  color: #2ecc71;
  margin-right: 4px;
}

.success-ico {
  width: 64px;
  height: 64px;
  color: #2ecc71;
}

.star-ico {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  color: #f5a623;
  fill: #f5a623;
}

.location-btn .btn-ico {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -3px;
}

header p {
  opacity: 0.85;
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
  padding: 8px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.cats {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
}

.cats::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex: 0 0 auto;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  color: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.filter-btn:hover {
  transform: scale(1.05);
  background: var(--accent2);
}

.sort-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 16px;
  z-index: 45;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 6px;
  min-width: 220px;
}

.sort-menu::before {
  content: attr(data-title);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 8px 14px 6px;
}

.sort-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: transparent;
  border: none;
  padding: 11px 14px;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

.sort-menu button::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #c8c8cf;
  border-radius: 50%;
  flex: 0 0 auto;
}

.sort-menu button.active::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.sort-menu button:hover {
  background: #f2f2f5;
}

.search {
  flex: 1 1 260px;
  max-width: 420px;
  padding: 12px 16px;
  border: 2px solid #e2e2e2;
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search:focus {
  border-color: var(--accent);
}

.select {
  padding: 12px 14px;
  border: 2px solid #e2e2e2;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.card .img-wrap {
  position: relative;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  padding: 12px;
}

.card img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.card .badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 0 0 10px 0;
  padding: 4px 12px;
}

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

.card h3 {
  font-size: 0.98rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .desc {
  font-size: 0.82rem;
  color: var(--muted);
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.card .price {
  margin-top: auto;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}

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

.cat-chip {
  display: inline-block;
  background: var(--accent2);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 4px;
  vertical-align: middle;
}

/* Chips de filtro por categoría (toolbar del catálogo) */
.cats .cat-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 2px solid var(--accent2);
  background: #fff;
  color: var(--accent2);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  margin: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.cats .cat-chip.active {
  background: var(--accent2);
  color: #fff;
}

.card .reviews {
  color: var(--muted);
  font-size: 0.8rem;
}

.card .actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--accent2);
  color: #fff;
}

.btn-ghost {
  background: #eee;
  color: var(--text);
}

.btn-danger {
  background: #d9534f;
  color: #fff;
}

.count {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 8px 0 4px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-card h2 {
  margin-bottom: 16px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--muted);
}

.field textarea,
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e2e2e2;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.field textarea:focus,
.field input:focus {
  border-color: var(--accent2);
}

.field textarea {
  resize: vertical;
  min-height: 70px;
}

.img-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.img-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.img-input-row input {
  flex: 1 1 auto;
  padding: 9px 11px;
  border: 2px solid #e2e2e2;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
}

.img-input-row input:focus {
  border-color: var(--accent2);
}

.img-remove {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #f3f3f5;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.img-remove:hover {
  background: #f8d7da;
  color: #c0392b;
}

.img-upload {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.img-upload:hover {
  background: var(--accent2);
}

.img-upload:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.empty {
  text-align: center;
  padding: 60px 16px;
  color: var(--muted);
}

.alert {
  max-width: 1200px;
  margin: 16px auto;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.alert.success {
  background: #d4edda;
  color: #155724;
}

.alert.error {
  background: #f8d7da;
  color: #721c24;
}

.alert.info {
  background: #d1ecf1;
  color: #0c5460;
}

.hidden {
  display: none;
}

/* ==== Barra inferior / botón carrito ==== */
.cart-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.4);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.cart-fab:hover {
  transform: scale(1.06);
}

.cart-fab .badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  min-width: 24px;
  height: 24px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
}

.cart-fab .badge-count.zero {
  background: #bbb;
}

/* ==== Panel del carrito ==== */
.cart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 120;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.cart-panel.open {
  right: 0;
}

.cart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
  font-size: 1.15rem;
  font-weight: 700;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: flex-start;
}

.cart-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-info {
  flex: 1;
  min-width: 0;
}

.cart-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-name:hover {
  color: var(--accent);
}

.cart-price {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 3px 0;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.qty-btn:hover {
  background: #e8e8e8;
}

.qty-num {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.qty-remove {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0 2px;
}

.cart-subtotal {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
}

.cart-panel-foot {
  border-top: 1px solid #eee;
  padding: 18px 20px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.cart-panel-foot .btn {
  width: 100%;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ==== Botones de tarjeta ==== */
.card .actions {
  flex-direction: column;
  gap: 8px;
}

.btn-add {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-buy {
  background: var(--accent2);
  color: #fff;
  width: 100%;
}

.card .stock-tag {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 2px;
}

.stock-low {
  color: #d9534f;
}

.stock-ok {
  color: #28a745;
}

.stock-out {
  color: #d9534f;
}

/* ==== Vista de producto ==== */
.product-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}

.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 14px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--accent2);
  text-decoration: none;
}

.product-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.product-main .img-wrap {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 16px;
}

.product-main .img-wrap img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-gallery .main-img {
  display: none;
}

.product-gallery .main-img.active {
  display: block;
}

.product-gallery .thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.product-gallery .thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s, border-color 0.15s;
}

.product-gallery .thumb:hover {
  opacity: 1;
}

.product-gallery .thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

.product-info h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin-bottom: 10px;
  line-height: 1.2;
}

.product-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin: 12px 0;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.product-desc {
  margin: 14px 0;
  color: #444;
  line-height: 1.6;
}

.product-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.related {
  margin-top: 36px;
}

.related h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

/* ==== Comprar / checkout modal ==== */
.checkout-strip {
  max-width: 1100px;
  margin: 14px auto 0;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .toolbar {
    padding: 12px;
  }
  .product-main {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .cart-panel {
    width: 100vw;
  }
  .cart-fab {
    bottom: 14px;
    right: 14px;
  }
}

/* ==== Toast ==== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: #28a745;
}

.toast.error {
  background: #d9534f;
}

/* ==== Pestañas admin ==== */
.tabs {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.tab-btn {
  border: 2px solid #e2e2e2;
  background: #fff;
  color: var(--text);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==== Categorías admin ==== */
.cat-form {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.cat-form input {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  border: 2px solid #e2e2e2;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
}

.cat-form input:focus {
  border-color: var(--accent2);
}

.cat-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-row {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cat-row .cat-name {
  font-weight: 600;
}

.cat-row .cat-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.cat-row .cat-actions {
  display: flex;
  gap: 8px;
}

/* ==== Órdenes admin ==== */
.orders-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.orders-filter {
  border: 2px solid #e2e2e2;
  background: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.order-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  cursor: pointer;
  transition: transform 0.15s;
}

.order-card:hover {
  transform: translateY(-2px);
}

.order-card .order-main {
  flex: 1;
  min-width: 200px;
}

.order-card .order-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.order-card .order-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.order-attr {
  text-align: right;
}

.order-total {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.15rem;
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==== Detalle de orden modal ==== */
.order-detail img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #eee;
}

.order-detail .od-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.order-detail .od-info {
  flex: 1;
  font-size: 0.9rem;
}

.order-detail .od-price {
  font-weight: 700;
}

.order-detail .od-loc {
  color: var(--muted);
  font-size: 0.85rem;
}

.order-detail .map-btn {
  display: inline-block;
  margin-top: 8px;
}

.badge-ok {
  background: #d4edda;
  color: #155724;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==== Checkout ==== */
.checkout-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px;
}

.checkout-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.checkout-card h2 {
  margin-bottom: 6px;
}

.checkout-summary {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px;
  margin: 16px 0;
  max-height: 240px;
  overflow-y: auto;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  padding: 4px 0;
}

.checkout-line .cl-name {
  flex: 1;
  color: #444;
}

.location-btn {
  margin-top: 8px;
}

.loc-info {
  font-size: 0.85rem;
  color: #28a745;
  margin-top: 6px;
  display: none;
}

.loc-info.ok {
  display: block;
}

.loc-info.err {
  color: #d9534f;
}

.required-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.total-big {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  text-align: right;
  margin-top: 10px;
}
