/*
 * Hoja de estilos para la presentación de la colección Daphne Ibiza.
 * Se utilizan tonos oscuros y tierra para transmitir elegancia y calidez.
 */

/* Variables de color para facilitar cambios de paleta */
:root {
  --color-bg: #0f0d0c;
  /* fondo general, casi negro */
  --color-card: #1e1b19;
  /* fondo de tarjetas */
  --color-accent: #cdb59e;
  /* tono púrpura terroso, inspirado en las prendas */
  --color-highlight: #cdb59e;
  /* tono beige claro para títulos y detalles */
  --color-text: #f5f5f5;
  /* texto principal */
  --color-muted: #b2a79a;
  /* texto secundario */

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
}

/* Reset básico y tipografía */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Courier New", monospace;
  /* toque typewriter */
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.logo {
  height: 50px;
  width: auto;
}

.language-selector select {
  background-color: var(--color-card);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Botón de usuario */
.user-button {
  background: transparent;
  border: none;
  color: var(--color-text);
  padding: 0.55rem 0.9rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.user-button:hover {
  background-color: var(--color-card);
}

/* Botón de pedido/carrito */
.cart-button {
  background-color: var(--color-accent);
  border: none;
  color: var(--color-bg);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.cart-button:hover {
  background-color: var(--color-highlight);
  color: var(--color-text);
  transform: translateY(1px);
}

/* Lista de tallas y colores (selección) */
.size-list li.selected {
  background-color: white;
  color: var(--color-bg);
}

.color-list li.selected {
  background-color: white;
  color: var(--color-bg);
  border-radius: 25px;
}

/* Contenedor de productos del carrito */
.cart-items-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background-color: var(--color-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.cart-item-left {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.cart-thumb {
  width: 72px;
  height: 108px;
  /* 2:3 */
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Controles de cantidad en el carrito */
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.qty-btn {
  background-color: var(--color-accent);
  border: none;
  color: var(--color-text);
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  line-height: 28px;
  text-align: center;
}

.qty-btn:hover {
  background-color: var(--color-highlight);
  color: var(--color-bg);
}

.qty-number {
  font-size: 0.95rem;
  color: var(--color-text);
}

.cart-item-name {
  font-weight: 700;
  color: var(--color-highlight);
  letter-spacing: 0.06em;
}

.cart-item-info {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.cart-item-price {
  font-size: 1rem;
  color: var(--color-accent);
  margin-top: 0.25rem;
}

.remove-item {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 1rem;
  align-self: flex-start;
}

.remove-item:hover {
  color: var(--color-highlight);
}

.cart-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Formulario de checkout */
.checkout-content {
  padding: 1.25rem 1.5rem;
}

.checkout-content .form-logo img {
  height: 36px;
}

/* logo más pequeño en checkout */
.checkout-content .modal-name {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  margin-bottom: 0.75rem;
}

.checkout-form.checkout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.25rem;
  row-gap: 0.9rem;
  margin-top: 0.25rem;
}

.checkout-form .grid-span-2 {
  grid-column: 1 / -1;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  /* más redondeado (pill) */
  background-color: var(--color-card);
  color: var(--color-text);
  font-size: 0.95rem;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-icon {
  flex-shrink: 0;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--color-highlight);
}

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}

/* Para móviles/vertical muy estrecho, caer a 1 columna */
@media (max-width: 820px) {
  .checkout-form.checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-form .grid-span-2 {
    grid-column: auto;
  }
}

/* Portada (hero) */
.hero-section {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(rgba(15, 13, 12, 0.85), rgba(15, 13, 12, 0.85)),
    url('images/portada.webp') center/cover no-repeat;
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.hero-content {
  text-transform: uppercase;
}

.hero-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-highlight);
}

/* Descripción portada */
.hero-description {
  color: var(--color-muted);
}

.hero-description p+p {
  margin-top: 0.9rem;
}

.hero-description strong {
  color: var(--color-text);
}

/* Botón único con flecha hacia abajo */
.down-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-top: 1.25rem;
  border-radius: 9999px;
  background-color: var(--color-accent);
  color: var(--color-text);
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background-color 0.25s ease;
}

.down-button:hover {
  background-color: var(--color-highlight);
  color: var(--color-bg);
  transform: translateY(2px);
}

.down-button .icon {
  width: 24px;
  height: 24px;
}

/* Botones genéricos */
.cta-button {
  padding: 0.75rem 1.55rem;
  font-size: 1rem;
  text-decoration: none;
  background-color: var(--color-accent);
  color: black;
  border-radius: 9999px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  margin-top: 20px;
}

.cta-button:hover {
  background-color: var(--color-highlight);
  color: white;
  transform: translateY(1px);
}

/* Secciones de categoría */
.category-section {
  padding: 3rem 2rem;
  background-color: var(--color-bg);
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--color-highlight);
  text-transform: uppercase;
}

/* Cuadrícula de productos */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tarjeta de producto (2:3 para no cortar cabezas) */
.product-card {
  background-color: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.product-image {
  width: 100%;
  aspect-ratio: 2 / 3;
  /* fotos 1280x1920 */
  object-fit: cover;
}

.product-info {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  text-transform: capitalize;
}

.product-price {
  font-size: 0.95rem;
  color: var(--color-accent);
}

/* Modal genérico */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 2000;
}

#image-preview-modal {
  z-index: 3000;
}

/* siempre por encima del carrito */
.product-modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--color-card);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
  gap: 1.5rem;
}

/* Carrito y checkout apilados */
.cart-content,
.checkout-content {
  display: flex;
  flex-direction: column;
}

/* Ficha de producto */
.product-content {
  display: flex;
  flex-direction: row;
  gap: 2rem;
}

.product-content .modal-left {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-content .modal-details {
  flex: 1;
}

/* Miniaturas */
.product-content .modal-thumbnails {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* Responsive: apilar ficha en móvil */
@media (max-width: 768px) {
  .product-content {
    flex-direction: column;
  }

  .product-content .modal-left,
  .product-content .modal-details {
    flex: auto;
  }
}

/* Modal de previsualización de imagen grande */
.image-preview-content {
  max-width: 95vw;
  max-height: 95vh;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

#image-preview-modal .close-modal {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--color-highlight);
  cursor: pointer;
}

#image-preview-modal .close-modal:hover {
  color: var(--color-accent);
}

.preview-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transform-origin: center center;
  /* zoom desde centro */
  cursor: grab;
}

/* Modal de éxito */
.success-content {
  max-width: 420px;
  width: 90%;
  text-align: center;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--color-card);
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* -------------------------------------------------------------------------
 * Fonts and icons
 * -----------------------------------------------------------------------*/
.material-icon {
  font-family: 'Material Icons Outlined';
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-variant-ligatures: contextual;
}

/* -------------------------------------------------------------------------
 * Success modal
 * -----------------------------------------------------------------------*/
.success-icon {
  font-size: 3rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  background-color: var(--color-bg);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------------------------------------------------------
 * Form layout helpers
 * -----------------------------------------------------------------------*/
.form-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.form-row .form-field {
  flex: 1;
}

/* Logo del formulario */
.form-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.form-logo img {
  height: 46px;
  width: auto;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--color-highlight);
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--color-accent);
}

/* Imagen principal en modal producto */
.modal-image-container {
  width: 100%;
  max-height: 75vh;
  /* más altura para fotos verticales */
  overflow: hidden;
}

.modal-image {
  width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Miniaturas bajo la imagen principal */
.modal-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: center;
}

.modal-thumbnail-img {
  width: 70px;
  height: 105px;
  /* 2:3 coherente */
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.modal-thumbnail-img:hover {
  transform: scale(1.05);
  border-color: var(--color-accent);
}

.modal-thumbnail-img.active {
  border-color: var(--color-accent);
}

.modal-details {
  color: var(--color-text);
}

.modal-name {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--color-highlight);
}

.modal-description {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-muted);
  white-space: pre-line;
}

.modal-price {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
  margin-top: 1rem;
}

.modal-section {
  margin-bottom: 1rem;
}

.modal-section h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-highlight);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.size-list,
.color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.size-list li {
  background-color: var(--color-bg);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  border: 1px solid var(--color-accent);
}

.color-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  padding-right: 7px;
}

/* Swatches en rectángulo 100x29 (con imagen o color plano) */
.color-swatch {
  width: 100px;
  height: 29px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .85);
  flex-shrink: 0;

  /* para imágenes */
  background-color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Responsividad básica */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 0.98rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .modal-name {
    font-size: 1.5rem;
  }

  /* checkout grid 2 columnas ya en iPad vertical */
  .checkout-form {
    grid-template-columns: 1fr 1fr;
  }

  .checkout-form .full-span {
    grid-column: 1 / -1;
  }
}

/* Ajustes para tablets (p. ej. iPad) en vertical y móviles */
@media (min-width: 900px) {
  .checkout-form {
    grid-template-columns: 1fr 1fr;
  }

  .checkout-form .full-span {
    grid-column: 1 / -1;
  }
}

/* Móviles muy pequeños */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-thumbnails {
    justify-content: center;
    flex-wrap: wrap;
  }

  .modal-thumbnail-img {
    width: 60px;
    height: 90px;
  }
}

/* ----------------------------
 * HERO: lectura y tipografías
 * ---------------------------- */
.hero-content {
  /* anula el uppercase global del hero */
  text-transform: none;
  max-width: 980px;
  padding: 2rem 1.25rem;
}

.hero-title {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: clamp(1.8rem, 4.6vw, 2.6rem);
}

.hero-description {
  font-size: clamp(.8rem, 2.0vw, 0.9rem);
  line-height: 1.75;
  margin-inline: auto;
  max-width: 1200px;
  text-transform: uppercase;
}

/* ----------------------------
 * Ajustes móviles (≤480px)
 * ---------------------------- */
@media (max-width: 480px) {

  /* Cabecera más compacta */
  .site-header {
    padding: .6rem .9rem;
    gap: .6rem;
  }

  .logo {
    height: 34px;
  }

  .language-selector select {
    font-size: .85rem;
    padding: .25rem .55rem;
  }

  .cart-button {
    padding: .45rem .8rem;
    font-size: .9rem;
  }

  /* Hero fluido y con más overlay para legibilidad */
  .hero-section {
    height: auto;
    min-height: 78vh;
    padding-top: 64px;
    /* deja sitio al header sticky */
    padding-bottom: 16px;
    background-image:
      linear-gradient(rgba(15, 13, 12, .9), rgba(15, 13, 12, .9)),
      url('images/portada.webp');
  }

  .hero-content {
    padding: 1rem 1rem;
  }

  .down-button {
    width: 48px;
    height: 48px;
    margin-top: .75rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  /* Catálogo en dos columnas en móviles normales */
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Teléfonos muy estrechos (p. ej. 320–360px) */
@media (max-width: 360px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Opcional: ocultar el acceso admin flotante en móvil para que no tape contenido */
@media (max-width: 600px) {
  .admin-link {
    display: none;
  }
}

/* Badges de materiales sostenibles dentro de la descripción del modal */
.modal-description .material-badge {
  border-radius: 8px;
  vertical-align: middle;
  background: #fff;
  /* los logos se leen mejor sobre fondo claro */
  padding: 2px 6px;
  margin: 0 .25rem;
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

/* Sellos de materiales sostenibles (debajo de la descripción) */
.material-badges {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: .75rem 0 0;
}

.material-badge {
  height: 50px;
  /* ← tamaño pedido */
  border-radius: 10px;
  /* bordes redondeados */
  background: #fff;
  /* fondo blanco para que destaque en tema oscuro */
  padding: .35rem .6rem;
  /* pequeño colchón para logos con fondo transparente */
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.quantity-section .qty-number {
  width: 64px;
  text-align: center;
  background: transparent;
  border: 1px solid var(--color-accent);
  border-radius: 10px;
  color: var(--color-text);
  padding: .25rem .5rem;
}

/* Oculta spinners nativos solo en el modal de producto */
.quantity-section input[type="number"]::-webkit-inner-spin-button,
.quantity-section input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quantity-section input[type="number"] {
  -moz-appearance: textfield;
  /* Firefox */
  appearance: textfield;
  /* Estándar */
}

/* Marca Daphne en la ficha */
.product-modal .modal-details {
  position: relative;
}

.product-modal .brand-mark {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: clamp(120px, 24vw, 180px);
  /* desktop */
  opacity: 0.5;
  /* watermark sutil */
  pointer-events: none;
  /* no bloquea clicks */
  user-select: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
  z-index: 0;
}

@media (max-width: 768px) {
  .product-modal .brand-mark {
    right: 2px;
    bottom: 12px;
    width: clamp(110px, 33vw, 220px);
    /* móvil: ~media pantalla */
    opacity: 0.5;
  }
}

/* ======= Header icons ======= */
.cart-button {
  padding: .55rem .9rem;
  border-radius: 999px;
}

.cart-button i {
  width: 20px;
  height: 20px;
}

.language-selector select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: var(--color-text);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: .45rem 2.1rem .45rem 2rem;
  /* hueco para icono/caret */
  font: inherit;
}

.language-selector .lang-icon,
.language-selector .lang-caret {
  position: absolute;
  pointer-events: none;
  opacity: .9;
  width: 18px;
  height: 18px;
}

.language-selector .lang-icon {
  left: 10px;
}

.language-selector .lang-caret {
  right: 10px;
}

/* Responsive */
@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-brand p {
    max-width: 48ch;
  }
}

/* Header base: vuelve a empujar el selector a la derecha */
.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1rem 2rem;
  background-color: rgba(15, 13, 12, .85);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom-left-radius: 0px;
  border-bottom-right-radius: 0px;
  max-width: 100%;
  overflow-x: clip;
}

/* ⚠️ esta regla debe incluir margin-left:auto */
.language-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

/* Botón carrito preparado para badge */
.cart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Badge con el contador; lo rellenamos desde JS con data-count */
.cart-button::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  border-radius: 999px;
  background: #000;
  color: #fff;
  border: 1px solid var(--color-accent);
  transform: translate(0, 0);
  opacity: 1;
}

.cart-button[data-count="0"]::after {
  opacity: .0;
}

/* ====== Ajustes móviles ====== */
@media (max-width: 480px) {
  .site-header {
    padding: .55rem .8rem;
    gap: .5rem;
    justify-content: space-between;
  }

  .logo {
    height: 34px;
  }

  /* selector compacto */
  .language-selector select {
    max-width: 110px;
    font-size: .85rem;
    padding: .28rem 1.7rem .28rem 1.6rem;
  }

  .language-selector .lang-icon,
  .language-selector .lang-caret {
    width: 16px;
    height: 16px;
  }

  /* carrito sólo con icono + badge (se oculta el texto) */
  .cart-button {
    padding: .5rem;
    /* cuadradito */
    border-radius: 999px;
    gap: 0;
    min-width: 40px;
  }

  .cart-button span {
    display: none;
  }

  /* ocultamos “Pedido (0)” */
  .cart-button i {
    width: 20px;
    height: 20px;
  }
}

/* ======= Footer ======= */
.site-footer {
  margin-top: 4rem;
  background: #0d0d0d;
  color: #d9d4ce;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  opacity: .9;
}

.site-footer a:hover {
  opacity: 1;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem min(5vw, 48px);
}

.footer-logo {
  width: 150px;
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4));
}

.footer-brand p {
  max-width: 36ch;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
}

.footer-social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  transition: transform .18s ease, background .18s ease;
}

.footer-social a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .08);
}

.footer-social i {
  width: 18px;
  height: 18px;
}

.footer-col h5 {
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #f0ece6;
  margin: .25rem 0 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .6rem;
}

.footer-col li a {
  padding: .15rem 0;
  border-bottom: 1px dashed transparent;
}

.footer-col li a:hover {
  border-bottom-color: rgba(255, 255, 255, .2);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 1rem min(5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bcb6ae;
  font-size: .9rem;
}

.footer-meta {
  display: flex;
  gap: .6rem;
  align-items: center;
  opacity: .9;
}

.footer-meta .sep {
  opacity: .35;
}

/* Responsive */
@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .footer-brand p {
    max-width: 48ch;
  }
}

/* Lucide en inputs del checkout */
.form-icon {
  width: 18px;
  height: 18px;
  /* Lucide usa stroke = currentColor */
  flex-shrink: 0;
  display: inline-flex;
  transition: color .18s ease;
}

/* resalta icono cuando el input/select recibe foco */
.input-with-icon:focus-within .form-icon {
  color: var(--color-accent);
}

/* botón cerrar con icono */
.close-modal i {
  width: 22px;
  height: 22px;
}

/* Sentinel invisible para carga diferida */
.load-sentinel {
  width: 100%;
  height: 1px;
}

/* Área de cliente */
.order-card {
  background: rgba(10, 10, 10, .35);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.order-items {
  margin-top: .5rem;
}

.order-summary-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.order-total {
  font-weight: 600;
}

.toggle-icon {
  transition: transform .2s;
}

.order-card.open .toggle-icon {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .order-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }

  .order-item-img {
    width: 40px;
  }
}

/* Aviso de precios mayorista */
.notice-section {
  background-color: var(--color-card);
  color: var(--color-text);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: clamp(0.8rem, 2vw, 1rem);
}

/* ===== Área de cliente: login elegante ===== */
.auth-card {
  display: flex;
  justify-content: center;
}

.auth-card-inner {
  width: 100%;
  max-width: 600px;
  background: rgba(12, 12, 12, .65);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
}

.auth-logo {
  height: 42px;
  margin-bottom: 6px;
}

.auth-card h1 {
  font-size: 1.4rem;
  letter-spacing: .06em;
  margin: .25rem 0 .35rem;
  color: var(--color-highlight);
}

.auth-sub {
  color: var(--color-muted);
  margin-bottom: .75rem;
}

.stacked .form-field {
  margin-bottom: .6rem;
}

/* ===== Cabecera: saludo ===== */
.header-welcome {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  opacity: .95;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
}

/* ===== Perfil: grid 2 columnas en pantallas anchas ===== */
.profile-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-grid .grid-span-2 {
  grid-column: 1 / -1;
}

.profile-grid fieldset.card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 16px;
  background: rgba(20, 20, 20, .5);
}

.profile-grid fieldset legend {
  font-size: .95rem;
  color: var(--color-highlight);
  text-transform: uppercase;
  padding: 0 .35rem;
}

.profile-grid .form-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.profile-grid select,
.profile-grid input {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  background: var(--color-card);
  color: var(--color-text);
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid .grid-span-2 {
    grid-column: auto;
  }
}

/* ===== Pedidos: estado & líneas ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  padding: .1rem .55rem;
  font-size: .8rem;
  text-transform: capitalize;
  background: rgba(255, 255, 255, .06);
}

.status-recibido {
  border-color: #5a9;
}

.status-confirmado {
  border-color: #8ad;
}

.status-procesando,
.status-procesado {
  border-color: #e8b95a;
}

.status-preparado {
  border-color: #dca;
}

.status-enviado,
.status-de\ camino {
  border-color: #8ab;
}

.status-entregado {
  border-color: #6c6;
}

.status-cancelado,
.status-devuelto,
.status-reembolsado {
  border-color: #c66;
}

.order-item {
  justify-content: space-between;
}

.order-line small {
  color: var(--color-muted);
}

.order-line-amount {
  color: var(--color-accent);
}

/* Lucide fino en formularios */
.form-icon.lucide {
  stroke-width: 1.75;
}

/* Botones dentro de tarjetas/formularios */
fieldset.card .cta-button {
  margin-top: .25rem;
}

/* Títulos de sección más centrados y con espaciado correcto */
.section-title {
  margin: 22px 0 10px !important;
  text-align: center;
  letter-spacing: .14em;
  font-weight: 600;
}

/* Reduce el “salto” antes de fieldsets y compacta la leyenda */
.profile-grid {
  margin-top: .75rem;
}

.profile-grid fieldset.card {
  margin-top: .5rem;
}

.profile-grid fieldset legend {
  margin-left: .2rem;
  letter-spacing: .08em;
  font-weight: 600;
}

/* En tarjetas de pedidos, alinea mejor el título h3 */
.order-summary h3 {
  margin: 0 0 2px;
  font-weight: 600;
  letter-spacing: .02em;
}

.order-summary p {
  margin: 0;
  opacity: .85;
}

/* Fuerza ocultar nodos marcados como hidden */
[hidden],
.is-hidden {
  display: none !important;
}

/* Miniaturas en el detalle de pedido */
.order-items {
  padding-left: 0;
}

.order-item-img {
  border: 1px solid rgba(255, 255, 255, .1);
}

/* Formulario de contraseña en 2 columnas (>=900px) */
.password-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .password-form {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .password-form .form-actions {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* Selector de idioma */
.lang-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
}

.lang-switch select {
  outline: none;
  font: inherit;
  cursor: pointer;
}

/* Miniaturas en el detalle del pedido */
.order-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.order-item-img {
  width: 120px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: #111;
}

.order-line {
  color: #ddd;
  margin-left: 40px;
}

.order-line small {
  opacity: .8;
}

.order-line-amount {
  white-space: nowrap;
  font-weight: 600;
}

@media (max-width:560px) {
  .order-item {
    grid-template-columns: 64px 1fr auto;
    gap: 10px;
  }

  .order-item-img {
    width: 80px;
    height: 120px;
  }

  .order-line {
    margin-left: 30px;
  }
}

/* Cabecera: nombre en una línea con elipsis en desktop */
.site-header .header-welcome {
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 40vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header .header-welcome i {
  flex: 0 0 auto;
}

/* En pantallas móviles ocultamos el nombre/icono de la cabecera */
@media (max-width:560px) {
  .site-header .header-welcome {
    display: none !important;
  }
}

/* Select compacto y oscuro */
.lang-switch select {
  color: #fff;
  background: rgba(18, 18, 18, .95);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  padding: 6px 28px 6px 8px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: dark;
  /* fuerza UI oscura del control en navegadores modernos */
}

/* Fondo del popup de opciones */
.lang-switch select option,
.lang-switch select optgroup {
  background-color: #111;
  /* fondo del menú */
  color: #fff;
  /* etiquetas en blanco */
}

/* Focus visible accesible */
.lang-switch select:focus {
  outline: 2px solid var(--color-accent, #d8b89b);
  outline-offset: 2px;
}

/* ===== Unificación menú de cabecera (igual que .lang-switch) ===== */
.site-header .user-button,
.site-header .cart-button,
.site-header .lang-switch {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: var(--color-text);
  line-height: 1;
}

.site-header .user-button:hover,
.site-header .cart-button:hover,
.site-header .lang-switch:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .18);
}

/* Iconos y tipografía coherentes */
.site-header .user-button i,
.site-header .cart-button i,
.site-header .lang-switch i {
  width: 18px;
  height: 18px;
}

/* El carrito deja de ser beige para integrarse con el resto */
.site-header .cart-button {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: var(--color-text);
}

/* Badge del carrito: mantenemos el acento para destacar la cantidad */
.site-header .cart-button::after {
  background: #000;
  color: #fff;
  border: 1px solid var(--color-accent);
}

/* Accesibilidad foco */
.site-header .user-button:focus-visible,
.site-header .cart-button:focus-visible,
.site-header .lang-switch select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Móvil: ya ocultas el texto del carrito; respetamos ese comportamiento */
@media (max-width: 480px) {
  .site-header .cart-button {
    padding: .5rem;
    min-width: 40px;
    gap: 0;
  }

  .site-header .cart-button span {
    display: none;
  }
}

/* Bonus: ligerísimo blur si el navegador lo soporta */
@supports (backdrop-filter: saturate(1)) {

  .site-header .user-button,
  .site-header .cart-button,
  .site-header .lang-switch {
    backdrop-filter: saturate(130%) blur(2px);
  }
}

/* --- Banda con usuario bajo cabecera (sólo móvil) --- */
.mobile-welcome {
  display: none;
  padding: 10px 16px;
  color: #eee;
  background: #0f0f0fd9;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.mobile-welcome .icon {
  margin-right: .5rem;
  vertical-align: -2px;
  opacity: .9
}

/* botón dentro de la banda (sin estilos de botón nativos) */
.mobile-welcome .mobile-user-btn {
  all: unset;
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
}

.mobile-welcome .logout-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #eee;
  font-weight: 500;
}

.mobile-welcome .logout-btn:hover {
  background: rgba(255, 255, 255, .12);
}

.mobile-welcome .logout-btn .lucide {
  width: 18px;
  height: 18px;
}


/* En móvil ocultamos usuario del header y mostramos la banda */
@media (max-width:768px) {
  .site-header .user-button {
    display: none;
  }

  .mobile-welcome {
    display: flex;
    justify-content: space-between;
  }
}

/* ===== Logout en cabecera (desktop) ===== */
.site-header .logout-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: var(--color-text);
  line-height: 1;
}

.site-header .logout-btn:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .18);
}

.site-header .logout-btn i {
  width: 18px;
  height: 18px;
}

/* Ocultar el logout de cabecera en móvil (lo mostramos en la banda inferior) */
@media (max-width:560px) {
  .site-header #logout-button {
    display: none;
  }
}

/* ===== Logout móvil (banda bajo cabecera) — mismo estilo pill ===== */
.mobile-welcome .logout-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #eee;
  font-weight: 500;
}

.mobile-welcome .logout-btn:hover {
  background: rgba(255, 255, 255, .12);
}

.mobile-welcome .logout-btn .lucide {
  width: 18px;
  height: 18px;
}

/* ===== Header: botón Logout con el mismo estilo que el resto ===== */
.site-header .logout-btn {
  padding: .55rem .9rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: var(--color-text);
  line-height: 1;
}

.site-header .logout-btn:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .18);
}

.site-header .logout-btn i {
  width: 18px;
  height: 18px;
}

/* En móvil ocultamos el logout del header: usamos la banda */
@media (max-width:560px) {
  #logout-button {
    display: none !important;
  }
}

/* Banda móvil: distribución y “pills” */
.mobile-welcome {
  display: none;
  padding: 10px 16px;
  color: #eee;
  background: #0f0f0fd9;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  justify-content: space-between;
  /* ⬅ alineación correcta */
  align-items: center;
  gap: .75rem;
}

/* pill del usuario (igual look & feel que logout) */
.mobile-welcome .mobile-user-btn {
  all: unset;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #eee;
  cursor: pointer;
}

.mobile-welcome .mobile-user-btn .icon {
  width: 18px;
  height: 18px;
}

.mobile-welcome #mobile-welcome-name {
  font-weight: 500;
}

#billing-notes {
  border-radius: 20px;
  width: 100%;
}