:root {
  --blue: #0b4fd8;
  --red: #ef233c;
  --dark: #111827;
  --text: #374151;
  --light: #f7f9fc;
  --white: #ffffff;
  --border: #e5e7eb;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #f3f5f9;
  line-height: 1.6;
}

header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(17, 24, 39, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: block;
  width: auto;
  height: 52px;
}

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-bottom: 12px; }
.footer-links a { color: inherit; text-underline-offset: 4px; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 200; padding: 12px; background: white; color: var(--blue); }
.skip-link:focus { top: 12px; }
.support-hero { margin-top: 32px; padding: clamp(28px, 5vw, 60px); border-radius: 24px; color: white; background: linear-gradient(125deg, #031f3d, var(--blue)); }
.support-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; margin: 14px 0 20px; }
.support-hero p { max-width: 680px; }
.support-eyebrow { font-size: .8rem; letter-spacing: .1em; font-weight: 700; }
.support-button { display: inline-block; margin-top: 24px; padding: 12px 22px; border-radius: 10px; background: white; color: #0845bd; font-weight: 700; text-decoration: none; }
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.support-contact { scroll-margin-top: 160px; margin-bottom: 48px; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--border); border-radius: 22px; background: white; }
.support-contact p { margin: 12px 0; }
.support-contact h3 { margin-top: 24px; }
.support-contact ul { padding-left: 24px; }
.support-email { display: inline-block; margin: 12px 0; font-size: clamp(1rem, 3vw, 1.4rem); font-weight: 700; color: #0845bd; overflow-wrap: anywhere; }
.support-note { padding: 14px 18px; background: #eef4ff; border-radius: 10px; }
.support-page a:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.logo-link {
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--dark);
  text-decoration: none;
  margin-left: 24px;
  font-weight: 600;
  padding: 8px 4px;
}

nav a:hover {
  color: var(--red);
}

#language-toggle {
  margin-left: 20px;
  padding: 9px 14px;
  color: var(--white);
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#language-toggle:hover,
#language-toggle:focus-visible {
  background: var(--red);
}

.language-selector {
  position: relative;
  display: inline-block;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.14);
}

.language-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  color: var(--dark);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.language-menu button:hover,
.language-menu button:focus-visible,
.language-menu button[aria-current="true"] {
  color: var(--blue);
  background: #eef4ff;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

#inicio {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 32px;
  padding: 64px;
  color: var(--white);
  background: linear-gradient(125deg, var(--blue) 0%, var(--blue) 52%, var(--red) 100%);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(11, 79, 216, 0.18);
}

#inicio h1 {
  max-width: 750px;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 24px;
}

#inicio h1::after {
  content: ".";
  color: var(--white);
}

#inicio p {
  max-width: 680px;
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.92);
}

h2 {
  font-size: 2rem;
  color: var(--dark);
  margin-bottom: 24px;
}

#nosotros {
  margin-top: 32px;
  padding: 52px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.05);
}

#servicios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 0;
}

#servicios > h2 {
  grid-column: 1 / -1;
}

article {
  background: var(--white);
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.07);
  border-top: 4px solid var(--blue);
}

article h3 {
  color: var(--blue);
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.catalog-card {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
}

.catalog-card article {
  height: 100%;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.catalog-card:hover article,
.catalog-card:focus-visible article {
  transform: translateY(-3px);
  box-shadow: 0 12px 34px rgba(11, 79, 216, 0.14);
}

.catalog-card:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

.catalog-card-action {
  display: inline-block;
  margin-top: 20px;
  padding: 9px 14px;
  color: var(--white);
  background: var(--blue);
  border-radius: 10px;
  font-weight: 700;
}

.catalog-card:hover .catalog-card-action,
.catalog-card:focus-visible .catalog-card-action {
  background: var(--red);
}

#contacto {
  margin-bottom: 72px;
  padding: 44px 52px;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 5px solid var(--red);
  border-radius: 18px;
}

#contacto a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

footer {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  padding: 28px 20px;
  margin-top: 40px;
}

.catalog-page main { min-height: calc(100vh - 190px); }
.catalog-heading { padding-bottom: 30px; }
.catalog-heading p { max-width: 720px; font-size: 1.08rem; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--blue); font-weight: 700; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: var(--red); }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 0 72px; list-style: none; }
.category-grid li { min-height: 92px; display: flex; align-items: center; padding: 22px; color: var(--dark); background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: 16px; box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06); font-weight: 700; }
.external-notice { margin-bottom: 24px; padding: 14px 18px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; }
.opportunity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-bottom: 72px; }
.opportunity-grid article { display: flex; flex-direction: column; }
.opportunity-grid p { flex: 1; }
.opportunity-grid h2 { color: var(--blue); font-size: 1.25rem; margin-bottom: 10px; }
.official-link { display: inline-block; align-self: flex-start; margin-top: 22px; color: var(--blue); font-weight: 700; text-decoration: none; }
.official-link:hover, .official-link:focus-visible { color: var(--red); text-decoration: underline; }

.download-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  width: min(520px, calc(100% - 32px));
  padding: 34px;
  color: var(--text);
  background: var(--white);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.28);
  text-align: center;
}

.download-dialog::backdrop {
  background: rgba(17, 24, 39, 0.62);
}

.download-dialog img {
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  border-radius: 10px;
}

.download-dialog h2 { margin-bottom: 10px; }
.download-dialog p { margin-bottom: 24px; }

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 4px 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 1.8rem;
  cursor: pointer;
}

.download-actions {
  display: grid;
  gap: 10px;
}

.download-actions button {
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
}

.continue-web {
  color: var(--white);
  background: var(--blue);
  cursor: pointer;
}

.continue-web:hover,
.continue-web:focus-visible { background: var(--red); }
.download-actions button:disabled { color: #6b7280; background: #e5e7eb; cursor: not-allowed; }

@media (max-width: 760px) {
  nav {
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
  }

  nav > div:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    column-gap: 8px;
    row-gap: 8px;
  }

  nav a {
    margin: 0;
    padding: 8px 4px;
    font-size: 0.9rem;
  }

  #language-toggle {
    margin: 0;
    padding: 8px 11px;
  }

  main {
    width: 100%;
    padding: 0 18px;
  }

  #servicios {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .opportunity-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .category-grid li,
  .opportunity-grid article,
  .catalog-heading {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .download-dialog { padding: 30px 20px 22px; }

  #inicio {
    min-height: 430px;
    padding: 44px 24px;
    border-radius: 20px;
  }

  #nosotros,
  #contacto {
    padding: 36px 24px;
  }

  section {
    padding: 52px 0;
  }
}
