/* ===================================================
   URBAN FASHION - PWA Mobile-First Stylesheet (style.css)
   Clean, Minimalist, Native App Feel
   Palette: Blanco, Negro, Grises Neutros
   =================================================== */

:root {
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #121212;
  --text-secondary: #6e6e73;
  --text-muted: #8e8e93;
  --border-subtle: #e5e5ea;
  --accent-black: #000000;
  --accent-light: #f2f2f7;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --header-height: 60px;
  --bottom-nav-height: 66px;
  --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: #eef0f3;
  font-family: var(--font-stack);
  color: var(--text-primary);
  line-height: 1.4;
  overflow-x: hidden;
}

/* Contenedor central simulador de dispositivo móvil en Desktop, 100% en Mobile */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--bg-main);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

/* ===================================================
   HEADER FIJO SUPERIOR
   =================================================== */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--accent-black);
}

.header-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--accent-black);
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.header-action-btn:active {
  background-color: var(--accent-light);
  transform: scale(0.94);
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--accent-black);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.bump {
  transform: scale(1.3);
}

/* ===================================================
   CONTENIDO PRINCIPAL (CATÁLOGO)
   =================================================== */
.main-content {
  flex: 1;
  padding-top: calc(var(--header-height) + 16px);
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
  padding-left: 16px;
  padding-right: 16px;
  overflow-y: auto;
}

.section-intro {
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Grid de 2 columnas */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* Tarjeta de Producto */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.product-card:active {
  transform: scale(0.985);
}

.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.15;
  background-color: var(--accent-light);
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.product-card:hover .product-image {
  transform: scale(1.03);
}

/* Botón flotante para favorito */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, color 0.2s ease;
}

.favorite-btn:active {
  transform: scale(0.88);
}

.favorite-btn.active {
  color: #e63946;
}

.favorite-btn.active svg {
  fill: #e63946;
}

/* Información del Producto */
.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-black);
  margin-bottom: 10px;
}

.product-btn-details {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-black);
  color: #ffffff;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
  transition: background-color 0.15s ease, transform 0.12s ease;
}

.product-btn-details:active {
  background-color: #2b2b2b;
  transform: scale(0.97);
}

/* ===================================================
   BARRA DE NAVEGACIÓN INFERIOR (BOTTOM NAV)
   =================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-nav-height);
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 16px;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 3px;
  padding: 8px 16px;
  border-radius: 12px;
  transition: color 0.2s ease, transform 0.15s ease;
  flex: 1;
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--accent-black);
}

.nav-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.1px;
}

/* ===================================================
   MODAL DE DETALLES DEL PRODUCTO (BOTTOM SHEET NATIVO)
   =================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 20px 24px 32px 24px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.modal-backdrop.open .modal-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border-subtle);
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-close-btn {
  background: var(--accent-light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

.modal-img {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-bottom: 16px;
  background-color: var(--accent-light);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-black);
}

.modal-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-black);
  margin: 6px 0 12px 0;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-add-btn {
  width: 100%;
  padding: 14px;
  background-color: var(--accent-black);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.12s ease;
}

.modal-add-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* Toast de notificación estilo iOS */
.toast-notification {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background-color: rgba(18, 18, 18, 0.94);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ===================================================
   VISTA DEL CARRITO DE COMPRAS (.cart-view)
   =================================================== */
.cart-view {
  flex: 1;
  padding-top: calc(var(--header-height) + 14px);
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
  padding-left: 16px;
  padding-right: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cart-view[hidden] {
  display: none !important;
}

.cart-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cart-back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.cart-back-btn:active {
  color: var(--accent-black);
}

.cart-items-count {
  font-size: 0.78rem;
  font-weight: 700;
  background-color: var(--accent-light);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 20px;
}

.cart-title-section {
  margin-bottom: 18px;
}

.cart-main-heading {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--accent-black);
}

.cart-subheading {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Lista de artículos en el carrito */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.cart-item-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-item-thumb {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--accent-light);
  flex-shrink: 0;
}

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

.cart-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.cart-item-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background-color: var(--accent-light);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

.cart-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 6px;
}

.cart-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-black);
}

.cart-item-qty {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--accent-light);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Tarjeta de Resumen y Totales */
.cart-summary {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 18px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.summary-label {
  color: var(--text-secondary);
}

.summary-val {
  font-weight: 600;
  color: var(--text-primary);
}

.summary-free {
  color: #1ebe5d;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.summary-divider {
  height: 1px;
  background-color: var(--border-subtle);
  margin: 12px 0;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.total-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-black);
}

.total-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-black);
  letter-spacing: -0.3px;
}

/* Contenedor y Botón Verde de WhatsApp */
.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.btn-whatsapp {
  width: 100%;
  background-color: #25D366;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.38);
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-whatsapp:active {
  background-color: #1ebe5d;
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.25);
}

.whatsapp-icon {
  flex-shrink: 0;
}

.cart-guarantee-note {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

