/* ============================================================
   Hanart · ES market theme (Spain / LATAM B2B)
   Loaded AFTER css/styles.css. Overrides variables + typography
   only; no structural rules are removed or replaced.
   ============================================================ */

:root,
html[lang="es"] {
  /* --- structural darks: warm slate instead of cold navy --- */
  --navy: #12263a;
  --navy-deep: #0b1826;
  --navy-mid: #1c3d58;
  --steel: #2b4d66;
  --night: #0b1826;

  /* --- accent: Spanish terracotta --- */
  --accent: #bc5b34;
  --accent-dark: #9a4526;
  --accent-strong: #7a351c;
  --accent-soft: #f2c3aa;
  --accent-on-dark: #f5b695;
  --accent-light: #fdf1ea;
  --tint-warm: #f7e3d6;

  --primary: #12263a;

  /* --- neutrals warmed toward paper + sand --- */
  --ink: #16212b;
  --ink-2: #36434f;
  --slate: #5f6b76;
  --text-light: #e7ddd2;
  --text-on-dark: #efe6dc;
  --line: #e8dccc;
  --border-color: #e8dccc;
  --paper: #fffdf9;
  --mist: #fbf5ec;
  --bg-soft: #f7f0e5;

  --gold: #c08a34;
  --ok: #1d7a5b;
  --whatsapp: #2b4d66;
  --whatsapp-hover: #12263a;
  --divider-on-dark: #4c6274;

  --radius: 3px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(18, 38, 58, .07);
  --shadow-lg: 0 20px 52px rgba(18, 38, 58, .16);
}

/* ---------- Typography: Spanish needs looser tracking ---------- */
html[lang="es"] body { font-size: 16.5px; line-height: 1.72; font-feature-settings: "kern" 1; }
html[lang="es"] h1, html[lang="es"] h2, html[lang="es"] h3, html[lang="es"] h4, html[lang="es"] h5 {
  letter-spacing: -.010em; line-height: 1.16;
}
html[lang="es"] h1 { font-size: clamp(2rem, 3.4vw, 3rem); }
html[lang="es"] h2 { font-size: clamp(1.55rem, 2.4vw, 2.15rem); }
html[lang="es"] h3 { font-size: 1.17rem; }
html[lang="es"] .section-kicker, html[lang="es"] .kicker,
html[lang="es"] .card-eyebrow, html[lang="es"] .inq-card-title {
  letter-spacing: .13em; font-size: .75rem;
}
html[lang="es"] .section-sub { font-size: 1.02rem; line-height: 1.72; }

/* ---------- Header / navigation: Spanish labels are longer ---------- */
html[lang="es"] .topbar-item { font-size: .76rem; letter-spacing: .01em; }
html[lang="es"] .topbar-label { letter-spacing: .10em; }
html[lang="es"] .nav-links--wide > li > a { padding: 29px 13px; font-size: .92rem; letter-spacing: 0; }
@media (min-width: 1201px) {
  html[lang="es"] .header-inner { gap: 22px; }
  html[lang="es"] .header-cta .btn { padding: 11px 15px; font-size: .8rem; letter-spacing: .01em; }
}
@media (max-width: 1280px) {
  html[lang="es"] .nav-links--wide > li > a { padding: 29px 10px; font-size: .86rem; }
}
html[lang="es"] .dropdown__title { letter-spacing: .10em; }
html[lang="es"] .dropdown__col a { line-height: 1.4; }
html[lang="es"] .lang-native { letter-spacing: 0; }

/* ---------- Hero: warm Mediterranean cast over the photo ---------- */
html[lang="es"] .hero-bg::before {
  background: linear-gradient(96deg, rgba(9, 20, 33, .96) 0%, rgba(15, 32, 50, .90) 44%, rgba(15, 32, 50, .58) 72%, rgba(122, 53, 28, .30) 100%);
}
html[lang="es"] .hero-bg::after {
  background: linear-gradient(0deg, rgba(9, 20, 33, .70) 0%, rgba(9, 20, 33, 0) 44%);
}
html[lang="es"] .hero-sub, html[lang="es"] .hero .lead,
html[lang="es"] .page-hero .lead, html[lang="es"] .page-hero .hero-lead {
  color: #f4ebe2;
  text-shadow: 0 1px 2px rgba(4, 12, 20, .55), 0 10px 30px rgba(4, 12, 20, .38);
}
html[lang="es"] .hero .breadcrumb, html[lang="es"] .page-hero .breadcrumb {
  text-shadow: 0 1px 2px rgba(4, 12, 20, .5);
}
html[lang="es"] .hero-title {
  max-width: 22ch; font-size: clamp(2.1rem, 4.1vw, 3.8rem);
  letter-spacing: -.012em; line-height: 1.1; text-wrap: balance;
}
html[lang="es"] .hero-kicker { letter-spacing: .17em; color: #f6dfd2; }
html[lang="es"] .hero-sub { max-width: 60ch; font-size: 1.06rem; color: #e6dcd2; }
html[lang="es"] .hero-facts div { letter-spacing: .03em; color: #c6b5a8; }
html[lang="es"] .hero-facts b { font-size: 1.42rem; letter-spacing: -.01em; }
html[lang="es"] .hero-facts b .stat-ico { color: var(--accent-on-dark); }

/* ---------- Buttons: one terracotta primary, safer wrapping ---------- */
html[lang="es"] .btn {
  white-space: normal; line-height: 1.3; letter-spacing: .015em;
  padding: 13px 24px; min-height: 44px; max-width: 100%;
}
.btn-primary, .btn-secondary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, .btn-secondary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.inq-form .btn.inq-submit { background: var(--accent); border-color: var(--accent); }
.inq-form .btn.inq-submit:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
html[lang="es"] .card .btn, html[lang="es"] .card .btn-primary,
html[lang="es"] .card .btn-dark, html[lang="es"] .card .btn-outline,
html[lang="es"] .prod-card-body span {
  letter-spacing: .06em; font-size: .68rem; line-height: 1.25; min-height: 38px;
}

/* ---------- Cards, lists, tables: keep long Spanish strings inside ---------- */
html[lang="es"] .card-title, html[lang="es"] .prod-card-body h3 { letter-spacing: -.005em; line-height: 1.28; }
html[lang="es"] .prod-card-body p, html[lang="es"] .card-text { font-size: .92rem; line-height: 1.62; }
html[lang="es"] .record-name { font-size: .9rem; line-height: 1.42; }
html[lang="es"] .record-place { letter-spacing: .04em; }
html[lang="es"] .badge { letter-spacing: .07em; font-size: .71rem; line-height: 1.3; }
html[lang="es"] .data-table th, html[lang="es"] .data-table td { hyphens: auto; overflow-wrap: break-word; }
html[lang="es"] .inq-terms span { letter-spacing: .07em; }
html[lang="es"] .footer-title { letter-spacing: .10em; }

/* ---------- Trust + conversion accents ---------- */
html[lang="es"] a[href^="tel:"] { font-weight: 600; }
html[lang="es"] .topbar a, html[lang="es"] .topbar .topbar-item { color: #e9ddd1; }
html[lang="es"] .topbar a:hover { color: var(--accent-on-dark); }
/* The dropdown lives inside .topbar, so it must not inherit the light topbar text. */
html[lang="es"] .lang-dropdown {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 36px -16px rgba(18, 38, 58, .34);
}
html[lang="es"] .lang-dropdown li a {
  color: var(--ink); font-size: .88rem; padding: 9px 16px;
}
html[lang="es"] .lang-dropdown li a:hover { background: var(--mist); color: var(--navy-deep); }
html[lang="es"] .lang-dropdown li a[aria-current="page"] { color: var(--accent-dark); font-weight: 700; }
html[lang="es"] .lang-code { color: #4f5c68; font-size: .7rem; }
html[lang="es"] .lang-dropdown li a[aria-current="page"] .lang-code { color: var(--accent-dark); }
/* Spanish is the current locale on this site: show it first and mark it clearly. */
html[lang="es"] .lang-dropdown { display: flex; flex-direction: column; }
html[lang="es"] .lang-dropdown > li { order: 0; }
html[lang="es"] .lang-dropdown > li:has(> a[href*="/es/"]) { order: -1; }
html[lang="es"] .lang-dropdown li a[aria-current="page"] {
  background: var(--accent-light);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
html[lang="es"] .lang-dropdown > li:has(> a[href*="/es/"]) { border-bottom: 1px solid var(--line); }
html[lang="es"] .stat-num { color: var(--accent); }
html[lang="es"] .cta-band::after {
  background: linear-gradient(96deg, rgba(11, 24, 38, .96) 0%, rgba(18, 38, 58, .88) 42%, rgba(122, 53, 28, .38) 100%);
}
html[lang="es"] .cta-band .cta-actions .btn:first-child:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #4a2113; }
html[lang="es"] .inq { background: var(--navy-deep); }
html[lang="es"] .inq-meta h4 { letter-spacing: .12em; color: #e0bcae; }
html[lang="es"] .inq-meta a:hover { color: var(--accent-on-dark); border-bottom-color: var(--accent-on-dark); }
html[lang="es"] .section-alt { border-color: var(--line); }

/* ---------- Readability guards: never let text sit on a low-contrast field ---------- */
html[lang="es"] .hero--home .btn-primary { background: #fff; color: #4a2113; border-color: #fff; }
html[lang="es"] .hero--home .btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #2f1509; }
html[lang="es"] .page-hero .btn-primary { background: #fff; color: #4a2113; border-color: #fff; }
html[lang="es"] .page-hero .btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #2f1509; }
html[lang="es"] input::placeholder, html[lang="es"] textarea::placeholder { color: #77828d; }
html[lang="es"] .inq-card .input, html[lang="es"] .inq-card .select,
html[lang="es"] .inq-card .textarea { border-color: #d9cbba; color: var(--ink); }
html[lang="es"] .inq-card .input:focus, html[lang="es"] .inq-card .select:focus,
html[lang="es"] .inq-card .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(188, 91, 52, .16);
}
html[lang="es"] :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Mobile: Spanish labels wrap instead of overflowing ---------- */
@media (max-width: 900px) {
  html[lang="es"] .hero-title { max-width: 100%; font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  html[lang="es"] .nav-links > li > a { font-size: .98rem; line-height: 1.35; }
  html[lang="es"] .btn { min-height: 46px; }
}
@media (max-width: 560px) {
  html[lang="es"] .hero-facts b { font-size: 1.24rem; }
  html[lang="es"] .topbar-item { font-size: .72rem; }
  html[lang="es"] .section-kicker, html[lang="es"] .kicker { letter-spacing: .10em; }
  /* narrow screens: anchor the language panel to the viewport, not to the trigger */
  html[lang="es"] .lang-dropdown {
    position: fixed; top: 44px; right: 10px; left: auto;
    min-width: 0; width: min(232px, calc(100vw - 20px)); max-height: 60vh;
  }
}

/* ---------- Topbar fit on narrow screens (Spanish labels are longer) ---------- */
@media (max-width: 900px) {
  html[lang="es"] .topbar-item.topbar-hours { display: none; }
  html[lang="es"] .topbar-inner { gap: .5rem; }
}
@media (max-width: 700px) {
  html[lang="es"] .topbar-item.topbar-mail { display: none; }
  html[lang="es"] .nav-secondary { gap: .75rem; }
  html[lang="es"] .nav-secondary a { font-size: .72rem; letter-spacing: .02em; }
}
@media (max-width: 480px) {
  html[lang="es"] .nav-secondary { display: none; }
  html[lang="es"] .topbar-inner { justify-content: space-between; padding-inline: 12px; gap: .6rem; }
  html[lang="es"] .topbar-right { gap: .7rem; }
  html[lang="es"] .topbar-item { font-size: .68rem; }
  html[lang="es"] .topbar-label { font-size: .6rem; letter-spacing: .05em; }
}
