/* NS Quell visual refresh - complete light-first override */

:root,
[data-theme="light"] {
  --brand-blue: #003A70;
  --brand-blue-2: #00539b;
  --brand-red: #DA291C;
  --brand-orange: #FF8200;
  --ink: #0b1b2e;
  --muted-ink: #29435f;
  --glass: rgba(255,255,255,.84);
  --glass-border: rgba(255,255,255,.72);
  --soft-shadow: 0 18px 48px rgba(0,58,112,.12);
}

[data-theme="dark"] {
  --brand-blue: #69b7ff;
  --brand-blue-2: #a6d6ff;
  --ink: #ffffff;
  --muted-ink: #dcecff;
  --glass: rgba(7,21,36,.72);
  --glass-border: rgba(255,255,255,.16);
  --soft-shadow: 0 18px 48px rgba(0,0,0,.35);
}

body {
  font-weight: 500;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

p,
.section-desc,
.servicio-desc,
.contacto-info p,
.mvv-card p,
.tl-content p,
.cert-card-body,
.cliente-sub,
.stat-label {
  font-weight: 500 !important;
}

/* NAVBAR */
nav#navbar {
  height: 76px;
  background: rgba(255,255,255,.84) !important;
  border-bottom: 1px solid rgba(255,255,255,.72) !important;
  box-shadow: 0 8px 28px rgba(0,58,112,.08) !important;
  backdrop-filter: blur(16px) saturate(145%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(145%) !important;
}

[data-theme="dark"] nav#navbar {
  background: rgba(5,14,26,.70) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 10px 32px rgba(0,0,0,.38) !important;
}

.nav-links a,
.nav-btn {
  font-weight: 800 !important;
}

/* HERO */
#hero {
  align-items: center !important;
  justify-content: center !important;
}

.hero-accent-line,
.hero-sub {
  display: none !important;
}

.hero-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1180px !important;
  padding-top: 115px !important;
  padding-bottom: 80px !important;
}

.hero-content {
  max-width: 980px !important;
  width: 100%;
  text-align: center;
  align-items: center;
  padding: 0 !important;
}

.hero-tag {
  justify-content: center;
}

.hero-tag::before {
  display: none !important;
}

.hero-title,
.hero-title span {
  text-transform: none !important;
}

.hero-title {
  font-size: clamp(3rem,6.4vw,5.8rem) !important;
  line-height: .96 !important;
  letter-spacing: .005em;
  text-shadow: 0 16px 42px rgba(0,0,0,.38);
  margin-bottom: 1rem !important;
}

.hero-title .line-accent {
  color: #FFB04A !important;
}

.hero-title .line-orange {
  color: #ffffff !important;
}

.hero-buttons {
  justify-content: center;
  margin-bottom: 1.5rem !important;
}

.carousel-indicators {
  bottom: 18px !important;
}

.hero-stats {
  width: min(100%,920px);
  justify-content: center;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,.22) !important;
  border-bottom: 1px solid rgba(255,255,255,.12);
  padding: 1rem 0 !important;
  margin-top: .1rem;
}

.stat-item {
  flex: 1 1 160px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: .35rem 1rem;
}

.stat-number {
  font-size: clamp(2.2rem,4vw,3.35rem) !important;
  color: #FFB04A !important;
}

.stat-label {
  max-width: 140px;
  color: rgba(255,255,255,.86) !important;
  line-height: 1.25 !important;
  text-align: center;
}

/* GLOBAL TITLES + CONTRAST */
.section-title,
.contacto-info h3,
.cert-card-title,
.maq-section-title,
.servicio-title,
.tl-content h4 {
  color: var(--brand-blue) !important;
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .contacto-info h3,
[data-theme="dark"] .cert-card-title,
[data-theme="dark"] .maq-section-title,
[data-theme="dark"] .servicio-title,
[data-theme="dark"] .tl-content h4 {
  color: #ffffff !important;
}

.section-title .accent {
  color: var(--brand-orange) !important;
}

.section-desc,
.servicio-desc,
.tl-content p,
.contacto-info p,
.mvv-card p {
  color: var(--muted-ink) !important;
}

[data-theme="dark"] .section-desc,
[data-theme="dark"] .servicio-desc,
[data-theme="dark"] .tl-content p,
[data-theme="dark"] .contacto-info p,
[data-theme="dark"] .mvv-card p {
  color: rgba(255,255,255,.82) !important;
}

/* SERVICIOS */
#servicios .section-header {
  display: block !important;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

#servicios .section-header .section-tag {
  justify-content: center;
}

#servicios .section-header .section-tag::before {
  display: none;
}

#servicios .section-header .section-desc {
  max-width: 680px;
  margin: .85rem auto 0 !important;
  text-align: center;
}

.servicios-grid {
  box-shadow: var(--soft-shadow);
}

.servicio-card {
  border-radius: 16px !important;
  overflow: hidden;
}

.servicio-img-wrap {
  height: 174px !important;
  background: #eef4fa !important;
}

.servicio-img {
  filter: none !important;
  object-fit: cover !important;
}

.servicio-card:hover .servicio-img {
  filter: none !important;
}

.servicio-num {
  color: rgba(255,130,0,.28) !important;
  text-shadow: 0 0 18px rgba(255,130,0,.3);
}

[data-theme="light"] .servicio-num {
  color: rgba(0,58,112,.18) !important;
  text-shadow: 0 0 18px rgba(0,58,112,.18);
}

/* CERTIFICACIONES */
.cert-logo,
.cert-card-header img {
  filter: brightness(0) saturate(100%) invert(18%) sepia(69%) saturate(1559%) hue-rotate(184deg) brightness(88%) contrast(102%) !important;
}

[data-theme="dark"] .cert-logo,
[data-theme="dark"] .cert-card-header img {
  filter: brightness(0) invert(1) !important;
}

.cert-card,
.cliente-card,
.mvv-card,
.maq-table-wrap,
.maq-tool-card {
  border-radius: 16px !important;
}

/* CLIENTES + GRAFICA */
#clientes .section-title {
  color: var(--brand-blue) !important;
}

.sector-chart-card {
  margin: 2rem auto 2.5rem;
  max-width: 920px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg,rgba(255,255,255,.96),rgba(239,247,255,.98));
  border: 1px solid rgba(0,58,112,.12);
  border-radius: 22px;
  padding: 1.8rem;
  box-shadow: var(--soft-shadow);
  text-align: center;
}

[data-theme="dark"] .sector-chart-card {
  background: linear-gradient(135deg,rgba(9,24,42,.96),rgba(5,14,28,.98));
  border-color: rgba(255,255,255,.12);
}

.sector-donut {
  --auto: 95%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(#003A70 0 var(--auto), #FF8200 var(--auto) 100%);
  position: relative;
  margin: 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 18px 36px rgba(0,58,112,.18);
}

.sector-donut::after {
  content: "95%";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #003A70;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 3rem;
  font-weight: 900;
}

[data-theme="dark"] .sector-donut::after {
  color: #ffffff;
  background: #081728;
}

.sector-chart-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sector-chart-copy h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.55rem,3vw,2.3rem);
  text-transform: none;
  color: var(--brand-blue);
  margin-bottom: .75rem;
}

[data-theme="dark"] .sector-chart-copy h3 {
  color: #ffffff;
}

.sector-chart-copy p {
  color: var(--muted-ink);
  line-height: 1.75;
  font-weight: 500;
  max-width: 560px;
}

.sector-legend {
  margin-top: 1rem;
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.sector-legend span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .8rem;
  border-radius: 999px;
  background: rgba(0,58,112,.06);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.sector-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
}

.sector-legend .auto i { background: #003A70; }
.sector-legend .med i { background: #FF8200; }

/* MAQUINARIA */
.maquinaria-hero-card {
  max-width: 1120px;
  margin: -1rem auto 2rem;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(320px,.75fr);
  gap: 1.4rem;
  align-items: stretch;
}

.maq-ai-visual {
  min-height: 300px;
  max-height: 360px;
  border-radius: 24px;
  overflow: hidden;
  background: #eef4fa;
  border: 1px solid rgba(0,58,112,.14);
  box-shadow: var(--soft-shadow);
}

.maq-ai-visual img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
}

.maq-capacity-panel {
  border-radius: 24px;
  padding: 2rem;
  background: linear-gradient(135deg,#003A70,#071b33);
  color: #fff;
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.maq-capacity-panel .eyebrow {
  color: #FFB04A;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: .7rem;
}

.maq-capacity-panel h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.9rem,3vw,3rem);
  line-height: 1;
  margin-bottom: 1rem;
  color: #fff !important;
}

.maq-capacity-panel p {
  color: rgba(255,255,255,.86);
  line-height: 1.7;
}

.maquinaria-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: block !important;
  background: transparent !important;
  box-shadow: none !important;
}

.maq-pieza-col {
  display: none !important;
}

.maq-center {
  display: grid !important;
  grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr);
  gap: 1.4rem;
}

.maq-table-wrap,
.maq-tooling-cards {
  height: 100%;
}

.maq-table-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.maq-table {
  margin-bottom: 0 !important;
}

.maq-table td,
.maq-table th {
  text-align: center !important;
  vertical-align: middle !important;
}

.maq-table th:nth-child(2)::after {
  content: " / Proceso";
}

.maq-tooling-cards {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 1rem !important;
  align-content: center;
}

.maq-tool-card {
  min-height: 96px;
  justify-content: flex-start !important;
  gap: 1rem;
}

.maq-tool-card svg {
  width: 46px !important;
  height: 46px !important;
  padding: 9px;
  border-radius: 14px;
  background: rgba(0,58,112,.09);
  color: var(--brand-blue);
}

[data-theme="dark"] .maq-tool-card svg {
  background: rgba(255,255,255,.08);
  color: #FFB04A;
}

.maq-tool-card span {
  font-weight: 800;
}

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--brand-blue);
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(0,58,112,.28);
  z-index: 80;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .25s, transform .25s, background .25s;
}

[data-theme="dark"] .back-to-top {
  background: var(--brand-orange) !important;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--brand-orange);
}

/* FOOTER */
.site-footer-refresh,
footer {
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin: .5rem 0 1.8rem;
  order: 1;
}

.footer-social a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  transition: transform .2s, background .2s, border-color .2s;
}

.footer-social a:hover {
  transform: translateY(-3px);
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}

.footer-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin: 0 auto 1rem;
}

.footer-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.footer-logo {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.22));
}

.footer-logo-quell {
  width: 178px;
}

.footer-logo-group {
  width: 178px;
  background: #ffffff;
  border-radius: 12px;
  padding: .35rem .6rem;
}

.footer-logo-separator {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom,transparent,rgba(255,255,255,.42),transparent);
}

.footer-alliance {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 1.35rem;
  color: rgba(255,255,255,.76);
  font-size: .92rem;
  line-height: 1.6;
}

.footer-links {
  justify-content: center !important;
  margin-bottom: 0 !important;
}

.footer-copy-bottom {
  margin: 2rem auto 0 !important;
  text-align: center !important;
  opacity: .72;
  width: 100%;
}

.footer-brand,
.footer-nsgroup {
  display: none !important;
}

/* RESPONSIVE */
@media (max-width: 920px) {
  [data-theme="light"] .nav-links.open,
  [data-theme="light"] .nav-links.open a {
    color: #ffffff !important;
  }

  [data-theme="light"] .nav-links.open {
    background: rgba(0,58,112,.96) !important;
    border-color: rgba(255,255,255,.18) !important;
  }

  .sector-chart-card,
  .maquinaria-hero-card,
  .maq-center {
    grid-template-columns: 1fr !important;
  }

  .hero-title {
    font-size: clamp(2.35rem,12vw,4.2rem) !important;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 560px) {
  nav#navbar {
    height: 68px;
  }

  .hero-inner {
    padding-top: 96px !important;
    padding-bottom: 64px !important;
  }

  .hero-buttons {
    margin-bottom: 1rem !important;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
  }

  .stat-item {
    min-width: 0;
    padding: .3rem;
  }

  .sector-chart-card,
  .maq-capacity-panel {
    padding: 1.25rem;
  }

  .sector-donut {
    width: 158px;
    height: 158px;
  }

  .sector-donut::after {
    inset: 23px;
    font-size: 2.4rem;
  }

  .footer-logo-row {
    gap: .9rem;
  }

  .footer-logo-quell {
    width: 138px;
  }

  .footer-logo-group {
    width: 138px;
  }

  .footer-logo-separator {
    height: 32px;
  }
}
