/* =========================================================================
   LUXURY ROTA · by Victoria Fernández — hoja de estilo de la tienda
   Lujo sobrio en negro y dorado: cabecera, franja de portada y pie en negro
   (donde vive el logo, pensado para fondo oscuro); cuerpo del catálogo en
   crema. Contraste por espacio y por el propio negro/dorado, no por sombras
   ni degradados. Mobile-first, con puntos de corte para tableta y escritorio.
   ========================================================================= */

/* --- Tipografías auto-alojadas (sin orígenes externos, CSP estricta) --- */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/figtree-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/figtree-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/figtree-500.woff2') format('woff2');
}

/* --- Tokens --- */
:root {
  --negro: #0B0A08;
  --negro-suave: #171410;
  --oro: #C8A059;
  --oro-claro: #F5E3B0;
  --oro-oscuro: #8F6A2E;
  --crema: #FAF7F2;
  --texto: #2A2622;
  --texto-claro: #EDE7DD;
  --gris: #8A8179;
  --blanco: #fff;
  --gris-linea: #E7DFD2;
  --error: #B23B3B;
  --exito: #3B7A57;

  /* espaciado */
  --esp-1: 0.25rem;
  --esp-2: 0.5rem;
  --esp-3: 0.75rem;
  --esp-4: 1rem;
  --esp-5: 1.5rem;
  --esp-6: 2rem;
  --esp-7: 3rem;
  --esp-8: 4rem;
  --esp-9: 6rem;

  /* tamaños de letra */
  --texto-xs: 0.75rem;
  --texto-sm: 0.875rem;
  --texto-base: 1rem;
  --texto-md: 1.125rem;
  --texto-lg: 1.5rem;
  --texto-xl: 2rem;
  --texto-2xl: 2.75rem;
  --texto-3xl: 3.5rem;

  --fuente-titulos: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --fuente-cuerpo: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;

  --radio: 4px;
  --ancho-maximo: 1200px;
}

/* --- Reinicio ligero --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--crema);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-weight: 300;
  font-size: var(--texto-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--fuente-titulos);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--esp-4);
  line-height: 1.2;
}

h1 { font-size: var(--texto-2xl); letter-spacing: 0.15em; }
h2 { font-size: var(--texto-xl); letter-spacing: 0.12em; }
h3 { font-size: var(--texto-lg); }

p {
  margin: 0 0 var(--esp-4);
  color: var(--texto);
}

ul {
  margin: 0 0 var(--esp-4);
  padding-left: var(--esp-5);
}

/* --- Foco visible en todo lo pulsable (accesibilidad) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--oro-oscuro);
  outline-offset: 2px;
}

/* Sobre fondo negro el foco necesita un tono que se vea sobre negro */
.cabecera a:focus-visible,
.cabecera button:focus-visible,
.hero a:focus-visible,
.hero button:focus-visible,
.pie a:focus-visible,
.panel-carrito-cabecera button:focus-visible {
  outline-color: var(--oro-claro);
}

.contenedor {
  max-width: var(--ancho-maximo);
  margin: 0 auto;
  padding: 0 var(--esp-4);
}

/* =========================================================================
   Cabecera — negra, aquí vive el logo (pensado para fondo oscuro)
   ========================================================================= */
.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-4);
  padding: var(--esp-3) var(--esp-4);
  background: var(--negro);
  color: var(--texto-claro);
  border-bottom: 1px solid var(--oro-oscuro);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 60vw;
}

.carrito-boton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--oro-oscuro);
  border-radius: var(--radio);
  cursor: pointer;
  color: var(--texto-claro);
  font-family: var(--fuente-cuerpo);
  font-size: var(--texto-sm);
}

.carrito-boton:hover {
  border-color: var(--oro);
  color: var(--oro-claro);
}

.carrito-cuenta {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--esp-1);
  border-radius: 999px;
  background: var(--oro);
  color: var(--negro);
  font-size: var(--texto-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =========================================================================
   Hero / franja de portada — negra, logo grande y lema
   ========================================================================= */
.hero {
  padding: var(--esp-8) var(--esp-4);
  text-align: center;
  background: var(--negro);
  color: var(--texto-claro);
}

.hero .logo {
  height: 72px;
  margin: 0 auto var(--esp-5);
}

.hero h1 {
  color: var(--oro-claro);
  margin-bottom: var(--esp-3);
}

.hero p {
  max-width: 42ch;
  margin: 0 auto;
  color: var(--texto-claro);
  font-size: var(--texto-md);
  font-family: var(--fuente-titulos);
  font-weight: 300;
  letter-spacing: 0.04em;
}

/* =========================================================================
   Navegación por categorías
   ========================================================================= */
.categorias {
  display: flex;
  gap: var(--esp-5);
  overflow-x: auto;
  padding: var(--esp-4);
  background: var(--crema);
  border-bottom: 1px solid var(--gris-linea);
  -webkit-overflow-scrolling: touch;
}

.categoria-enlace {
  flex: 0 0 auto;
  font-family: var(--fuente-titulos);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--texto-md);
  color: var(--texto);
  padding: var(--esp-2) 0;
  border-bottom: 2px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.categoria-enlace:hover,
.categoria-enlace.activa {
  color: var(--oro-oscuro);
  border-bottom-color: var(--oro);
}

/* =========================================================================
   Rejilla de productos
   ========================================================================= */
.rejilla {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--esp-6);
  padding: var(--esp-6) var(--esp-4);
  max-width: var(--ancho-maximo);
  margin: 0 auto;
}

@media (min-width: 640px) {
  .rejilla {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .rejilla {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--esp-7);
  }
}

@media (min-width: 1280px) {
  .rejilla {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Tarjeta de producto --- */
.tarjeta {
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border: 1px solid var(--gris-linea);
  border-radius: var(--radio);
  overflow: hidden;
  text-align: left;
}

.tarjeta-foto {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--negro-suave);
}

.tarjeta-nombre {
  font-family: var(--fuente-titulos);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--texto-lg);
  margin: var(--esp-4) var(--esp-4) var(--esp-1);
}

.tarjeta-frase {
  margin: 0 var(--esp-4) var(--esp-3);
  color: var(--texto);
  opacity: 0.75;
  font-size: var(--texto-sm);
  flex-grow: 1;
}

.tarjeta .precio,
.tarjeta .precio-tachado {
  margin: 0 var(--esp-4);
}

.tarjeta .boton {
  margin: var(--esp-4);
  align-self: flex-start;
}

/* --- Precio ---
   El dorado claro/medio no llega a AA sobre crema: para texto de precio se usa
   --oro-oscuro, que sí cumple. El dorado "puro" queda para filetes y fondos de
   botón (con texto oscuro encima). */
.precio {
  font-family: var(--fuente-titulos);
  font-weight: 500;
  font-size: var(--texto-lg);
  color: var(--oro-oscuro);
  letter-spacing: 0.02em;
}

.precio-tachado {
  color: var(--gris);
  text-decoration: line-through;
  font-size: var(--texto-sm);
  margin-left: var(--esp-2);
}

/* =========================================================================
   Botones — fondo dorado, texto oscuro (el dorado no da AA con blanco)
   ========================================================================= */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--esp-3) var(--esp-5);
  background: var(--oro);
  color: var(--negro);
  border: 1px solid var(--oro);
  border-radius: var(--radio);
  font-family: var(--fuente-cuerpo);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--texto-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.boton:hover {
  background: var(--oro-claro);
  border-color: var(--oro-claro);
}

.boton:disabled {
  background: var(--gris-linea);
  border-color: var(--gris-linea);
  color: var(--gris);
  cursor: not-allowed;
}

.boton-secundario {
  background: transparent;
  color: var(--oro-oscuro);
  border: 1px solid var(--oro-oscuro);
}

.boton-secundario:hover {
  background: var(--oro-oscuro);
  color: var(--texto-claro);
}

/* Botones sobre fondo negro (cabecera, hero, pie, panel del carrito) */
.negro .boton-secundario,
.cabecera .boton-secundario,
.hero .boton-secundario,
.pie .boton-secundario {
  color: var(--oro-claro);
  border-color: var(--oro);
}

.negro .boton-secundario:hover,
.cabecera .boton-secundario:hover,
.hero .boton-secundario:hover,
.pie .boton-secundario:hover {
  background: var(--oro);
  color: var(--negro);
}

/* =========================================================================
   Ficha de producto
   ========================================================================= */
.ficha {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--esp-6);
  max-width: var(--ancho-maximo);
  margin: 0 auto;
  padding: var(--esp-6) var(--esp-4) var(--esp-9);
}

@media (min-width: 768px) {
  .ficha {
    grid-template-columns: 1fr 1fr;
    gap: var(--esp-8);
  }
}

.ficha-foto {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--negro-suave);
  border-radius: var(--radio);
}

.ficha-datos {
  display: flex;
  flex-direction: column;
  gap: var(--esp-3);
}

.ficha-datos .precio {
  font-size: var(--texto-xl);
}

.ficha-datos .formato {
  color: var(--texto);
  opacity: 0.7;
  font-size: var(--texto-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ficha-datos .descripcion {
  color: var(--texto);
  font-weight: 300;
}

/* --- Selector de cantidad --- */
.cantidad {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--gris-linea);
  border-radius: var(--radio);
  overflow: hidden;
  width: fit-content;
}

.cantidad button {
  min-width: 44px;
  min-height: 44px;
  background: var(--blanco);
  border: none;
  font-size: var(--texto-md);
  color: var(--texto);
  cursor: pointer;
}

.cantidad button:hover {
  background: var(--crema);
  color: var(--oro-oscuro);
}

.cantidad input {
  width: 48px;
  min-height: 44px;
  border: none;
  border-left: 1px solid var(--gris-linea);
  border-right: 1px solid var(--gris-linea);
  text-align: center;
  font-family: var(--fuente-cuerpo);
  font-size: var(--texto-base);
  color: var(--texto);
  background: var(--blanco);
}

/* =========================================================================
   Panel lateral del carrito — crema con cabecera negra
   ========================================================================= */
.panel-carrito {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 420px;
  background: var(--crema);
  color: var(--texto);
  box-shadow: none;
  border-left: 1px solid var(--oro-oscuro);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

.panel-carrito.abierto {
  transform: translateX(0);
}

.panel-carrito-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--esp-4);
  background: var(--negro);
  color: var(--texto-claro);
}

.panel-carrito-cabecera button {
  background: transparent;
  border: 1px solid var(--oro-oscuro);
  color: var(--texto-claro);
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radio);
  cursor: pointer;
}

.panel-carrito-cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: var(--esp-4);
}

.panel-carrito-pie {
  padding: var(--esp-4);
  border-top: 1px solid var(--gris-linea);
}

.linea-carrito {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--esp-3);
  padding: var(--esp-3) 0;
  border-bottom: 1px solid var(--gris-linea);
}

.linea-carrito:last-child {
  border-bottom: none;
}

.linea-carrito-nombre {
  font-size: var(--texto-sm);
  font-weight: 400;
}

.linea-carrito-precio {
  color: var(--texto);
  opacity: 0.7;
  font-size: var(--texto-xs);
}

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--fuente-titulos);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--texto-lg);
  color: var(--oro-oscuro);
  padding: var(--esp-3) 0;
}

/* --- Fondo oscurecido tras el panel --- */
.panel-carrito-fondo {
  position: fixed;
  inset: 0;
  background: rgba(11, 10, 8, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 30;
}

.panel-carrito-fondo.visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================================
   Formulario de pedido
   ========================================================================= */
.formulario {
  display: flex;
  flex-direction: column;
  gap: var(--esp-4);
  max-width: 560px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: var(--esp-1);
}

.campo label {
  font-size: var(--texto-sm);
  font-weight: 500;
  color: var(--texto);
}

.campo input,
.campo select,
.campo textarea {
  min-height: 44px;
  padding: var(--esp-2) var(--esp-3);
  border: 1px solid var(--gris-linea);
  border-radius: var(--radio);
  background: var(--blanco);
  color: var(--texto);
  font-family: var(--fuente-cuerpo);
  font-size: var(--texto-base);
}

.campo textarea {
  min-height: 96px;
  resize: vertical;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--oro);
}

.campo-error {
  color: var(--error);
  font-size: var(--texto-xs);
  margin: 0;
}

.campo.con-error input,
.campo.con-error select,
.campo.con-error textarea {
  border-color: var(--error);
}

/* --- Mensaje de éxito --- */
.exito {
  padding: var(--esp-5);
  border: 1px solid var(--exito);
  border-radius: var(--radio);
  background: var(--blanco);
  color: var(--exito);
  text-align: center;
}

.exito h2 {
  color: var(--exito);
  margin-bottom: var(--esp-2);
}

/* =========================================================================
   Pie de página — negro, con crédito de firma
   ========================================================================= */
.pie {
  border-top: 1px solid var(--oro-oscuro);
  padding: var(--esp-7) var(--esp-4);
  margin-top: var(--esp-8);
  background: var(--negro);
  color: var(--texto-claro);
  font-size: var(--texto-sm);
}

.pie-enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--esp-4);
  justify-content: center;
  margin-bottom: var(--esp-4);
}

.pie-enlaces a {
  color: var(--texto-claro);
  opacity: 0.85;
}

.pie-enlaces a:hover {
  color: var(--oro-claro);
  opacity: 1;
}

.pie p {
  text-align: center;
  margin: 0;
  color: var(--texto-claro);
  opacity: 0.75;
}

.pie-firma {
  font-family: var(--fuente-titulos);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--oro-claro);
  opacity: 1;
  font-size: var(--texto-sm);
  margin-bottom: var(--esp-2);
}

/* =========================================================================
   Panel de administración
   ========================================================================= */
.admin-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--texto-sm);
  background: var(--blanco);
}

.admin-tabla th,
.admin-tabla td {
  padding: var(--esp-3);
  border-bottom: 1px solid var(--gris-linea);
  text-align: left;
  vertical-align: middle;
}

.admin-tabla th {
  font-family: var(--fuente-titulos);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--texto-sm);
  color: var(--texto);
  background: var(--crema);
}

.admin-tabla tr:hover td {
  background: var(--crema);
}

.admin-login {
  max-width: 360px;
  margin: var(--esp-9) auto;
  padding: var(--esp-6);
  background: var(--blanco);
  border: 1px solid var(--gris-linea);
  border-top: 3px solid var(--oro);
  border-radius: var(--radio);
  display: flex;
  flex-direction: column;
  gap: var(--esp-4);
}

.admin-login h1 {
  text-align: center;
  font-size: var(--texto-lg);
  color: var(--texto);
}

/* --- Aviso / banda de advertencia --- */
.aviso {
  background: var(--oro-claro);
  color: var(--negro);
  padding: var(--esp-3) var(--esp-4);
  text-align: center;
  font-size: var(--texto-sm);
  font-weight: 500;
  border-bottom: 1px solid var(--oro-oscuro);
}

/* =========================================================================
   Puntos de corte generales de layout
   ========================================================================= */
@media (min-width: 768px) {
  .cabecera {
    padding: var(--esp-4) var(--esp-6);
  }

  .hero {
    padding: var(--esp-9) var(--esp-6);
  }

  .hero .logo {
    height: 96px;
  }

  h1 { font-size: var(--texto-3xl); }
}

@media (min-width: 1024px) {
  .categorias {
    justify-content: center;
  }
}
