/* =========================================================
   Curtidos Parreño Sevilla — estilos de la web pública
   ---------------------------------------------------------
   1. Fuentes y variables
   2. Base
   3. Cabecera
   4. Productos
   5. Modal de producto
   6. Pie de página
   ========================================================= */


/* ---------- 1. Fuentes y variables ---------- */

@font-face {
  font-family: "Lora";
  src: url("../fonts/lora-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colores (tonos del logo) */
  --color-bg: #f7f2eb;
  --color-surface: #fffdf9;
  --color-text: #2e2219;
  --color-muted: #6f5d4e;
  --color-brand: #5a3d22;
  --color-accent: #b98a4a;
  --color-line: #e6dccf;
  --color-footer-bg: #2e2219;
  --color-footer-text: #e9dfd2;

  /* Tipografía */
  --font-serif: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Medidas */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 10px;
  --shadow: 0 1px 2px rgb(46 34 25 / 6%), 0 8px 24px rgb(46 34 25 / 8%);
  --shadow-hover: 0 2px 4px rgb(46 34 25 / 8%), 0 14px 36px rgb(46 34 25 / 14%);

  /* Ancho mínimo de cada tarjeta: define cuántas columnas caben */
  --card-min: 220px;
}

@media (max-width: 600px) {
  :root {
    --card-min: 150px; /* 2 columnas en móvil */
  }
}


/* ---------- 2. Base ---------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main {
  flex: 1;
  padding-block: clamp(24px, 5vw, 56px);
}


/* ---------- 3. Cabecera ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgb(247 242 235 / 92%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
}

.brand img {
  height: clamp(64px, 10vw, 88px);
  width: auto;
}

.lang-switch {
  display: flex;
  gap: 4px;
}

.lang-switch a {
  min-width: 40px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.lang-switch a:hover {
  color: var(--color-text);
}

.lang-switch a[aria-current="page"] {
  color: var(--color-brand);
  border-color: var(--color-accent);
}


/* ---------- 4. Productos ---------- */

.page-title {
  margin: 0 0 clamp(24px, 4vw, 40px);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  color: var(--color-brand);
}

/* Las columnas se calculan solas según el ancho disponible */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
  gap: clamp(16px, 2.5vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-card__button {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: box-shadow 0.25s, transform 0.25s;
}

.product-card__button:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-line);
  transition: transform 0.4s;
}

.product-card__button:hover .product-card__image {
  transform: scale(1.04);
}

.product-card__info {
  position: relative; /* queda por encima de la imagen al hacer zoom */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
  background: var(--color-surface);
}

.product-card__price {
  margin-top: auto; /* el precio queda abajo aunque el nombre ocupe 1 o 2 líneas */
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.product-card__name {
  font-family: var(--font-serif);
  font-size: clamp(0.9375rem, 0.85rem + 0.3vw, 1.0625rem);
  font-weight: 500;
  line-height: 1.35;
}

.product-grid__message {
  text-align: center;
  color: var(--color-muted);
}


/* ---------- 5. Modal de producto ---------- */

.product-modal {
  width: min(960px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100% - 2 * var(--gutter));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 64px rgb(0 0 0 / 30%);
}

.product-modal::backdrop {
  background: rgb(30 22 16 / 70%);
  backdrop-filter: blur(3px);
}

.product-modal[open] {
  display: grid;
  grid-template-columns: 1fr;
  animation: modal-in 0.25s ease-out;
}

@media (min-width: 720px) {
  .product-modal[open] {
    grid-template-columns: 1.15fr 1fr;
  }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

.product-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 253 249 / 90%);
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: var(--shadow);
}

.product-modal__image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-line);
}

.product-modal__body {
  padding: clamp(20px, 4vw, 40px);
  align-self: center;
}

.product-modal__name {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-brand);
}

.product-modal__description {
  margin: 0;
  color: var(--color-muted);
  white-space: pre-line; /* respeta los saltos de línea escritos en el admin */
}

.product-modal__price {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--color-line);
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}

body:has(.product-modal[open]) {
  overflow: hidden;
}


/* ---------- 6. Pie de página ---------- */

.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  font-size: 0.9375rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 32px;
  padding-block: 48px 32px;
}

.site-footer h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  color: #fff;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 6px;
}

.site-footer a {
  text-decoration-color: rgb(233 223 210 / 40%);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.site-footer a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

.site-footer address {
  font-style: normal;
}

/* Redes sociales: botones redondos solo con icono */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer .social-links li + li {
  margin-top: 0;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(233 223 210 / 30%);
  border-radius: 50%;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.social-links a:hover {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-footer-bg);
}

.social-links svg {
  width: 22px;
  height: 22px;
}

/* Contacto y dirección: icono + texto */
.icon-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.icon-list svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 0.2em;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-link {
  display: inline-block;
  margin-top: 10px;
  margin-left: 28px; /* alineado con el texto de la dirección */
  color: var(--color-accent);
}

.site-footer__copy {
  margin: 0;
  padding: 16px var(--gutter);
  border-top: 1px solid rgb(233 223 210 / 12%);
  text-align: center;
  font-size: 0.8125rem;
  color: rgb(233 223 210 / 60%);
}


/* ---------- Accesibilidad: menos animaciones si el usuario lo pide ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
