/* ==============================================================
   STORE.CSS — TuEstilo
   Catálogo de Tiendas, Store Cards, Artist Detail
   ============================================================== */

/* ── Store Card: layout vertical (imagen arriba / contenido abajo) ── */
.store-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 20px rgba(0,0,0,0.09);
  border: 1px solid #e5e5ea;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  max-width: 300px;
  width: 100%;
}

.store-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.14);
  transform: translateY(-3px);
  border-color: #d4d4d8;
}

.store-card:active {
  transform: translateY(0);
}

.store-card.store-card--closed {
  cursor: default;
  opacity: 0.68;
}

.store-card.store-card--closed:hover {
  transform: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ── Imagen (arriba, full width) ── */
.store-card__image-wrap {
  flex: none;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  aspect-ratio: 3 / 2;
}

.store-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.store-card:hover .store-card__image-wrap img {
  transform: scale(1.06);
}

.store-card__image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
}

/* ── Badge de rating (oculto, se usa estrellas inline) ── */
.store-card__rating-badge {
  display: none;
}

/* ── Cuerpo (debajo de la imagen) ── */
.store-card__body {
  flex: 1;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── Nombre ── */
.store-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.store-card__title--short {
  font-size: 17px;
}
.store-card__title--long {
  font-size: 14px;
  line-height: 1.2;
}

/* ── Estrellas + rating ── */
.store-card__stars {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 14px;
  margin: 0;
}

.store-card__stars .s-fill { color: #f59e0b; font-size: 14px; }
.store-card__stars .s-empty { color: #d1d5db; }
.store-card__stars .s-num {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-left: 2px;
}

.store-card__stars .s-reviews {
  font-size: 12.5px;
  color: #374151;
  font-weight: 400;
  margin-left: 1px;
}

/* ── Ubicación ── */
.store-card__location {
  font-size: 13px;
  color: #1e293b;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-weight: 500;
  background: none;
  padding: 0;
  border-radius: 0;
}

.store-card__location svg {
  flex-shrink: 0;
  color: #ef4444;
  width: 12px;
  height: 12px;
}

/* ── Fila inferior: ubicación + botón en la misma línea ── */
.store-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}

/* ── Botón Reservar (compacto, sólido, al lado de ubicación) ── */
.store-card__reserve-btn {
  padding: 6px 16px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.store-card__reserve-btn:hover {
  background: #1d4ed8;
}

/* ── Tienda cerrada ── */
.store-card__closed-label {
  padding: 6px 14px;
  background: #f3f4f6;
  color: #9ca3af;
  border-radius: 18px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  flex-shrink: 0;
}


/* ── Tags (etiquetas) en cards del catálogo ── */
.store-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px 0;
}

.store-card__tag {
  font-size: 12px;
  font-weight: 500;
  color: #2563eb;
  background: #dbeafe;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.store-card__tag-icon {
  flex-shrink: 0;
  color: #3b82f6;
}

/* Ocultar a partir de la 3ra tag por defecto (n+3 = 3ro, 4to, etc.),
   pero NO ocultar el botón toggle que siempre queremos que se vea si existe. */
.store-card__tag:nth-child(n+3):not(.store-card__tag--toggle) {
  display: none;
}

/* Cuando está expandido, mostrar todo */
.store-card__tags.is-expanded .store-card__tag {
  display: inline-flex !important;
}

/* Estilos del botón toggle (+N ▾ / ▴) */
.store-card__tag--toggle {
  background: #f3f4f6;
  color: #4b5563;
  border: none;
  cursor: pointer;
}

.store-card__tag--toggle .t-more,
.store-card__tag--toggle .t-less {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Por defecto, t-less (▴) está oculto */
.store-card__tag--toggle .t-less {
  display: none;
}

/* Al expandir, ocultamos t-more (+N ▾) y mostramos t-less (▴) */
.store-card__tags.is-expanded .store-card__tag--toggle .t-more {
  display: none;
}

.store-card__tags.is-expanded .store-card__tag--toggle .t-less {
  display: inline-flex;
}

/* ── Tags en el modal de edición ── */
.store-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  animation: tagIn 0.15s ease;
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.store-tag-pill__text {
  line-height: 1;
}

.store-tag-pill__remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #bfdbfe;
  border: none;
  color: #1e40af;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.15s;
}

.store-tag-pill__remove:hover {
  background: #93c5fd;
}

/* ── Sugerencias rápidas ── */
.store-tag-suggestion {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1.5px dashed #cbd5e1;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.store-tag-suggestion:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}

/* ── MÓVIL: cards verticales (imagen arriba, texto abajo) ── */
@media (max-width: 639px) {
  .store-card {
    flex-direction: column !important;
    max-width: 180px !important;
  }
  .store-card__image-wrap {
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
  }
  .store-card__body {
    padding: 8px 10px 10px !important;
    gap: 2px !important;
    align-items: flex-start !important;
    text-align: left !important;
  }
  .store-card__title {
    font-size: 14px !important;
    line-height: 1.2 !important;
    -webkit-line-clamp: 2 !important;
    text-align: left !important;
  }
  .store-card__stars {
    font-size: 13px !important;
    justify-content: flex-start !important;
  }
  .store-card__stars .s-fill { font-size: 13px !important; }
  .store-card__stars .s-num {
    font-size: 13px !important;
    color: #1e293b !important;
  }
  .store-card__stars .s-reviews {
    font-size: 12px !important;
    color: #4b5563 !important;
  }
  /* Tags en una sola línea para que la flecha quede al lado */
  .store-card__tags {
    gap: 3px !important;
    flex-wrap: nowrap !important;
    overflow: hidden !important;
  }
  /* Al expandir, permitir wrap */
  .store-card__tags.is-expanded {
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
  .store-card__tag {
    font-size: 11px !important;
    padding: 2px 7px !important;
  }
  /* Ocultar íconos SVG en móvil para que todo quepa */
  .store-card__tag-icon {
    display: none !important;
  }
  .store-card__tag--toggle {
    flex-shrink: 0 !important;
  }
  /* Ubicación: oscura, inteligente (1 línea si cabe, 2 si no) */
  .store-card__location {
    font-size: 12px !important;
    padding: 0 !important;
    background: none !important;
    color: #374151 !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    overflow: visible !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  .store-card__location svg {
    color: #4b5563 !important;
  }
  .store-card__footer {
    margin-top: 1px !important;
    gap: 4px !important;
    align-items: flex-end !important;
  }
  .store-card__reserve-btn {
    padding: 4px 10px !important;
    font-size: 10px !important;
    border-radius: 12px !important;
  }
  .store-card__closed-label {
    align-self: flex-end !important;
  }
}

/* Header principal: flotante minimalista, por debajo del sidebar */
/* Cuando hay un modal abierto, ocultar header y flecha Volver para que no tapen el título del modal */
body.modal-overlay-open .app-header,
body.modal-overlay-open .store-back-fab {
  visibility: hidden;
  pointer-events: none;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(60px + env(safe-area-inset-top, 0px));
  min-height: calc(60px + env(safe-area-inset-top, 0px));
  background-color: var(--color-surface);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 16px 0 16px;
  color: #0052cc !important;
  /* Azul primario de marca (brand.blue) */
  transform: translateZ(0);
  /* Capa de composición: evita que el header "desaparezca" en Chrome móvil al cambiar el viewport (scroll/teclado) */
  backface-visibility: hidden;
}

.app-header *,
.app-header i,
.app-header button,
.app-header svg,
.app-header .menu-icon,
.app-header .brand,
.app-header .mobile-menu-btn,
.app-header .mobile-menu-btn svg {
  color: #0052cc !important;
  stroke: #0052cc !important;
  fill: none !important;
}

.app-header svg {
  stroke: #0052cc !important;
}

@media (min-width: 768px) {
  .app-header {
    left: 16rem;
    width: calc(100% - 16rem);
  }
}

/* Espaciado seguro: contenido debajo del header fijo (60px header + aire visible para título "Tiendas Disponibles") */
.main-content-wrap {
  padding-top: calc(100px + env(safe-area-inset-top, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Panels que van pegados al header (sin padding-top extra) */
#panel-mensajes,
#panel-gestion-reservas,
#panel-gestion-staff,
#user-profile-section,
#admin-dashboard-view,
#super-admin-section {
  padding-top: 0 !important;
  margin-top: calc(-40px - env(safe-area-inset-top, 0px));
}

/* Pie de página: barra delgada, altura mínima, texto centrado (no fijo, al final del flujo) */
.app-footer {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  margin-top: 0.5rem;
  min-height: auto;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Catálogo: padding superior extra para que el título "Tiendas Disponibles" no quede tapado por el header (el div es absolute, no hereda el padding del wrap) */
#welcome-state {
  padding-top: calc(5rem + env(safe-area-inset-top, 0px));
  /* 80px + safe-area: título "Tiendas Disponibles" siempre visible y con aire bajo el header TuEstilo */
}

.mobile-header {
  display: flex;
  align-items: center;
}

.mobile-menu-btn {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  padding: 0;
}

/* Sidebar: overlay y panel por encima del header (jerarquía correcta) */
