/* ===============================================
   LM BOX ALIMENTA - Estilos principales
   =============================================== */

:root {
  --color-primary: #0f0f0f;
  --color-secondary: #a0522d;
  --color-accent: #a0522d;
  --color-text: #222;
  --color-text-light: #555;
  --color-bg: #fff;
  --color-bg-light: #f8f8f8;
  --color-border: #ddd;
  --color-white: #fff;
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  line-height: 1.6;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  min-height: calc(100vh - 200px);
}

/* ============ HEADER ============ */

#site-header {
  background: var(--color-white);
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-soft);
}

.topbar {
  padding: 0.75rem 0;
}

.topbar__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.topbar__logo {
  flex-shrink: 0;
}

.topbar__logo a {
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.topbar__logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.nav-toggle {
  display: none;
}

.nav-toggle__btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle__btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.topbar__nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav__list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav__list a {
  color: var(--color-text);
  font-weight: 500;
  transition: color 0.2s;
}

.nav__list a:hover {
  color: var(--color-secondary);
}

.topbar__contact {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.topbar__contact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-secondary);
  color: white;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* ============ BANNER HERO ============ */

.banner-hero {
  position: relative;
  height: 550px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.banner-hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.banner-hero__slide.is-active {
  opacity: 1;
}

.banner-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.35) 100%);
}

.banner-hero__text::before {
  content: "";
  position: absolute;
  inset: -1.5rem -1rem;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 75%);
  z-index: -1;
}

.banner-hero__text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  color: var(--color-white);
  max-width: 700px;
  padding: 0 20px;
}

.banner-hero__text h1,
.banner-hero__text h2 {
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.banner-hero__text p {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 300;
  line-height: 1.5;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.banner-hero__actions {
  margin-top: 2rem;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

/* ============ BOTONES ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-secondary);
  color: white;
}

.btn-primary:hover {
  background: #7a3d1f;
  box-shadow: var(--shadow-medium);
}

.btn-ghost {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============ PAGE HEADER (cabecera de páginas interiores) ============ */

.page-header {
  background: var(--color-secondary);
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  color: var(--color-white);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
}

/* ============ SECCIONES ============ */

.section-head {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.section-head p {
  font-size: 1.1rem;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============ PRODUCT GRID ============ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-strong);
  transform: translateY(-4px);
}

.product-card__media {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: var(--color-bg-light);
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card__media img {
  transform: scale(1.05);
}

.product-card__body {
  padding: 2rem;
}

.product-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.product-card p {
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ============ FOOTER ============ */

#site-footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 3rem 0 1rem;
}

.footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer__col {
  flex: 0 0 250px;
}

.footer__col h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.footer__list {
  list-style: none;
}

.footer__list li {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.footer__list a {
  color: var(--color-white);
  transition: opacity 0.2s;
}

.footer__list a:hover {
  opacity: 0.8;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
  color: var(--color-white);
}

/* ============ BACK TO TOP ============ */

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 998;
  width: 44px;
  height: 44px;
  background: var(--color-secondary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #7a3d1f;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .topbar__content {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .topbar__logo img {
    height: 50px;
  }

  .nav-toggle__btn {
    display: flex;
    order: 2;
    margin-left: auto;
  }

  .topbar__nav {
    order: 4;
    flex-basis: 100%;
    justify-content: stretch;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-toggle:checked ~ .topbar__nav {
    max-height: 400px;
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
  }

  .nav__list a {
    display: block;
    padding: 0.75rem 0.5rem;
  }

  .nav-toggle:checked ~ .nav-toggle__btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-toggle__btn span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked ~ .nav-toggle__btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .topbar__contact {
    width: 100%;
    order: 3;
  }

  .banner-hero {
    height: auto;
    min-height: 480px;
    padding: 2rem 0;
  }

  .banner-hero__slide {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .banner-hero__text {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
  }

  .banner-hero__actions {
    flex-direction: column;
    max-width: 280px;
    margin: 1.5rem auto 0;
    gap: 0.8rem;
  }

  .btn {
    width: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .contact-info-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

@media (max-width: 640px) {
  .banner-hero {
    height: auto;
    min-height: 400px;
  }

  .banner-hero__text h1,
  .banner-hero__text h2 {
    font-size: 1.8rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  }

  .banner-hero__text p {
    font-size: 1rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  }

  .section-head h2 {
    font-size: 1.5rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   COOKIE CONSENT BANNER — RGPD
   ========================================================= */

.cookie-overlay { display: none; }

.cookie-modal {
  position: fixed;
  bottom: 8rem;
  right: 1.5rem;
  transform: translateY(12px) scale(.97);
  width: min(400px, calc(100vw - 2rem));
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 8px 48px rgba(0,0,0,.18);
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
  overflow: hidden;
}
.cookie-modal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
}
.cookie-modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}
.cookie-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: rgba(0,0,0,.5);
  font-size: 1.1rem;
  cursor: pointer;
  background: none; border: none; padding: 0;
  transition: background .2s;
}
.cookie-close:hover { background: rgba(0,0,0,.06); color: #111; }
.cookie-modal-body { padding: 1rem 1.5rem 1.25rem; }
.cookie-modal-body p { font-size: .88rem; color: rgba(0,0,0,.7); line-height: 1.6; }
.cookie-modal-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.cookie-modal-footer, .cookie-prefs-footer {
  display: flex; flex-wrap: wrap; gap: .65rem; padding: 0 1.5rem 1.5rem;
}
.cookie-btn {
  flex: 1 1 auto; min-width: 110px;
  padding: .65rem 1rem;
  border-radius: 99px;
  font-size: .82rem; font-weight: 700;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
  border: 1.5px solid transparent;
}
.cookie-btn-accept { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.cookie-btn-accept:hover { filter: brightness(.85); box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.cookie-btn-deny, .cookie-btn-prefs {
  background: #fff; color: #111; border-color: rgba(0,0,0,.15);
}
.cookie-btn-deny:hover, .cookie-btn-prefs:hover {
  border-color: rgba(0,0,0,.35); background: rgba(0,0,0,.04);
}
.cookie-category {
  border: 1px solid rgba(0,0,0,.1); border-radius: .5rem;
  margin-bottom: .65rem; overflow: hidden;
}
.cookie-category-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; background: #f5f5f5; cursor: pointer; gap: .75rem;
}
.cookie-category-header:hover { background: rgba(0,0,0,.05); }
.cookie-category-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 700; color: #111; flex: 1;
}
.cookie-required-badge {
  font-size: .7rem; font-weight: 500; color: rgba(0,0,0,.5);
  background: rgba(0,0,0,.1); padding: .15rem .5rem; border-radius: 99px;
}
.cookie-category-desc {
  font-size: .82rem; color: rgba(0,0,0,.65);
  padding: .65rem 1rem; border-top: 1px solid rgba(0,0,0,.08);
  background: #fff; display: none;
}
.cookie-category.expanded .cookie-category-desc { display: block; }
.cookie-category-toggle-icon {
  font-size: .75rem; color: rgba(0,0,0,.4);
  transition: transform .2s; flex-shrink: 0;
}
.cookie-category.expanded .cookie-category-toggle-icon { transform: rotate(180deg); }
.cookie-toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0;
}
.cookie-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cookie-toggle-slider {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.15); border-radius: 99px; transition: background .2s; cursor: pointer;
}
.cookie-toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.cookie-toggle input:checked + .cookie-toggle-slider { background: var(--color-accent); }
.cookie-toggle input:checked + .cookie-toggle-slider::before { transform: translateX(18px); }
.cookie-toggle input:disabled + .cookie-toggle-slider { background: #ccc; cursor: not-allowed; }
.cookie-toggle input:disabled + .cookie-toggle-slider::before { transform: translateX(18px); }
.cookie-manage-btn {
  position: fixed; bottom: 5rem; right: 1.5rem; z-index: 9990;
  background: #fff; border: 1.5px solid rgba(0,0,0,.12); border-radius: 99px;
  padding: .5rem .85rem; font-size: .75rem; font-weight: 700;
  color: rgba(0,0,0,.6); cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  display: flex; align-items: center; gap: .4rem;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, border-color .2s, box-shadow .2s;
}
.cookie-manage-btn.visible { opacity: 1; pointer-events: auto; }
.cookie-manage-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }

@media (max-width: 520px) {
  .cookie-modal { right: .75rem; left: .75rem; width: auto; bottom: 4rem; }
  .cookie-modal-footer, .cookie-prefs-footer { flex-direction: column; }
  .cookie-btn { min-width: 100%; }
}

/* ============ GALERÍA DE FOTOS + LIGHTBOX ============ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.photo-grid a {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.photo-grid img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-grid a:hover img {
  transform: scale(1.05);
}

.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(20, 24, 24, .92); opacity: 0; visibility: hidden; transition: opacity .2s ease; }
.lightbox.is-open { opacity: 1; visibility: visible; }
body.lightbox-open { overflow: hidden; }
.lightbox-img { max-width: min(90vw, 1200px); max-height: 88vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lightbox-close { position: absolute; top: 1.2rem; right: 1.5rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; transition: background .2s ease; }
.lightbox-close:hover, .lightbox-close:focus-visible { background: rgba(255, 255, 255, .25); }
.lightbox-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; transition: background .2s ease; display: flex; align-items: center; justify-content: center; }
.lightbox-arrow:hover, .lightbox-arrow:focus-visible { background: rgba(255, 255, 255, .25); }
.lightbox-arrow--prev { left: 1rem; }
.lightbox-arrow--next { right: 1rem; }
@media (max-width: 640px) {
  .lightbox-arrow { width: 42px; height: 42px; font-size: 1.8rem; }
  .lightbox-arrow--prev { left: .4rem; }
  .lightbox-arrow--next { right: .4rem; }
  .lightbox-close { top: .6rem; right: .6rem; }

  .photo-grid {
    grid-template-columns: 1fr;
  }
}
