:root {
  --blue: #075aa6;
  --navy: #073b70;
  --green: #75d39a;
  --green-dark: #16704a;
  --ink: #172331;
  --muted: #667685;
  --line: #dbe4eb;
  --surface: #ffffff;
  --background: #f4f7fa;
  --shadow: 0 14px 35px rgba(7, 59, 112, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  max-width: 1440px;
  min-height: 78px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand { display: inline-flex; align-items: center; }
.brand img { display: block; width: 176px; height: auto; }

.main-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.main-menu a {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.main-menu a:hover,
.main-menu a:focus-visible,
.main-menu .is-current { color: var(--blue); }

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.menu-button__line {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--navy);
}

.intro {
  padding: 48px max(32px, calc((100% - 1376px) / 2));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  color: #ffffff;
  background-color: var(--navy);
  background-image:
    linear-gradient(
      90deg,
      rgba(3, 34, 63, 0.92) 0%,
      rgba(3, 34, 63, 0.78) 42%,
      rgba(3, 34, 63, 0.38) 72%,
      rgba(3, 34, 63, 0.24) 100%
    ),
    url("assets/banner-greiz-productos-1920x600.webp");
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.25px;
}

.intro .eyebrow { color: #b5f2cc; }

.intro h1 {
  max-width: 720px;
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.intro p:last-child { margin: 0; color: #e5eff7; }

.catalog {
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px 32px 52px;
  display: grid;
  grid-template-columns: minmax(290px, 370px) 1fr;
  gap: 28px;
  align-items: start;
}

.product-index {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.product-index__heading {
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.product-index__heading h2 { margin: 0; font-size: 25px; }

.product-index__list details { border-bottom: 1px solid var(--line); }
.product-index__list details:last-child { border-bottom: 0; }

.product-index__list summary {
  position: relative;
  padding: 13px 44px 13px 20px;
  list-style: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.product-index__list summary::-webkit-details-marker { display: none; }

.product-index__list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  color: var(--blue);
  font-size: 21px;
  font-weight: 400;
}

.product-index__list details[open] summary {
  color: var(--navy);
  background: #eef7f1;
}

.product-index__list details[open] summary::after { content: "−"; }

.product-index__list summary:hover,
.product-index__list summary:focus-visible { color: var(--blue); background: #f2f7fb; }

.subproducts {
  margin: 0;
  padding: 7px 0 10px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
  list-style: none;
}

.subproducts li {
  position: relative;
  padding: 0;
  border-top: 1px solid #edf1f4;
}

.subproduct-button {
  position: relative;
  width: 100%;
  padding: 10px 20px 10px 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.subproduct-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 21px;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  transform: translateY(-50%);
}

.subproduct-button:hover,
.subproduct-button:focus-visible,
.subproduct-button.is-selected {
  color: var(--navy);
  background: #edf7f1;
}

.catalog-content {
  position: sticky;
  top: 96px;
  align-self: start;
  min-height: 540px;
  display: grid;
  place-items: center;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  scroll-margin-top: 145px;
}

.product-detail {
  width: 100%;
  align-items: center;
  grid-template-columns: minmax(250px, 1fr) minmax(280px, 1fr);
  gap: 38px;
}

.product-detail:not([hidden]) { display: grid; }

.product-detail__image {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  background: linear-gradient(145deg, #eef3f7, #e1f0e7);
  border: 1px dashed #aebcc7;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
}

.product-detail__image img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms ease;
}

.product-detail__image img.is-ready { opacity: 1; }

.product-detail__content h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
}

.product-detail__content > p:last-of-type { color: var(--muted); }

.technical-sheet {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 17px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.quote-product {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 22px;
  color: #063b24;
  background: var(--green);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.technical-sheet.is-disabled {
  color: #6e7a83;
  background: #dfe5e9;
  cursor: not-allowed;
}

.whatsapp-contact {
  max-width: 1376px;
  margin: 0 auto 38px;
  padding: 27px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  color: #ffffff;
  background: linear-gradient(110deg, #0b6143, #12845b);
  border-radius: 10px;
}

.whatsapp-contact .eyebrow { color: #bdf3d0; }
.whatsapp-contact h2 { margin: 0 0 5px; font-size: 27px; }
.whatsapp-contact p:last-child { margin: 0; color: #e1f4e9; }

.whatsapp-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  flex: 0 0 auto;
  padding: 13px 18px;
  color: #ffffff;
  background: #12845b;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(4, 52, 36, 0.28);
  font-weight: 800;
  text-decoration: none;
}

.whatsapp-button:hover,
.whatsapp-button:focus-visible {
  background: #0b6143;
}

.whatsapp-button.is-disabled {
  opacity: 0.82;
  cursor: not-allowed;
}

.catalog-placeholder { max-width: 550px; text-align: center; }

.catalog-placeholder__mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  color: var(--blue);
  border: 11px solid var(--blue);
  border-right-color: var(--green);
  border-radius: 50%;
  font-size: 32px;
  font-weight: 900;
}

.catalog-placeholder h2 { margin: 0 0 10px; font-size: 30px; }
.catalog-placeholder p:last-child { margin: 0; color: var(--muted); }

.footer {
  padding: 26px max(32px, calc((100% - 1376px) / 2));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 22px;
  color: #dce9f2;
  background: var(--navy);
}

.footer div { display: flex; flex-direction: column; gap: 3px; }
.footer > div:first-child,
.footer > div:nth-child(2) { flex: 1 1 calc(50% - 11px); min-width: 0; }
.footer > div:nth-child(2) { text-align: right; }
.footer > div:nth-child(2) span:last-child { white-space: nowrap; }

.footer .footer__copyright {
  flex-basis: 100%;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
}

@media (max-width: 940px) {
  .menu-button { display: block; }
  .main-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 15px 24px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .main-menu.is-open { display: flex; }
  .main-menu a { padding: 12px 4px; }
}

@media (max-width: 760px) {
  .topbar__inner { min-height: 66px; padding: 9px 18px; flex-wrap: wrap; gap: 10px; }
  .brand { order: 1; }
  .brand img { width: 145px; }
  .menu-button { order: 2; }
  .main-menu { order: 4; }
  .intro {
    padding: 36px 20px;
    align-items: flex-start;
    flex-direction: column;
    background-image:
      linear-gradient(rgba(3, 34, 63, 0.86), rgba(3, 34, 63, 0.80)),
      url("assets/banner-greiz-productos-1920x600.webp");
    background-position: center, left center;
  }
  .catalog { padding: 24px 18px 38px; grid-template-columns: 1fr; }
  .catalog-content {
    position: static;
    min-height: 330px;
    padding: 28px 20px;
  }
  .product-detail:not([hidden]) { grid-template-columns: 1fr; }
  .product-detail__image { min-height: 260px; }
  .whatsapp-contact { margin: 0 18px 30px; padding: 24px 22px; align-items: flex-start; flex-direction: column; }
  .footer { padding: 24px 20px; flex-direction: column; flex-wrap: nowrap; }
  .footer > div:first-child,
  .footer > div:nth-child(2) { flex: 0 1 auto; }
  .footer > div:nth-child(2) { text-align: left; }
  .footer .footer__copyright { flex-basis: auto; }
}

@media (max-width: 420px) {
  .intro h1 { font-size: 31px; }
  .product-actions a { width: 100%; text-align: center; }
  .product-index__list summary { font-size: 13px; }
  .whatsapp-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    padding: 11px 15px;
    font-size: 14px;
    text-align: center;
  }
}
