:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-soft: #edf3f7;
  --ink: #14304a;
  --muted: #647385;
  --line: rgba(20, 48, 74, 0.12);
  --brand: #002846;
  --brand-2: #1c5a8c;
  --brand-3: #4a90c2;
  --gold: #caa653;
  --theme: var(--brand-2);
  --theme-deep: var(--brand);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow: 0 22px 60px rgba(11, 31, 49, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(74, 144, 194, 0.08), transparent 24%),
    radial-gradient(circle at 100% 8%, rgba(202, 166, 83, 0.08), transparent 20%),
    linear-gradient(180deg, #f8fbfd 0%, #edf3f8 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header .shell {
  width: min(980px, calc(100% - 26px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(248, 251, 253, 0.82);
  border-bottom: 1px solid rgba(20, 48, 74, 0.08);
}

.header-row,
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.header-row {
  margin: 8px auto;
  padding: 8px 16px;
  border: 1px solid rgba(20, 48, 74, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.site-footer img {
  width: 176px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--brand);
}

.main-nav > a,
.nav-dropdown summary {
  position: relative;
  cursor: pointer;
  padding: 4px 0;
}

.main-nav > a::after,
.nav-dropdown summary::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--theme));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.main-nav > a:hover::after,
.main-nav > a:focus-visible::after,
.nav-dropdown summary:hover::after,
.nav-dropdown[open] summary::after {
  transform: scaleX(1);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  padding-right: 12px;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::before {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-weight: 700;
  color: var(--theme);
}

.nav-dropdown[open] summary::before {
  content: "-";
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  padding: 10px;
  border: 1px solid rgba(20, 48, 74, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 4px;
}

.dropdown-panel a {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
}

.dropdown-panel a:hover {
  background: var(--surface-soft);
}

.dropdown-panel a:first-child {
  font-weight: 800;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-page,
.page-hero {
  position: relative;
  overflow: hidden;
}

.hero-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(0, 40, 70, 0.90), rgba(28, 90, 140, 0.90)),
    url('img/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--theme-deep), var(--theme)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.14), transparent 28%);
}

.premium-hero {
  padding: 30px 0 22px;
}

.page-hero {
  padding: 22px 0 14px;
}

.hero-layout,
.contact-layout,
.section-head,
.detail-grid,
.division-hero,
.hero-layout-premium {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.hero-copy,
.hero-panel,
.contact-box,
.contact-form,
.feature-card,
.division-card,
.info-card,
.branch-card,
.cert-card,
.organism-card,
.division-section,
.process-card,
.service-detail,
.showcase-card,
.hero-photo-card,
.hero-mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.dark-box,
.page-hero-inner {
  position: relative;
  color: #fff;
}

.hero-copy,
.hero-panel,
.dark-box {
  padding: 28px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.page-hero-inner {
  display: grid;
  gap: 12px;
  padding: 26px 0 14px;
}

.premium-copy {
  align-self: center;
}

.eyebrow,
.card-tag,
.detail-tag {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.08;
}

h1 {
  margin-top: 14px;
  font-size: clamp(1.8rem, 3.1vw, 3rem);
  letter-spacing: -0.04em;
  max-width: 13ch;
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.3rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

.page-hero-inner h1 {
  max-width: 11ch;
  font-size: clamp(1.55rem, 2.3vw, 2.35rem);
}

.page-hero-inner p:not(.eyebrow) {
  max-width: 58ch;
}

h3 {
  font-size: 0.98rem;
  line-height: 1.25;
}

.hero-copy p,
.hero-panel p,
.page-hero-inner p,
.section-head p,
.feature-card p,
.info-card p,
.branch-card p,
.cert-card p,
.organism-card p,
.division-section p,
.process-card p,
.service-detail p,
.contact-form label,
.form-note,
.site-footer p,
.sub-nav a,
.contact-list span,
.photo-overlay span {
  font-size: 0.9rem;
  line-height: 1.65;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 62ch;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--theme), var(--theme-deep));
}

.button-secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.hero-ribbon-grid,
.stats-grid,
.feature-grid,
.division-grid,
.info-grid,
.cert-grid,
.organism-grid,
.branches-grid,
.process-grid,
.services-mini-grid,
.hero-mini-grid,
.division-showcase-grid {
  display: grid;
  gap: 16px;
}

.hero-ribbon-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.hero-ribbon-grid article,
.stats-grid article {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
}

.hero-ribbon-grid strong,
.stats-grid strong,
.branch-card strong,
.contact-list strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.35;
}

.hero-ribbon-grid span,
.stats-grid span,
.dark-box .contact-list span,
.dark-box .contact-list a,
.dark-box .contact-list strong,
.page-hero-inner p,
.hero-panel p,
.sub-nav a {
  color: rgba(255, 255, 255, 0.82);
}

.hero-media-stack {
  display: grid;
  gap: 16px;
}

.hero-photo-card,
.hero-mini-card,
.showcase-card,
.division-visual {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.hero-photo-card::before,
.hero-mini-card::before,
.showcase-card::before,
.division-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 17, 30, 0.1), rgba(4, 16, 28, 0.76)),
    linear-gradient(135deg, rgba(0, 40, 70, 0.24), rgba(28, 90, 140, 0.08));
}

.hero-photo-card::after,
.hero-mini-card::after,
.showcase-card::after,
.division-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: saturate(0.82) contrast(1.02) brightness(0.92);
  pointer-events: none;
}

.photo-overlay {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  height: 100%;
  padding: 20px;
  color: #fff;
}

.photo-overlay h3,
.hero-mini-card span {
  color: #fff;
}

.hero-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-mini-card {
  min-height: 132px;
  display: grid;
  align-items: end;
  padding: 18px;
}

.hero-mini-card span {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  font-weight: 700;
}

.section-block {
  padding: 22px 0;
}

.section-soft {
  background: linear-gradient(180deg, rgba(237, 243, 247, 0.88), rgba(248, 251, 253, 0.72));
}

.section-surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(245, 248, 251, 0.8));
}

.section-dark {
  background: linear-gradient(180deg, #08263f 0%, #103653 100%);
}

.section-head {
  align-items: end;
  margin-bottom: 18px;
}

.section-head p,
.feature-card p,
.info-card p,
.branch-card p,
.cert-card p,
.division-section p,
.process-card p,
.service-detail p,
.form-note,
.site-footer p {
  color: var(--muted);
}

.section-dark .section-head h2,
.section-dark .section-head p,
.section-dark .eyebrow,
.section-dark .organism-card h3,
.section-dark .organism-card p {
  color: #fff;
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.info-card,
.branch-card,
.cert-card,
.cert-badge-board,
.division-section,
.process-card,
.service-detail,
.contact-form,
.feature-card-premium {
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
}

.feature-card-premium {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 250, 0.95));
}

.cert-badge-board {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 249, 0.96));
}

.cert-badge-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.cert-badge-grid-iso {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cert-badge {
  min-height: 172px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(229, 238, 246, 0.94));
  display: grid;
  align-content: start;
  gap: 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.cert-badge span {
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cert-badge strong {
  color: var(--brand);
  font-size: 1.8rem;
  line-height: 1;
}

.cert-badge p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.cert-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cert-preview-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.cert-preview-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(247, 250, 253, 1), rgba(233, 240, 246, 0.95));
}

.cert-preview-badge img {
  width: min(100%, 180px);
  display: block;
}

.cert-preview-badge-text span {
  color: var(--brand);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cert-preview-card h3 {
  margin-top: 8px;
}

.cert-preview-card p {
  color: var(--muted);
}

.feature-card h3,
.division-card strong,
.info-card h3,
.branch-card h3,
.cert-card h3,
.organism-card h3,
.division-section h3,
.process-card h3,
.service-detail h3 {
  margin-top: 8px;
}

.division-showcase-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
}

.showcase-card {
  min-height: 220px;
}

.contact-layout {
  align-items: start;
}

.dark-box h2 {
  color: #fff;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.contact-list li {
  display: grid;
  gap: 4px;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--brand);
  font-weight: 700;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
}

.contact-form textarea {
  min-height: 132px;
  resize: vertical;
}

.full-span {
  grid-column: 1 / -1;
}

.site-footer {
  padding: 40px 0;
  background: #103653; /* Integra sin cortes con la sección de contacto */
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-row {
  margin-top: 0;
  padding: 0 20px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer img {
  display: block;
  max-height: 110px;
  width: auto !important;
  object-fit: contain;
  background: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 16px;
}

.site-footer p {
  color: rgba(255, 255, 255, 0.65) !important;
  font-size: 0.88rem;
  margin-top: 8px;
  max-width: 450px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.88rem;
  font-weight: 700;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-links a:hover {
  color: var(--brand-light, #4fa3e3);
  transform: translateY(-1px);
}


.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sub-nav a {
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  font-weight: 700;
}

.sub-nav a:hover,
.sub-nav a.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.page-stack {
  display: grid;
  gap: 18px;
}

.info-grid.two-up,
.detail-grid,
.process-grid.three-up,
.services-mini-grid.two-up,
.cert-grid.two-up,
.branches-grid.two-up,
.organism-grid.three-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.process-grid.three-up,
.organism-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card ul,
.division-section ul,
.service-detail ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.info-card li,
.division-section li,
.service-detail li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.info-card li::before,
.division-section li::before,
.service-detail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.division-banner {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--theme-deep), var(--theme));
  color: #fff;
  box-shadow: var(--shadow);
}

.division-banner p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
}

.division-visual {
  min-height: 260px;
}

.division-visual .photo-overlay {
  justify-content: end;
}

.media-visual {
  padding: 0;
  background: #dfe7ee;
}

.media-visual img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.organism-grid .organism-card,
.section-dark .organism-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.organism-card img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 8px;
}

.cert-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--theme);
  font-size: 0.82rem;
  font-weight: 700;
}

.branch-card strong {
  color: var(--theme-deep);
  margin-top: 2px;
}

.branch-card.branch-main {
  background: linear-gradient(180deg, var(--theme-deep), var(--theme));
}

.branch-card.branch-main h3,
.branch-card.branch-main p,
.branch-card.branch-main strong,
.branch-card.branch-main .card-tag {
  color: #fff;
}

.hero-logo {
  width: min(320px, 100%);
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
}

.photo-clean { background-image: url("https://images.unsplash.com/photo-1581578731548-c64695cc6952?auto=format&fit=crop&w=1200&q=80"); }
.photo-security { background-image: url("img/SeguridadPrincipal.jpeg"); }
.photo-waste { background-image: url("https://images.unsplash.com/photo-1532996122724-e3c354a0b15b?auto=format&fit=crop&w=1200&q=80"); }
.photo-fumi { background-image: url("https://images.unsplash.com/photo-1527515637462-cff94eecc1ac?auto=format&fit=crop&w=1200&q=80"); }
.photo-fire { background-image: url("img/protocoloincendios.jpeg"); }
.photo-maint { background-image: url("img/soporte.jpeg"); }
.photo-products { background-image: url("https://images.unsplash.com/photo-1583947215259-38e31be8751f?auto=format&fit=crop&w=1200&q=80"); }
.photo-med { background-image: url("https://images.unsplash.com/photo-1584515933487-779824d29309?auto=format&fit=crop&w=1200&q=80"); }
.photo-admin { background-image: url("https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1200&q=80"); }
.photo-garden { background-image: url("https://images.unsplash.com/photo-1466692476868-aef1dfb1e735?auto=format&fit=crop&w=1200&q=80"); }
.photo-const { background-image: url("img/soporte.jpeg"); }

.division-clean { --theme: #2f7fb6; }
.division-security { --theme: #2b313c; }
.division-waste { --theme: #4f8b5c; }
.division-fumi { --theme: #2f9893; }
.division-fire { --theme: #cf4f3f; }
.division-maint { --theme: #557c98; }
.division-products { --theme: #3f86ad; }
.division-med { --theme: #3a8ed2; }
.division-admin { --theme: #45638f; }
.division-garden { --theme: #5a9854; }

.theme-home { --theme: #1c5a8c; --theme-deep: #002846; }
.theme-clean { --theme: #2f7fb6; --theme-deep: #13476d; }
.theme-security { --theme: #2b313c; --theme-deep: #11161d; }
.theme-waste { --theme: #4f8b5c; --theme-deep: #27503b; }
.theme-fumi { --theme: #2f9893; --theme-deep: #12635f; }
.theme-fire { --theme: #cf4f3f; --theme-deep: #6f2017; }
.theme-maint { --theme: #557c98; --theme-deep: #27465d; }
.theme-products { --theme: #3f86ad; --theme-deep: #1b5778; }
.theme-med { --theme: #3a8ed2; --theme-deep: #1d5d9a; }
.theme-admin { --theme: #45638f; --theme-deep: #233a5d; }
.theme-garden { --theme: #5a9854; --theme-deep: #2e5b2a; }
.theme-const { --theme: #bc5525; --theme-deep: #66260a; }
.theme-maint-const { --theme: #436d80; --theme-deep: #1d3945; }

@media (max-width: 1180px) {
  .hero-layout,
  .hero-layout-premium,
  .contact-layout,
  .section-head,
  .detail-grid,
  .division-hero,
  .info-grid.two-up,
  .cert-grid.two-up,
  .branches-grid.two-up,
  .organism-grid.three-up,
  .process-grid.three-up,
  .services-mini-grid.two-up,
  .three-up,
  .division-showcase-grid,
  .image-gallery,
  .cert-badge-grid,
  .cert-preview-grid,
  .hero-ribbon-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cert-badge-grid-iso {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 20px, 1320px);
  }

  .header-row,
  .footer-row {
    flex-wrap: wrap;
  }

  .header-row {
    border-radius: 22px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    padding-top: 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown summary {
    width: 100%;
  }

  .dropdown-panel {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 10px;
  }

  .hero-layout,
  .hero-layout-premium,
  .contact-layout,
  .section-head,
  .detail-grid,
  .division-hero,
  .info-grid.two-up,
  .cert-grid.two-up,
  .branches-grid.two-up,
  .organism-grid.three-up,
  .process-grid.three-up,
  .services-mini-grid.two-up,
  .three-up,
  .division-showcase-grid,
  .image-gallery,
  .cert-badge-grid,
  .cert-preview-grid,
  .hero-mini-grid,
  .stats-grid,
  .hero-ribbon-grid,
  .contact-form {
    grid-template-columns: 1fr;
  }

  .cert-badge-grid-iso {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .dark-box,
  .contact-form,
  .feature-card,
  .division-card,
  .info-card,
  .branch-card,
  .cert-card,
  .organism-card,
  .division-section,
  .process-card,
  .service-detail {
    padding: 18px;
  }

  h1 {
    max-width: none;
  }
}

/* Centered Hero & Animations for Home Page */
.hero-layout-centered {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 20px;
  z-index: 2;
}

/* Glassmorphism Panel */
.hero-glass-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 60px 48px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 
    0 24px 80px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-glass-panel h1 {
  font-size: 2.8rem;
  line-height: 1.25;
  font-weight: 800;
  margin-bottom: 20px;
  color: #fff;
  max-width: none;
  text-align: center;
}

.hero-glass-panel p:not(.eyebrow) {
  font-size: 1.15rem;
  line-height: 1.6;
  opacity: 0.9;
  max-width: 780px;
  margin: 0 auto 32px;
  color: #fff;
}

.hero-glass-panel .hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 44px;
}

/* Background Animated Blobs */
.blob-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.15;
  animation: floatBlob 20s infinite alternate ease-in-out;
}

.blob-1 {
  top: -10%;
  left: 15%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #4fa3e3, transparent);
  animation-duration: 25s;
}

.blob-2 {
  bottom: -15%;
  right: 15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #2f9893, transparent);
  animation-duration: 30s;
  animation-delay: -5s;
}

.blob-3 {
  top: 35%;
  left: 45%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #cf4f3f, transparent);
  opacity: 0.08;
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes floatBlob {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(40px, -50px) scale(1.15) rotate(180deg);
  }
  100% {
    transform: translate(-30px, 30px) scale(0.9) rotate(360deg);
  }
}

/* Entry Micro-animations (Fade In Up) */
.animate-fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.22s; }
.delay-3 { animation-delay: 0.34s; }
.delay-4 { animation-delay: 0.46s; }
.delay-5 { animation-delay: 0.58s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button & Badge Hover Animations */
.hero-glass-panel .hero-actions .button {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-glass-panel .hero-actions .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.hero-glass-panel .hero-actions .button-primary:hover {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
}

.hero-glass-panel .hero-actions .button-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-iso-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.hero-iso-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-iso-badge:hover {
  transform: translateY(-4px);
}
.hero-iso-badge img {
  max-height: 90px;
  width: auto;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

.hero-iso-badge span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.9);
}

/* Division Menu Card Hover Reveal Effects */
.division-showcase-grid .showcase-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.division-showcase-grid .showcase-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
  .hero-glass-panel {
    padding: 40px 24px;
    border-radius: 24px;
  }
  .hero-glass-panel h1 {
    font-size: 1.85rem;
  }
  .hero-glass-panel p:not(.eyebrow) {
    font-size: 1rem;
    margin-bottom: 24px;
  }
  .hero-glass-panel .hero-actions {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
  }
  .hero-iso-badges {
    gap: 28px;
  }
  .hero-iso-badge img {
    max-height: 75px;
  }
}

/* Offset for Fixed Header on Native Smooth Scroll */
#menu-divisiones,
#organismos,
#contacto {
  scroll-margin-top: 100px;
}

/* Card Interactive Hover Effects */
.feature-card,
.feature-card-premium,
.organism-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s ease;
}

.feature-card:hover,
.feature-card-premium:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-color: rgba(79, 163, 227, 0.35);
}

.organism-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(79, 163, 227, 0.15);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(79, 163, 227, 0.45);
}

/* Division Icon Grid Cards */
.division-showcase-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.division-icon-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: rgba(79, 163, 227, 0.07); /* Fondo azul translúcido de la marca */
  border: 1px solid rgba(79, 163, 227, 0.15);
  border-radius: var(--radius-xl, 20px);
  text-decoration: none;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 170px;
  box-sizing: border-box;
}

.division-icon-card .card-number {
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #2f7fb6;
  opacity: 0.6;
  letter-spacing: 0.5px;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.division-icon-card .icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff; /* Círculo blanco que contrasta con el fondo azul translúcido */
  color: #2f7fb6; /* Icono en color azul principal */
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(79, 163, 227, 0.12);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.division-icon-card .icon-wrapper svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.division-icon-card h3 {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--brand, #08263f);
  margin: 0;
  transition: color 0.3s ease;
  line-height: 1.3;
}

/* Hover effects */
.division-icon-card:hover {
  transform: translateY(-6px);
  background: #2f7fb6; /* Transición a azul marca sólido */
  border-color: #2f7fb6;
  box-shadow: 0 12px 28px rgba(79, 163, 227, 0.25);
}

.division-icon-card:hover .card-number {
  color: #ffffff;
  opacity: 0.85;
}

.division-icon-card:hover .icon-wrapper {
  background: #ffffff;
  color: #2f7fb6;
  transform: scale(1.1);
}

.division-icon-card:hover h3 {
  color: #ffffff;
}

@media (max-width: 1100px) {
  .division-showcase-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .division-showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .division-icon-card {
    padding: 28px 16px;
    min-height: 160px;
  }
}

/* Ocultar enlace "Ver todas" del menú desplegable */
.dropdown-panel a[href$="index.html"] {
  display: none !important;
}

/* Certifications Tab Layout & Norm Cards */
.cert-tabs {
  display: flex;
  gap: 8px;
  margin: 32px 0 24px 0;
  border-bottom: 2px solid rgba(20, 48, 74, 0.08);
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-trigger {
  padding: 12px 24px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted, #718096);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 8px 8px 0 0;
}

.tab-trigger:hover {
  color: var(--brand, #08263f);
  background: rgba(79, 163, 227, 0.04);
}

.tab-trigger.is-active {
  color: #2f7fb6;
  background: transparent;
}

.tab-trigger.is-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: #2f7fb6;
  border-radius: 99px;
}

.tab-content {
  display: none;
}

.tab-content.is-active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.norm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.norm-card {
  background: rgba(79, 163, 227, 0.04);
  border: 1px solid rgba(79, 163, 227, 0.12);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 140px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.norm-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 163, 227, 0.35);
  background: rgba(79, 163, 227, 0.07);
  box-shadow: 0 10px 24px rgba(20, 48, 74, 0.04);
}

.norm-card h4 {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--brand, #08263f);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.norm-card p {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted, #718096);
  margin: 0;
}

.norm-status {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  line-height: 1;
}

.status-certificado {
  background: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-cumple {
  background: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.status-proceso {
  background: rgba(245, 158, 11, 0.1);
  color: rgb(245, 158, 11);
  border: 1px dashed rgba(245, 158, 11, 0.45);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .norm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .norm-grid {
    grid-template-columns: 1fr;
  }
  .cert-tabs {
    margin-top: 24px;
  }
  .tab-trigger {
    padding: 10px 16px;
    font-size: 0.82rem;
  }
}

/* Alinear a 3 columnas los bloques de showcase en páginas de divisiones individuales */
.division-showcase-grid:has(.showcase-card),
body:not(.theme-home) .division-showcase-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 900px) {
  .division-showcase-grid:has(.showcase-card),
  body:not(.theme-home) .division-showcase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  .division-showcase-grid:has(.showcase-card),
  body:not(.theme-home) .division-showcase-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Custom layout and mask effect for all Division page heroes */
body:not(.theme-home) .page-hero-inner:has(.hero-visual-content) {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}

body:not(.theme-home) .hero-visual-content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 5;
}

body:not(.theme-home) .hero-visual-content img {
  width: 100%;
  height: 440px; /* Imagen que abarca casi todo lo alto en Desktop */
  object-fit: cover;
  border-radius: var(--radius-xl, 20px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.18) 12%, rgba(0,0,0,0.95) 70%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.18) 12%, rgba(0,0,0,0.95) 70%, #000 100%);
  transition: transform 0.4s ease;
}

body:not(.theme-home) .hero-visual-content:hover img {
  transform: scale(1.02);
}

@media (max-width: 990px) {
  body:not(.theme-home) .page-hero-inner:has(.hero-visual-content) {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
  }
  body:not(.theme-home) .hero-visual-content img {
    height: 370px; /* Imagen más alta en tablets */
  }
}

@media (max-width: 768px) {
  body:not(.theme-home) .page-hero-inner:has(.hero-visual-content) {
    grid-template-columns: 1fr;
    gap: 16px;
    position: relative;
  }
  body:not(.theme-home) .hero-visual-content {
    position: absolute;
    right: 0;
    bottom: 0;
    top: 0;
    left: 0;
    z-index: 1; /* Detrás del texto */
    pointer-events: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    opacity: 0.18; /* Efecto marca de agua muy difuminado */
  }
  body:not(.theme-home) .hero-visual-content img {
    height: 100%;
    width: auto;
    max-width: 80%;
    object-position: right center;
    border-radius: 0;
    box-shadow: none;
    -webkit-mask-image: radial-gradient(circle at right center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 80%);
    mask-image: radial-gradient(circle at right center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 80%);
  }
}

/* Centered layout for division summary block */
.division-hero-centered {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 52px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.division-hero-centered h3 {
  font-size: clamp(1.35rem, 2.3vw, 2.05rem);
  color: var(--brand, #08263f);
  max-width: 48ch;
  line-height: 1.35;
  margin: 8px 0 0 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.division-hero-centered p:not(.detail-tag) {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted, #718096);
  max-width: 72ch;
  margin: 0;
}

/* Single-page Certifications Section layout */
.cert-group-section {
  margin-bottom: 60px;
}
.cert-group-section h3 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--theme-deep, #002846);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(0, 40, 70, 0.08);
  letter-spacing: -0.02em;
}
