/* ==============================================================================
   GUARDALIBRE STOREFRONT - CATÁLOGO PÚBLICO PARA CLIENTES (PROMAX DESIGN)
   ============================================================================== */

:root {
  --store-primary: #2563eb;
  --store-primary-hover: #1d4ed8;
  --store-primary-light: #eff6ff;
  --store-accent: #16a34a;
  --store-bg: #f8fafc;
  --store-surface: #ffffff;
  --store-text-main: #0f172a;
  --store-text-muted: #64748b;
  --store-text-subtle: #94a3b8;
  --store-border: #e2e8f0;
  --store-radius: 12px;
  --store-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --store-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --store-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--store-bg);
  color: var(--store-text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header de la Tienda */
.store-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--store-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--store-shadow-sm);
}

.store-header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.store-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.store-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--store-border);
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.store-title-wrap {
  min-width: 0;
}

.store-title-wrap h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--store-text-main);
  line-height: 1.25;
}

.store-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #15803d;
  background: #f0fdf4;
  padding: 1.5px 7px;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
  white-space: nowrap;
  flex-shrink: 0;
}

.store-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-contact-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #25d366;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(37, 211, 102, 0.2);
}

.btn-contact-whatsapp:hover {
  background: #1eb857;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
}

.btn-cart-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #1e293b;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.btn-cart-trigger:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);
}

.btn-cart-trigger svg {
  stroke: #ffffff;
}

.cart-count-badge {
  background: #ffe600;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 9999px;
  min-width: 19px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Banner de la Tienda */
.store-hero {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  padding: 32px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.store-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 120%, rgba(37, 99, 235, 0.25), transparent 70%);
  pointer-events: none;
}

.store-hero-content {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.store-hero-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.store-hero-content p {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

/* Barra de Búsqueda y Filtros */
.store-search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 10px;
  padding: 4px 14px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.store-search-box svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.store-search-box input {
  width: 100%;
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--store-text-main);
  background: transparent;
}

/* Categorías PillTabs */
.store-categories-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--store-border);
  padding: 10px 20px;
  position: sticky;
  top: 69px;
  z-index: 90;
}

.store-categories-list {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.store-categories-list::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  border: 1px solid var(--store-border);
  background: #ffffff;
  color: var(--store-text-muted);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.cat-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.cat-pill.active svg {
  stroke: #ffffff;
}

.cat-count-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  margin-left: 2px;
}

.cat-pill.active .cat-count-chip {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Barra de Resumen de Productos y Filtros */
.store-products-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 2px;
}

.store-products-bar .count-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--store-text-muted);
  letter-spacing: 0.2px;
}

.store-products-bar .currency-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #15803d;
  background: #f0fdf4;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Cuadrícula de Productos */
.store-main-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 20px;
  flex: 1;
  width: 100%;
}

.store-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Tarjeta de Producto */
.store-card {
  background: var(--store-surface);
  border: 1px solid var(--store-border);
  border-radius: var(--store-radius);
  overflow: hidden;
  box-shadow: var(--store-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--store-shadow-md);
  border-color: #cbd5e1;
}

.store-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--store-border);
}

.store-card-img-wrap.aspect-4-5 {
  aspect-ratio: 4 / 5;
}

.store-card-img-wrap img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.store-card:hover .store-card-img-wrap img {
  transform: scale(1.05);
}

.store-card-badge-stock {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.store-card-badge-stock.in-stock {
  color: #166534;
  border: 1px solid #bbf7d0;
}

.store-card-badge-stock.low-stock {
  color: #854d0e;
  border: 1px solid #fef08a;
}

.store-card-badge-stock.out-of-stock {
  color: #991b1b;
  border: 1px solid #fecaca;
}

.store-card-badge-photos {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 5;
  backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.store-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.store-card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--store-primary);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.store-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--store-text-main);
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.store-card-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 6px;
}

.store-card-sku {
  font-family: monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

.store-card-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.store-badge-delivery {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.store-badge-delivery.badge-immediate {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.store-badge-delivery.badge-on-order {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.store-badge-payment {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}

.store-badge-payment.sin_anticipo {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.store-badge-payment.anticipo {
  background: #faf5ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.store-badge-payment.pago_completo {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.store-card-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.store-card-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--store-text-main);
}

.store-card-currency {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--store-text-muted);
  margin-left: 3px;
}

.btn-add-to-cart {
  width: 100%;
  background: #ffe600;
  color: #0f172a;
  border: 1px solid #facc15;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-add-to-cart svg {
  stroke: #0f172a;
}

.btn-add-to-cart:hover {
  background: #facc15;
  border-color: #eab308;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(250, 204, 21, 0.35);
}

.btn-add-to-cart:active {
  transform: scale(0.98);
}

.btn-add-to-cart:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-add-to-cart:disabled svg {
  stroke: #94a3b8;
}

.btn-cart-text-mobile {
  display: none;
}

.btn-cart-text-desktop {
  display: inline;
}

/* Drawer del Carrito */
.cart-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer-overlay.active .cart-drawer {
  right: 0;
}

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

.cart-drawer-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--store-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

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

.cart-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--store-border);
  border-radius: 8px;
  background: #f8fafc;
}

.cart-item-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--store-border);
}

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

.cart-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--store-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--store-primary);
  margin-top: 2px;
}

.cart-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--store-border);
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-num {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* Footer y Checkout */
.cart-drawer-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--store-border);
  background: #ffffff;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.cart-total-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--store-text-muted);
}

.cart-total-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--store-text-main);
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.checkout-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--store-border);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

.checkout-input:focus {
  border-color: var(--store-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.checkout-phone-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.checkout-country-select {
  flex: 0 0 135px;
  max-width: 145px;
  padding: 9px 8px;
  border-radius: 6px;
  border: 1px solid var(--store-border);
  font-size: 0.80rem;
  font-weight: 600;
  font-family: inherit;
  background-color: #ffffff;
  color: var(--store-text-main);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.checkout-country-select:focus {
  border-color: var(--store-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.checkout-phone-input {
  flex: 1;
  min-width: 0;
}

.btn-share-product-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-share-product-link:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-share-product-link.copied {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}

.store-toast-message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

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

.btn-submit-order-whatsapp {
  width: 100%;
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-submit-order-whatsapp:hover {
  background: #1eb857;
  transform: translateY(-1px);
}

/* Footer de la página */
.store-footer {
  background: #ffffff;
  border-top: 1px solid var(--store-border);
  padding: 24px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--store-text-muted);
  margin-top: auto;
}

/* Modal de Confirmación de Pedido */
.order-success-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.order-success-card {
  background: #ffffff;
  max-width: 460px;
  width: 100%;
  border-radius: 16px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: var(--store-shadow-lg);
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVIDAD PROMAX CANONIZADA (ESCRITORIO, TABLET Y MÓVIL)
   ========================================================================== */

/* 1. TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  .store-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }

  .store-main-container {
    padding: 0 16px;
    margin: 18px auto;
  }

  .store-hero {
    padding: 24px 16px;
  }

  .cart-drawer {
    max-width: 380px;
  }
}

/* 2. TABLET VERTICAL Y MÓVIL (< 768px) */
@media (max-width: 768px) {
  .btn-cart-text-desktop {
    display: none;
  }
  .btn-cart-text-mobile {
    display: inline;
  }

  .store-header-container {
    padding: 10px 14px;
    gap: 10px;
  }

  .store-brand {
    gap: 8px;
  }

  .store-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .store-title-wrap h1 {
    font-size: 0.98rem;
    line-height: 1.2;
  }

  .store-badge-verified {
    font-size: 0.65rem;
    padding: 1px 6px;
  }

  .btn-contact-whatsapp span {
    display: none;
  }

  .btn-contact-whatsapp {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 10px;
  }

  .btn-cart-trigger {
    height: 38px;
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
    gap: 6px;
    border-radius: 10px;
  }

  .btn-cart-trigger .btn-cart-label {
    display: none;
  }

  .store-hero {
    padding: 18px 14px 20px 14px;
  }

  .store-hero-content h2 {
    font-size: 1.25rem;
    margin-bottom: 3px;
  }

  .store-hero-content p {
    font-size: 0.82rem;
    margin-bottom: 12px;
  }

  .store-search-box {
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
  }

  .store-categories-bar {
    top: 59px;
    padding: 8px 14px;
  }

  .store-categories-list {
    gap: 7px;
  }

  .cat-pill {
    padding: 5px 12px;
    font-size: 0.78rem;
    min-height: 32px;
  }

  .store-main-container {
    padding: 0 14px;
    margin: 14px auto;
  }

  .store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  /* Vitrina Destacada cuando hay 1 producto */
  .store-products-grid > .store-card:only-child {
    grid-column: 1 / -1;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  .store-products-grid > .store-card:only-child .store-card-body {
    padding: 14px 16px 16px 16px;
  }

  .store-products-grid > .store-card:only-child .store-card-title {
    font-size: 0.95rem;
    height: auto;
    max-height: none;
    -webkit-line-clamp: 3;
    margin-bottom: 8px;
  }

  .store-products-grid > .store-card:only-child .store-card-price {
    font-size: 1.45rem;
  }

  .store-products-grid > .store-card:only-child .btn-add-to-cart {
    padding: 11px 16px;
    font-size: 0.88rem;
    min-height: 44px;
  }

  .store-products-grid > .store-card:only-child .btn-cart-text-mobile {
    display: none !important;
  }

  .store-products-grid > .store-card:only-child .btn-cart-text-desktop {
    display: inline !important;
  }

  .cart-drawer {
    width: 100%;
    max-width: 100%;
    right: -100%;
  }
}

/* 3. MÓVIL PEQUEÑO (< 480px - ANDROID & IPHONE) */
@media (max-width: 480px) {
  .store-header-container {
    padding: 8px 12px;
    gap: 8px;
  }

  .store-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .store-title-wrap h1 {
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: 135px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .store-badge-verified {
    font-size: 0.62rem;
    padding: 1px 5px;
  }

  #store-location-text {
    font-size: 0.66rem !important;
  }

  .store-actions {
    gap: 6px;
  }

  .btn-contact-whatsapp {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 9px;
  }

  .btn-cart-trigger {
    height: 36px;
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.78rem;
    gap: 5px;
    border-radius: 9px;
  }

  .cart-count-badge {
    font-size: 0.68rem;
    padding: 1px 5px;
    min-width: 17px;
  }

  .store-hero {
    padding: 14px 12px 16px 12px;
  }

  .store-hero-content h2 {
    font-size: 1.1rem;
    margin-bottom: 2px;
  }

  .store-hero-content p {
    font-size: 0.76rem;
    margin-bottom: 10px;
    line-height: 1.35;
  }

  .store-search-box {
    height: 40px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .store-search-box input {
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .store-categories-bar {
    top: 53px;
    padding: 7px 10px;
  }

  .store-categories-list {
    gap: 6px;
  }

  .cat-pill {
    padding: 4px 10px;
    font-size: 0.74rem;
    min-height: 30px;
    gap: 4px;
  }

  .cat-count-chip {
    font-size: 0.65rem;
    padding: 0.5px 5px;
  }

  .store-main-container {
    padding: 0 10px;
    margin: 12px auto;
  }

  .store-products-bar {
    margin-bottom: 10px;
  }

  .store-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  /* Vitrina Destacada cuando hay 1 producto en móvil pequeño */
  .store-products-grid > .store-card:only-child {
    grid-column: 1 / -1;
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
  }

  .store-card {
    border-radius: 11px;
  }

  .store-card-img-wrap {
    border-radius: 11px 11px 0 0;
    padding: 8px;
  }

  .store-card-badge-stock {
    top: 5px;
    left: 5px;
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 9999px;
  }

  .store-card-badge-photos {
    top: 5px;
    right: 5px;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 9999px;
  }

  .store-card-body {
    padding: 8px 7px 9px 7px;
  }

  .store-card-meta-header {
    margin-bottom: 3px;
  }

  .store-card-category {
    font-size: 0.62rem;
    letter-spacing: 0.3px;
  }

  .store-card-sku {
    font-size: 0.58rem;
    padding: 0.5px 4px;
    max-width: 85px;
  }

  .store-card-title {
    font-size: 0.76rem;
    line-height: 1.32;
    min-height: 2.64em;
    max-height: 2.64em;
    height: auto;
    margin-bottom: 5px;
  }

  .store-card-conditions {
    gap: 3px;
    margin-bottom: 5px;
  }

  .store-badge-delivery {
    font-size: 0.62rem;
    padding: 2px 5px;
    border-radius: 5px;
  }

  .store-badge-payment {
    font-size: 0.6rem;
    padding: 1.5px 4px;
    border-radius: 4px;
  }

  .store-card-price-row {
    margin-bottom: 5px;
  }

  .store-card-price {
    font-size: 1.12rem;
  }

  .store-card-currency {
    font-size: 0.64rem;
  }

  .btn-add-to-cart {
    padding: 7px 5px;
    font-size: 0.76rem;
    min-height: 35px;
    border-radius: 8px;
    gap: 4px;
  }

  .product-gallery-modal-card {
    padding: 14px 12px;
    border-radius: 14px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-gallery-main-view {
    height: 220px !important;
  }

  .order-success-card {
    padding: 20px 14px;
    border-radius: 14px;
  }
}

/* Modal de Galería de Fotos de Producto */
.product-gallery-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.product-gallery-modal-card {
  background: #ffffff;
  border-radius: var(--store-radius);
  max-width: 520px;
  width: 100%;
  padding: 20px;
  box-shadow: var(--store-shadow-lg);
  animation: modalEnter 0.2s ease-out;
}

.modal-gallery-thumb-btn {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  border: 2px solid var(--store-border);
  padding: 2px;
  background: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.modal-gallery-thumb-btn.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.2);
}

.modal-gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Dots interactivos en la tarjeta de producto */
.card-gallery-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  z-index: 5;
}

.card-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-gallery-dot.active {
  background: #0f172a;
  width: 14px;
  border-radius: 4px;
}

/* Candadito Fantasma al Pie de Página (Ultra Discreto Gris y Blanco) */
.btn-ghost-footer-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  opacity: 0.22;
  text-decoration: none;
  background: transparent;
  border-radius: 4px;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
  vertical-align: middle;
}

.btn-ghost-footer-lock:hover {
  opacity: 0.85;
  color: #475569;
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.1);
}

