/* ============================================================
   SISTEMA DE DISEÑO — Catálogo Villa Libertador
   Paleta: papel cálido + verde toldo + naranja sello de oferta
   Tipografía: Oswald (precios/títulos) + Inter (texto)
   ============================================================ */

:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #20231f;
  --ink-soft: #4a4d47;
  --primary: #1f4d3a;
  --primary-light: #2e6b50;
  --accent: #e8743b;
  --accent-soft: #fbe6da;
  --highlight: #f2c14e;
  --muted: #9b9b95;
  --muted-bg: #f0ece3;
  --border: #e4ddd0;
  --danger: #c0432b;

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 77, 58, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

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

a {
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--highlight);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.top-bar {
  background: var(--primary);
  color: #fff;
  padding: 18px 20px 16px;
}

.top-bar__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 2rem);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
  margin-right: 10px;
}

.brand__tag {
  font-size: 0.85rem;
  color: var(--highlight);
  font-weight: 500;
}

.top-bar__updated {
  margin-top: 6px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Category nav ---------- */

.cat-nav {
  position: sticky;
  top: var(--search-bar-height, 0px);
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.cat-nav__scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px;
  max-width: 1100px;
  margin: 0 auto;
  scrollbar-width: none;
}

.cat-nav__scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.cat-chip:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ---------- Main / sections ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 100px;
}

.category-section {
  margin-bottom: 36px;
}

.category-section__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.3rem;
  color: var(--primary);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

/* ---------- Product card (price-tag styling) ---------- */

.product-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* "agujero de etiqueta" */
.product-card::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: 2;
}

.product-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--muted-bg);
}

.product-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  padding: 10px;
}

.promo-stamp {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 5px;
  transform: rotate(-4deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.product-card__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 4.6em;
  justify-content: flex-start;
}

.product-card__name {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0;
  min-height: 2.4em;
}

.product-card__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card__price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.product-card__price--old {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-right: 4px;
}

.product-card__promo-text {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

.product-card__stock-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--muted-bg);
  color: var(--muted);
}

.product-card--soldout {
  opacity: 0.55;
}

.product-card--soldout .product-card__img-wrap img {
  filter: grayscale(0.6);
}

.btn-order {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-order:hover {
  background: var(--primary-light);
}

.btn-order[disabled],
.btn-order--disabled {
  background: var(--muted-bg);
  color: var(--muted);
  pointer-events: none;
}

/* ---------- Floating WhatsApp button ---------- */

.wa-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(31, 77, 58, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
}

/* ---------- Empty / loading states ---------- */

.state-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 24px 20px 40px;
}

.site-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* ============================================================
   ADMIN
   ============================================================ */

.admin-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.88rem;
}

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

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--muted-bg);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--border);
}

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

.btn-danger:hover {
  opacity: 0.9;
}

.btn-block {
  width: 100%;
}

.login-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}

.login-card {
  max-width: 360px;
  margin: 80px auto;
}

.login-card h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.3rem;
  color: var(--primary);
  margin: 0 0 16px;
  text-align: center;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field-row .field {
  flex: 1;
  min-width: 140px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.checkbox-field input {
  width: auto;
}

.checkbox-field label {
  margin: 0;
  font-weight: 600;
  font-size: 0.88rem;
}

.error-text {
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 8px;
  min-height: 1.2em;
}

.helper-text {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -4px;
  margin-bottom: 12px;
}

.panel h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1.05rem;
  color: var(--primary);
  margin: 0 0 14px;
}

.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-product-row {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.admin-product-row__thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--muted-bg);
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
}

.admin-product-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-product-row__info {
  flex: 1;
  min-width: 0;
}

.admin-product-row__name {
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0 0 2px;
}

.admin-product-row__meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 4px;
}

.tag--promo {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag--soldout {
  background: var(--muted-bg);
  color: var(--muted);
}

.admin-product-row__actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.icon-btn:hover {
  background: var(--muted-bg);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 35, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1.05rem;
  color: var(--primary);
  margin: 0 0 14px;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .admin-product-row {
    flex-wrap: wrap;
  }
  .admin-product-row__actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================================
   CARRITO & CONTROLES DE PRODUCTO
   ============================================================ */

/* ---------- Stepper de cantidad ---------- */

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.qty-stepper button {
  background: var(--muted-bg);
  border: none;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-stepper button:hover {
  background: var(--border);
}

.qty-stepper__value {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0 4px;
}

/* ---------- Controles debajo del precio en la tarjeta ---------- */

.product-card__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ---------- Botón "Agregar" ---------- */

.btn-add {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-add:hover {
  background: var(--primary-light);
}

.btn-add--ok {
  background: #2d7a4f !important;
}

/* ---------- Botón flotante del carrito ---------- */

.cart-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
  box-shadow: 0 6px 18px rgba(31, 77, 58, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
  cursor: pointer;
}

.cart-float:hover {
  background: var(--primary-light);
}

.cart-float__icon {
  font-size: 1.1rem;
}

.cart-float__badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ---------- Panel lateral del carrito ---------- */

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(32, 35, 31, 0.45);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}

.cart-drawer {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.cart-drawer__header h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.15rem;
  color: var(--primary);
  margin: 0;
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-drawer__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- Ítem del carrito ---------- */

.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item__name {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}

.cart-item__price {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.cart-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.cart-item__subtotal {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
}

.cart-item__remove {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Total ---------- */

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 10px 0 4px;
  border-top: 2px solid var(--primary);
}

.cart-total-row span:last-child {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--primary);
}

/* ============================================================
   PESTAÑAS DEL PANEL
   ============================================================ */

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  background: none;
  border: none;
  padding: 10px 4px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-tab:hover {
  color: var(--ink);
}

.admin-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============================================================
   PEDIDOS
   ============================================================ */

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.order-card__header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: none;
  padding: 12px 14px;
  text-align: left;
  font-family: inherit;
}

.order-card__header:hover {
  background: var(--muted-bg);
}

.order-card__header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.order-card__datetime {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.order-card__client {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card__total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
  flex-shrink: 0;
}

.order-card__chevron {
  color: var(--muted);
  flex-shrink: 0;
}

.order-card__detail {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.order-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.order-detail-table th,
.order-detail-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}

.order-detail-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   FILTROS DE PEDIDOS
   ============================================================ */

.order-filters {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.order-filters .field {
  margin-bottom: 10px;
}

.order-filters .field:last-of-type {
  margin-bottom: 12px;
}

/* ============================================================
   ETIQUETA DE FORMA DE PAGO (en pedidos)
   ============================================================ */

.tag--pago {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tag--pago-efectivo {
  background: #e3f2e1;
  color: #2d7a4f;
}

.tag--pago-qr {
  background: #e6e9fb;
  color: #3d4fc4;
}

.tag--pago-transferencia {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag--pago-debito {
  background: #fdf0d5;
  color: #b8860b;
}

/* ============================================================
   IMPORTACIÓN DE PRODUCTOS DESDE CSV
   ============================================================ */

.modal--ancho {
  max-width: 720px;
}

.import-table-wrap {
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.import-table th {
  position: sticky;
  top: 0;
  background: var(--muted-bg);
  text-align: left;
  padding: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
}

.import-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.import-row--nuevo {
  background: #f3faf1;
}

.import-row--existente {
  background: #fdf8ea;
}

.import-table select {
  font-size: 0.78rem;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

/* ============================================================
   BANNER COMPACTO (imagen institucional achicada)
   ============================================================ */

.banner-strip {
  width: 100%;
  background: #0d2b52;
  display: flex;
  justify-content: center;
}

.banner-strip__img {
  width: 100%;
  max-width: 1100px;
  height: auto;
  display: block;
}

.top-bar__updated--standalone {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 8px 20px 0;
  margin: 0;
}

/* ============================================================
   BUSCADOR (Barra fluida y pegada al fondo)
   ============================================================ */

.search-bar {
  background: var(--bg);
  padding: 10px 20px; /* Reducimos el espaciado muerto de arriba */
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 21;
}

.search-bar__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.search-bar__input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface); /* Fondo blanco sólido para tapar cualquier texto roto por detrás */
  color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239b9b95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  padding-left: 42px;
}

.search-bar__input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-bar__input:focus {
  border-color: var(--primary-light);
}

/* ============================================================
   PLACEHOLDER DE IMAGEN MEJORADO (producto sin foto)
   ============================================================ */

.product-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ink-soft);
  text-align: center;
  padding: 14px;
  background: linear-gradient(135deg, var(--muted-bg) 0%, var(--bg) 100%);
}

.product-card__img-placeholder::before {
  content: "";
  width: 34px;
  height: 34px;
  opacity: 0.45;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f4d3a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E");
}

.product-card__img-placeholder span {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

/* ----- Estado: sin resultados de búsqueda ----- */

.no-results {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}

.no-results__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

/* Optimización estructural y estética para Celulares */
@media (max-width: 576px) {
  /* Reducimos el padding y los márgenes muertos de la cabecera en móviles */
  .main-banner {
    margin-bottom: 0 !important;
  }
  
  .search-bar {
    padding: 8px 12px !important; /* Super pegado abajo del banner */
  }

  .cat-nav {
    padding: 6px 0 !important;
  }

  .product-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px;
  }

  .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 95px;
    height: auto;
    padding: 10px;
    box-sizing: border-box;
  }

  .product-card__img-wrap {
    width: 65px !important;
    height: 65px !important;
    min-width: 65px;
    margin: 0 !important;
  }

  .product-card__body {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 0 0 12px !important;
    margin: 0 !important;
    gap: 8px;
  }

  /* Distribución vertical del bloque central de textos */
  .product-card__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex-grow: 1;
    text-align: left;
    min-height: auto !important; /* Eliminamos el alto mínimo que rompía la simetría vertical en móvil */
  }

  .product-card__name {
    font-size: 13px !important;
    line-height: 1.3;
    margin: 0 0 4px 0 !important;
    font-weight: 600;
    color: #333;
    max-width: 140px;
    min-height: auto !important;
  }

  .product-card__price-row {
    font-size: 15px !important;
    margin: 0 !important;
    font-weight: 700;
  }

  /* Bloque de Controles alineado perfectamente a la derecha */
  .product-card__controls {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 6px !important;
    min-width: 85px;
    margin: 0 !important;
  }

  .qty-stepper {
    scale: 0.85;
    margin: 0 !important;
    transform-origin: right center;
  }

  .btn-add {
    padding: 6px 10px !important;
    font-size: 11px !important;
    width: 100% !important;
    max-width: 85px;
    text-align: center;
    border-radius: 4px;
    box-sizing: border-box;
    margin: 0 !important;
  }
}
