:root {
  --primary-color: #e63946;
  --primary-dark: #d62839;
  /* Darker shades used wherever white text sits on a brand color (or brand
     color text sits on white), so it clears WCAG AA 4.5:1. The lighter
     --primary-color (4.17:1 on white) stays for icons and accents. */
  --primary-darker: #b8202f;
  /* WhatsApp's own brand green, kept on purpose for recognizability even
     though white text on it is below 4.5:1. */
  --whatsapp-color: #25d366;
  /* Exact black of images/logo.png, sampled from the file. */
  --logo-black: #000000;
  --whatsapp-dark: #1ebd57;
  --secondary-color: #1a1a24;
  --secondary-light: #2b2d42;
  --bg-color: #ffffff;
  --bg-alt: #f8f9fa;
  /* Slightly darker than --bg-alt: tints every other home section so the
     content blocks read as separate (white / tinted / white). */
  --bg-section-alt: #eef0f3;
  /* Footer: charcoal gray (lighter than the near-black "Por qué elegirnos"
     block so the two read as separate), light text 7:1, and a light red for
     accents that stays visible on the dark background. */
  --footer-bg: #454b53;
  --footer-text: #e9ecef;
  --footer-accent: #ff6b6b;
  --text-main: #333333;
  --text-muted: #6c757d;
  --gray-medium: #a0aab2;
  --gray-light: #e9ecef;
  --white: #ffffff;
  --black: #000000;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-display: 'Unbounded', sans-serif;
  
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 8px 25px rgba(230, 57, 70, 0.3);
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius: 12px;

  /* Height of the unscrolled navbar (20px padding x2 + logo). Used by
     .page-header to paint the navbar's light band itself, so the photo
     runs as one piece behind both. Keep in sync with .logo img. */
  --nav-h: 108px;
}

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

/* No global `scroll-behavior: smooth`: the ClientRouter restores the
   scroll position with a plain scrollTo() on Back/Forward, and with smooth
   scrolling on the whole page it visibly scrolled through the page after
   every navigation (very noticeable on phones). In-page scrolls that should
   animate (catalog tabs, anchors) already ask for it explicitly in JS. */

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary-color);
}

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

ul {
  list-style: none;
}

/* <Img> wraps images in <picture> for the .webp source; this keeps the
   <img> itself as the layout box so existing flex/grid rules still apply. */
picture {
  display: contents;
}

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

/* LAYOUT */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 50px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  margin: 15px auto 0;
  border-radius: 2px;
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--primary-dark);
  color: var(--white);
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background-color: var(--primary-darker);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(230, 57, 70, 0.4);
}

.btn-outline {
  background-color: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.btn-outline:hover {
  background-color: var(--secondary-color);
  color: var(--white);
  transform: translateY(-3px);
}

.btn-outline-white {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline-white:hover {
  background-color: var(--white);
  color: var(--secondary-color);
  transform: translateY(-3px);
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  /* Only what actually changes on scroll (not `all`), so the fixed navbar
     doesn't re-animate everything on every scroll toggle. */
  transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  background: linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)), url('../images/hero-bg.jpg') center/cover no-repeat;
  /* Lighter .webp where supported; browsers without image-set() ignore this
     declaration and keep the .jpg from the shorthand above. */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    image-set(url('../images/hero-bg.webp') type('image/webp'), url('../images/hero-bg.jpg') type('image/jpeg'));
}

/* On pages with a .page-header the header extends under the fixed navbar
   and draws the navbar's light band itself (see .page-header), so the
   navbar goes transparent and the photo reads as a single image instead of
   two differently-scaled copies meeting at a seam. */
body:has(.page-header) .navbar:not(.scrolled) {
  background: transparent;
}

.navbar.scrolled {
  /* No backdrop-filter blur: at 97% opacity it was invisible, but it forced
     the phone to re-blur the page under the navbar on every scroll frame. */
  background: rgba(255, 255, 255, 0.97);
  padding: 15px 0;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo, .footer-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 68px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: var(--transition);
}

.footer-logo img {
  height: 70px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--secondary-color);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary-color) !important;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.8rem;
  color: var(--secondary-color);
  cursor: pointer;
}

/* HERO SECTION */
.hero {
  padding: 180px 0 100px;
  display: flex;
  align-items: center;
  position: relative;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(230,57,70,0.08) 0%, rgba(230,57,70,0) 70%);
  top: -200px;
  right: -200px;
  border-radius: 50%;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  align-items: start;
  gap: 40px;
  margin-left: max(20px, 5vw);
  margin-right: auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero h1 {
  font-size: 4.5rem;
  margin-bottom: 20px;
  /* Same black as the logo, so the tagline reads as part of the brand. */
  color: var(--logo-black);
  animation: fadeUp 1s ease-out;
}

.hero h1 span {
  /* Same red as the hero stats next to it. */
  color: var(--primary-color);
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 40px;
  color: var(--text-muted);
  max-width: 600px;
  animation: fadeUp 1s ease-out 0.2s both;
}

.hero-stats {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  padding-top: 10px;
  animation: fadeUp 1s ease-out 0.3s both;
}

.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-light);
}

.hero-stat:last-child {
  border-bottom: none;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: -0.02em;
  color: var(--primary-color);
  line-height: 1;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  animation: fadeUp 1s ease-out 0.4s both;
}

/* ABOUT PREVIEW */
.home-about-section {
  background-color: var(--bg-section-alt);
}

.home-about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-img {
  position: relative;
  justify-self: end;
  margin-right: 40px;
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  background-color: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05), 0 18px 40px rgba(26, 26, 36, 0.14);
}

.about-img img {
  max-height: 490px;
  width: auto;
  border-radius: 10px;
}

.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* SERVICES */
.services {
  background-color: var(--bg-color);
}

.services-grid {
  /* Flex instead of grid so an incomplete last row (5 lines = 3 + 2) is
     centered under the others instead of left with an empty slot. Cards
     keep a fixed share of the row: 3 per row here, 2 on tablets, 1 on
     phones (see the responsive section). Items in a row stretch to the
     same height. */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 50px;
}

.services-grid > .service-card {
  flex: 0 1 calc((100% - 60px) / 3);
}

.service-card {
  background-color: var(--white);
  padding: 40px 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 4px solid transparent;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-bottom-color: var(--primary-color);
}

.service-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(230, 57, 70, 0.1);
  color: var(--primary-color);
  font-size: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin: 0 auto 25px;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background-color: var(--primary-color);
  color: var(--white);
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.service-card p {
  color: var(--text-muted);
}

/* BENEFITS */
.benefits {
  background-color: var(--secondary-color);
  color: var(--white);
}

.benefits .section-title {
  color: var(--white);
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-top: 50px;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.benefit-icon {
  font-size: 2rem;
  color: var(--primary-color);
}

.benefit-text h4 {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.benefit-text p {
  color: var(--gray-medium);
  font-size: 0.95rem;
}

/* FOOTER
   Charcoal footer with light text (colors in --footer-*). The logo file
   has a white outline, so its black letters still read on it, and the red
   top border separates it from the dark "Por qué elegirnos" block above. */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  border-top: 4px solid var(--primary-color);
  padding: 80px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-logo {
  margin-bottom: 20px;
  display: inline-block;
}

.footer-logo img {
  height: 60px;
}

.footer-about p {
  color: var(--footer-text);
  margin-bottom: 25px;
  max-width: 300px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  background-color: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  color: var(--secondary-color);
  transition: var(--transition);
}

.social-icons a:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-3px);
}

.footer h4 {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--footer-accent);
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--footer-text);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--footer-accent);
  transform: translateX(5px);
}

.footer-contact li {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  color: var(--footer-text);
}

.footer-email {
  color: var(--footer-text);
  overflow-wrap: anywhere;
}

.footer-email:hover {
  color: var(--footer-accent);
  text-decoration: underline;
}

.footer-contact i {
  color: var(--footer-accent);
  font-size: 1.1rem;
  margin-top: 4px;
}

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

/* WHATSAPP FLOAT */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--whatsapp-color);
  color: var(--white);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: var(--transition);
  text-decoration: none;
}

.whatsapp-float:hover {
  background-color: #20b858;
  transform: scale(1.1);
  color: white;
}

/* ANIMATIONS */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  /* Original entrance (40px rise, 0.3s), the same on every screen size.
     Page titles (.page-header h1) use it too, so it's what makes the
     section name slide in when entering Catálogo / Nosotros / Contacto.
     opacity/transform only: both run on the GPU. `all` also animated any
     other property touched meanwhile (colors, shadows, sizes), which on
     phones meant repainting whole sections while they faded in. */
  transform: translateY(40px);
  transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* PAGE WRAPPERS (For pages other than Home to have margin top) */
.page-header {
  padding: 150px 0 80px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)) top / 100% var(--nav-h) no-repeat,
    linear-gradient(135deg, rgba(26, 26, 36, 0.9), rgba(43, 45, 66, 0.8)) 0 var(--nav-h) / 100% 100% no-repeat,
    url('../images/hero-bg.jpg') center/cover no-repeat;
  /* Same .webp upgrade as .navbar */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    linear-gradient(135deg, rgba(26, 26, 36, 0.9), rgba(43, 45, 66, 0.8)),
    image-set(url('../images/hero-bg.webp') type('image/webp'), url('../images/hero-bg.jpg') type('image/jpeg'));
  text-align: center;
  color: var(--white);
}

.page-header h1 {
  font-size: 3.5rem;
  color: var(--white);
  margin-bottom: 15px;
}

.page-header p {
  font-size: 1.2rem;
  color: var(--gray-medium);
}

/* CATALOG PAGE */
.catalog-section { padding: 80px 0 100px; }
.catalog-tabs { scroll-margin-top: 110px; position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 70px; }
/* Only two states: inactive (thin gray outline) and active (solid red).
   Width follows the content; min-height keeps a 44px touch target. */
.catalog-tab { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; padding: 10px 18px; background-color: transparent; color: var(--secondary-color); border: 1px solid var(--gray-medium); font-size: 1rem; white-space: nowrap; }
.catalog-tab i { margin-right: 8px; color: var(--primary-color); transition: var(--transition); }
.catalog-tab.active { background-color: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); box-shadow: var(--shadow-primary); }
.catalog-tab.active i { color: var(--white); }
/* Hover only on real pointers: on touch screens :hover sticks after a tap
   and looked like a third state. It just darkens the outline, never red. */
@media (hover: hover) {
  .catalog-tab:not(.active):hover { border-color: var(--text-muted); }
}
.catalog-category { display: none; margin-bottom: 90px; }
.catalog-category.active { display: block; }
.catalog-category:last-child { margin-bottom: 0; }
/* Product cards (catalog): shop-style card with an edge-to-edge square
   photo, then name / reference and the
   WhatsApp button pinned to the bottom so buttons align across a row. */
/* Medium cards: at most 4 per row (~250px each), centered under the title. */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; max-width: 1060px; margin: 0 auto; }
.product-card { background: var(--white); border-radius: 14px; overflow: hidden; border: 1px solid #e3e6ea; box-shadow: var(--shadow-sm); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.product-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #f4f5f7; }
.product-img { width: 100%; height: 100%; object-fit: cover; object-position: var(--img-pos, center); transition: transform 0.4s ease; }
.product-media--contain { background: var(--white); }
.product-media--contain .product-img { object-fit: contain; padding: 10px; }
.product-card:hover .product-img { transform: scale(1.04); }
a.product-media { display: block; }
.product-info { padding: 14px 14px 16px; display: flex; flex-direction: column; flex-grow: 1; }
.product-title { font-size: 1rem; font-family: var(--font-heading); font-weight: 600; line-height: 1.3; color: var(--secondary-color); margin-bottom: 6px; }
.product-title a { color: inherit; }
.product-title a:hover { color: var(--primary-dark); }
/* min-height keeps the button aligned when a product has no reference */
.product-ref { font-size: 0.9rem; color: var(--text-muted); min-height: 1.5em; margin-bottom: 14px; }
.btn-whatsapp { margin-top: auto; background-color: var(--whatsapp-color); color: white; display: flex; justify-content: center; align-items: center; gap: 7px; width: 100%; box-shadow: none; border-radius: 8px; padding: 10px 8px; font-weight: 600; font-family: var(--font-heading); font-size: 0.85rem; white-space: nowrap; transition: var(--transition); border: none; cursor: pointer; text-decoration: none; }
.btn-whatsapp:hover { background-color: var(--whatsapp-dark); color: white; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4); }
/* Card button: opens the product's detail page. Kept quiet (thin outline,
   dark text) so the photo stays the focus; turns brand red on hover. */
.btn-details { margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; padding: 9px 8px; border: 1px solid #d5d9de; border-radius: 8px; background: transparent; color: var(--secondary-color); font-family: var(--font-heading); font-weight: 500; font-size: 0.9rem; white-space: nowrap; transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease; }
.btn-details i { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s ease, color 0.2s ease; }
.btn-details:hover { border-color: var(--primary-dark); color: var(--primary-dark); background-color: rgba(214, 40, 57, 0.04); }
.btn-details:hover i { color: var(--primary-dark); transform: translateX(3px); }

.lightbox { position: fixed; inset: 0; background: rgba(26, 26, 36, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 16px; z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease; }
.lightbox.active { opacity: 1; visibility: visible; }
/* The stage clips the zoomed photo; touch-action lets JS pan it on phones. */
.lightbox-stage { max-width: 92vw; max-height: calc(100vh - 110px); overflow: hidden; border-radius: var(--border-radius); background: var(--white); touch-action: none; }
.lightbox-img { display: block; max-width: 92vw; max-height: calc(100vh - 110px); object-fit: contain; cursor: zoom-in; transition: transform 0.3s ease; }
.lightbox.is-zoomed .lightbox-img { transform: scale(2.5); cursor: zoom-out; transition: transform 0.3s ease, transform-origin 0.08s linear; }
.lightbox-close { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; border: none; background: transparent; color: var(--white); font-size: 1.8rem; cursor: pointer; }
.lightbox-hint { margin-top: 12px; color: rgba(255, 255, 255, 0.75); font-size: 0.9rem; }
.lightbox.is-zoomed .lightbox-hint { visibility: hidden; }

body.lightbox-open { overflow: hidden; }

/* ABOUT PAGE */
/* Alternating image/text rows (Intro, Misión, Visión). Combined with
   .container, so only longhand padding-top/bottom is set here - a
   shorthand `padding` would clobber .container's left/right padding. */
.about-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding-top: 90px;
  padding-bottom: 90px;
}

.about-block--reverse .about-block-img { order: 2; }
.about-block--reverse .about-block-text { order: 1; }

.about-block-img {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-block-img img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

.about-block-text h2 {
  font-size: 2.3rem;
  margin-bottom: 20px;
}

.about-block-text p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.75;
}

.quality-block {
  background: var(--bg-alt);
  padding: 90px 0;
  text-align: center;
}

.quality-block-inner {
  max-width: 760px;
  margin: 0 auto;
}

.quality-block-inner i {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.quality-block-inner h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.quality-block-inner p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.8;
}

.team-section { background: var(--white); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 40px; margin-top: 50px; }
.team-card { text-align: center; border-radius: var(--border-radius); padding: 40px 20px; background: var(--white); box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid var(--gray-medium); }
.team-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); border-color: transparent; }
.team-img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin: 0 auto 20px; border: 4px solid var(--white); box-shadow: 0 0 0 3px var(--primary-color); }
.team-name { font-size: 1.4rem; margin-bottom: 5px; font-family: var(--font-heading); color: var(--secondary-color); }
.team-role { color: var(--primary-color); font-size: 1rem; font-weight: 600; margin-bottom: 15px; }

.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 40px; }
.values-grid--5 { grid-template-columns: repeat(5, 1fr); }
.value-card { padding: 40px 30px; text-align: center; background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); transition: var(--transition); border-bottom: 3px solid transparent; }
.value-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-bottom-color: var(--primary-color); }
.value-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; }
.value-card h3 { margin-bottom: 15px; font-size: 1.3rem; }

/* CONTACT PAGE */
.contact-container { display: grid; grid-template-columns: 1fr 1.5fr; align-items: start; gap: 35px; margin-top: 25px; }
.contact-info { background: var(--secondary-color); color: var(--white); padding: 35px 30px; border-radius: var(--border-radius); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.contact-info::before { content: ''; position: absolute; width: 250px; height: 250px; background: rgba(230, 57, 70, 0.1); border-radius: 50%; top: -50px; right: -50px; }
.contact-info::after { content: ''; position: absolute; width: 150px; height: 150px; background: rgba(255, 255, 255, 0.05); border-radius: 50%; bottom: -50px; left: -50px; }
.contact-info h3 { color: var(--white); margin-bottom: 20px; font-size: 1.7rem; position: relative; z-index: 1; }
.contact-methods { margin-bottom: 20px; position: relative; z-index: 1; }
.contact-method { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.contact-method i { color: var(--primary-color); font-size: 1.5rem; margin-top: 3px; }
.contact-method h4 { color: var(--white); font-size: 1.2rem; margin-bottom: 5px; font-family: var(--font-heading); }
.contact-method p { color: var(--gray-medium); font-size: 1rem; }
.contact-email { overflow-wrap: anywhere; }
.contact-email:hover { color: var(--white); text-decoration: underline; }
.contact-form { background: var(--white); padding: 35px 30px; border-radius: var(--border-radius); box-shadow: var(--shadow-md); border: 1px solid var(--gray-medium); }
.contact-form h3 { margin-bottom: 20px; font-size: 1.7rem; color: var(--secondary-color); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-main); }
.form-control { width: 100%; padding: 12px 16px; border: 1px solid var(--gray-medium); border-radius: 8px; font-family: var(--font-body); font-size: 1rem; transition: var(--transition); background: #f9fafb; }
.form-control:focus { outline: none; border-color: var(--primary-color); background: var(--white); box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.1); }
.form-optional { font-weight: 400; color: var(--text-muted); font-size: 0.85em; }
.form-success a { color: inherit; text-decoration: underline; font-weight: 700; }
.form-success { margin-top: 15px; padding: 12px 16px; background: rgba(37, 211, 102, 0.1); color: #1a7f45; border-radius: 8px; font-weight: 500; text-align: center; }
.form-error { margin-top: 15px; padding: 12px 16px; background: rgba(214, 40, 57, 0.08); color: var(--primary-darker); border-radius: 8px; font-weight: 500; text-align: center; }
.form-error a { color: inherit; text-decoration: underline; font-weight: 700; }
.form-consent { display: flex; align-items: flex-start; gap: 10px; }
.form-consent input { margin-top: 5px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary-dark); }
.form-consent label { margin-bottom: 0; font-weight: 400; font-size: 0.92rem; color: var(--text-muted); }
.form-consent a { color: var(--primary-dark); text-decoration: underline; }
/* Honeypot: off-screen (not display:none, which some bots skip). */
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
textarea.form-control { height: 100px; resize: vertical; }
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  color: var(--text-main);
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.map-heading { margin-top: 35px; margin-bottom: 20px; font-size: 1.7rem; color: var(--secondary-color); }
.map-container { position: relative; width: 100%; height: 420px; border-radius: var(--border-radius); overflow: hidden; background: var(--gray-medium); box-shadow: var(--shadow-md); border: 1px solid var(--gray-medium); }
.map-container iframe { width: 100%; height: 100%; border: none; }
.map-open-link { position: absolute; top: 16px; right: 16px; z-index: 2; display: flex; align-items: center; gap: 8px; background: var(--white); color: var(--secondary-color); font-size: 0.85rem; font-weight: 600; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow-md); transition: var(--transition); }
.map-open-link i { color: var(--primary-color); font-size: 0.8rem; }
.map-open-link:hover { background: var(--primary-color); color: var(--white); }
.map-open-link:hover i { color: var(--white); }
@media (max-width: 992px) {
  .contact-container { grid-template-columns: 1fr; }
  .contact-form, .contact-info { padding: 30px 25px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .map-container { height: 320px; }
}

/* 404 PAGE */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 150px 0 90px;
  text-align: center;
  /* Wire-mesh grid, a nod to the products */
  background:
    linear-gradient(var(--gray-light) 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(90deg, var(--gray-light) 1px, transparent 1px) 0 0 / 36px 36px,
    var(--bg-alt);
}
.not-found-inner { max-width: 760px; }
.not-found-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 9rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--secondary-color);
  margin-bottom: 20px;
  animation: fadeUp 1s ease-out;
}
.not-found-code span {
  color: transparent;
  -webkit-text-stroke: 6px var(--primary-color);
  display: inline-block;
  animation: notFoundSwing 3s ease-in-out infinite;
}
@keyframes notFoundSwing {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}
.not-found h1 {
  font-size: 2.6rem;
  margin-bottom: 15px;
  animation: fadeUp 1s ease-out 0.1s both;
}
.not-found-text {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 35px;
  animation: fadeUp 1s ease-out 0.2s both;
}
.not-found-btns {
  justify-content: center;
  animation: fadeUp 1s ease-out 0.3s both;
}
.not-found-btns .btn i { margin-right: 6px; }
.not-found-categories {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--gray-light);
  animation: fadeUp 1s ease-out 0.4s both;
}
.not-found-categories h2 { font-size: 1.3rem; margin-bottom: 20px; }
.not-found-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.not-found-link {
  background: var(--white);
  border: 2px solid var(--gray-light);
  border-radius: 50px;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--secondary-color);
}
.not-found-link i { color: var(--primary-color); margin-right: 6px; }
.not-found-link:hover { border-color: var(--primary-color); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.not-found-help { margin-top: 30px; color: var(--text-muted); }
.not-found-help a { color: #1a7f45; font-weight: 600; }
.not-found-help a:hover { color: var(--primary-color); }
@media (prefers-reduced-motion: reduce) {
  .not-found-code span { animation: none; }
}

/* Prerendered page not opened yet (see Layout.astro): keep every CSS
   animation at its first frame until the page is actually shown. */
.is-prerendering *,
.is-prerendering *::before,
.is-prerendering *::after {
  animation-play-state: paused !important;
}

/* LEGAL PAGES (términos / privacidad) */
.legal-section { padding: 70px 0 90px; }
.legal-content { max-width: 820px; }
.legal-content .legal-updated { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 35px; }
.legal-content h2 { font-size: 1.6rem; margin: 40px 0 15px; }
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--text-main); margin-bottom: 12px; }
.legal-content ul { list-style: disc; padding-left: 22px; margin-bottom: 15px; }
.legal-content a { color: var(--primary-dark); font-weight: 600; text-decoration: underline; }
.legal-content a:hover { color: var(--primary-darker); }
.legal-pending { background: #fff3cd; color: #664d03; padding: 0 6px; border-radius: 4px; font-weight: 600; }
.footer-legal { margin-top: 8px; font-size: 0.9rem; }
.footer-legal a { text-decoration: underline; }

/* PRODUCT DETAIL PAGE (producto-*.html) */
.product-detail { padding: calc(var(--nav-h) + 20px) 0 90px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb [aria-current] { color: var(--secondary-color); font-weight: 500; }
.pd-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.pd-gallery { position: sticky; top: calc(var(--nav-h) - 10px); }
.pd-zoom { position: relative; display: block; aspect-ratio: 5 / 6; height: clamp(460px, calc(100vh - var(--nav-h) - 80px), 620px); width: auto; max-width: 100%; margin: 0 auto; padding: 0; border: 1px solid #e3e6ea; border-radius: 16px; overflow: hidden; background: #f4f5f7; cursor: zoom-in; box-shadow: var(--shadow-sm); }
/* Big 5:6 frame (a bit wider than the 3:4 photos) that fills its half of
   the page, at most about the window height (460-620px). Vertical photos
   fill it, losing only a little background top/bottom; landscape ones are
   shown whole (--contain). */
.pd-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--img-pos, center); }
.pd-zoom--contain { background: var(--white); }
.pd-zoom--contain .pd-img { object-fit: contain; }
/* Magnifier: the full-resolution photo at 1.6x, following the cursor
   (background-size sets the zoom level: 160% = 1.6x). */
.pd-lens { position: absolute; background-repeat: no-repeat; background-size: 160%; background-color: #f4f5f7; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.pd-zoom.is-magnifying .pd-lens { opacity: 1; }
.pd-zoom-hint { margin-top: 10px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.pd-zoom-hint i { color: var(--primary-dark); margin-right: 6px; }
.pd-hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .pd-hint-mouse { display: none; }
  .pd-hint-touch { display: inline; }
}
.pd-line { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 12px; }
.pd-line:hover { color: var(--primary-darker); }
.pd-title { font-size: 2.4rem; line-height: 1.15; margin-bottom: 10px; }
.pd-ref { color: var(--text-muted); margin-bottom: 20px; }
.pd-ref strong { color: var(--secondary-color); }
.pd-desc { font-size: 1.05rem; color: var(--text-main); margin-bottom: 22px; }
.pd-measures { margin-bottom: 26px; }
.pd-measures-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: var(--secondary-color); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.pd-measures-title i { color: var(--primary-color); }
.pd-measures-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0; }
.pd-measure { background: var(--bg-alt); border: 1px solid var(--gray-light); border-radius: 10px; padding: 10px 12px; }
.pd-measure dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.pd-measure dd { margin: 2px 0 0; font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; color: var(--secondary-color); }
.pd-features { margin-bottom: 28px; display: grid; gap: 10px; }
.pd-features li { display: flex; gap: 10px; align-items: baseline; color: var(--text-main); }
.pd-features i { color: var(--whatsapp-dark); font-size: 0.9rem; }
.btn-whatsapp.pd-cta { margin-top: 0; padding: 14px 18px; font-size: 1.05rem; border-radius: 10px; }
.pd-back { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 500; color: var(--text-muted); }
.pd-back:hover { color: var(--primary-dark); }
.pd-related { margin-top: 80px; }
.pd-related-title { font-size: 1.6rem; text-align: center; margin-bottom: 28px; }

/* RESPONSIVE DESIGN
   Kept at the very end of the file on purpose: every selector overridden
   here (.page-header, .catalog-section, .contact-container, etc.) is
   defined earlier in the file, and a same-specificity rule only wins by
   coming later in source order - a media query does not add specificity.
   Adding a mobile override earlier than the rule it's meant to override
   gets silently ignored. */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 3.5rem;
  }
  .home-about, .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-img {
    order: -1;
    justify-self: center;
    margin-right: 0;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    /* The desktop left offset (max(20px, 5vw)) stacks on top of the
       container padding in a single column, pushing the hero right of
       every other section. Back to the normal centered container. */
    margin-left: auto;
    margin-right: auto;
  }
  .hero-stats {
    max-width: 100%;
  }
  .about-block {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 60px;
    padding-bottom: 60px;
  }
  /* Image always on top on mobile, even for --reverse rows: reset the
     desktop order swap so DOM order (image, then text) wins. */
  .about-block--reverse .about-block-img {
    order: 0;
  }
  .about-block--reverse .about-block-text {
    order: 0;
  }
  .about-block-img img {
    height: 300px;
  }
  .quality-block {
    padding: 60px 0;
  }
  .values-grid--5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .pd-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .pd-gallery {
    position: static;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }
  .services-grid > .service-card {
    flex-basis: calc((100% - 30px) / 2);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    flex-direction: column;
    padding: 20px 0;
    gap: 0;
    box-shadow: var(--shadow-md);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: var(--transition);
  }

  .nav-links.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }

  .nav-links a {
    color: var(--secondary-color) !important;
    padding: 15px 30px;
    display: block;
    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero {
    padding: 140px 0 60px;
  }

  .page-header {
    padding: 120px 0 50px;
  }

  .page-header h1 {
    font-size: 2.5rem;
  }

  section {
    padding: 60px 0;
  }

  .catalog-section {
    padding: 50px 0 60px;
  }

  .services-grid > .service-card {
    flex-basis: 100%;
  }

  /* Category chips become one swipeable row (hidden scrollbar) instead of
     wrapping into a tall stack. The negative margin lets the row bleed to
     the screen edges; the padding keeps the first/last chip aligned with
     the content and leaves room for the active chip's shadow. */
  .catalog-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0 -20px 40px;
    padding: 4px 20px 14px;
    gap: 10px;
  }

  .catalog-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Two product cards per row on phones, like a shop. */
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .product-info {
    padding: 12px 12px 14px;
  }

  .product-title {
    font-size: 0.95rem;
  }

  .product-ref {
    font-size: 0.8rem;
  }

  .btn-details {
    font-size: 0.85rem;
    padding: 9px 6px;
  }

  .pd-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .pd-gallery {
    position: static;
  }

  .pd-title {
    font-size: 1.8rem;
  }

  .pd-zoom {
    height: auto;
    width: 100%;
    max-height: 62vh;
  }

  .pd-related {
    margin-top: 56px;
  }

  .section-title {
    font-size: 2.5rem;
  }

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

  .logo img {
    height: 52px;
  }

  :root {
    --nav-h: 92px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .hero-btns .btn,
  .hero-btns a {
    width: 100%;
  }

  .about-block-text h2 {
    font-size: 1.9rem;
  }

  .values-grid--5 {
    grid-template-columns: 1fr;
  }

  .not-found-code {
    font-size: 5.5rem;
  }

  .not-found-code span {
    -webkit-text-stroke-width: 4px;
  }

  .not-found h1 {
    font-size: 1.8rem;
  }

  .not-found-btns .btn {
    width: 100%;
  }
}
