/* =====================================================================
   Universidad Lat — En Línea | Hoja de estilos
   Paleta basada en el logo: azul marino degradado a azul claro.
   ===================================================================== */
:root {
  --navy: #0f2a63;
  --navy-dark: #0a1f4d;
  --blue: #1e4ea8;
  --blue-mid: #2f6fc4;
  --sky: #3d9be9;
  --sky-light: #69b9f2;
  --ink: #0d1b3e;
  --slate: #5b6b8c;
  --muted: #7c89a6;
  --cloud: #f4f7fc;
  --line: #e2e8f4;
  --white: #ffffff;
  --amber: #f5a623;
  --green: #1faa6b;
  --grad: linear-gradient(135deg, var(--navy-dark) 0%, var(--blue) 55%, var(--sky) 120%);
  --grad-soft: linear-gradient(135deg, #0f2a63 0%, #2f6fc4 100%);
  --shadow-sm: 0 1px 3px rgba(15, 42, 99, 0.08), 0 1px 2px rgba(15, 42, 99, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 42, 99, 0.1);
  --shadow-lg: 0 18px 48px rgba(15, 42, 99, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --container: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--sky); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; color: #2d3a5c; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 700; font-size: 1rem; padding: .85rem 1.6rem; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  text-align: center; line-height: 1;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(30, 78, 168, .35); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 30px rgba(30, 78, 168, .45); }
.btn-cta { background: var(--amber); color: #3a2600; box-shadow: 0 8px 22px rgba(245, 166, 35, .4); font-size: 1.1rem; padding: 1rem 2rem; }
.btn-cta:hover { color: #3a2600; transform: translateY(-2px); filter: brightness(1.04); }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--line); }
.btn-outline:hover { border-color: var(--sky); color: var(--blue); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.24); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.2rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand img { height: 46px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-size: 1.15rem; color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
.brand-text span { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; color: var(--sky); font-weight: 700; }
.main-nav { display: flex; gap: .3rem; margin-left: auto; align-items: center; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: .98rem; padding: .5rem .8rem; border-radius: 8px; }
.main-nav a:hover { background: var(--cloud); color: var(--blue); }
.header-search { position: relative; flex: 1; max-width: 360px; }
.header-search input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 999px; padding: .6rem 1rem .6rem 2.6rem;
  font-size: .95rem; font-family: inherit; background: var(--cloud); transition: border .15s, background .15s;
}
.header-search input:focus { outline: none; border-color: var(--sky); background: #fff; }
.header-search svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--navy); padding: .4rem; margin-left: auto; }

/* Live search dropdown */
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; display: none; z-index: 60;
}
.search-results.open { display: block; }
.search-results a { display: flex; gap: .8rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--cloud); }
.search-results .sr-thumb { width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0; }
.search-results .sr-meta { font-size: .78rem; color: var(--muted); }
.search-results .sr-title { font-weight: 600; font-size: .92rem; }
.search-results .sr-empty { padding: 1rem; color: var(--muted); text-align: center; }

/* ---------- Hero ---------- */
.hero { background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background: radial-gradient(circle at 80% 20%, rgba(105,185,242,.5), transparent 45%),
              radial-gradient(circle at 10% 90%, rgba(61,155,233,.4), transparent 40%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding: 4.5rem 0; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.2rem; color: rgba(255,255,255,.92); max-width: 30em; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: .4rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 1.2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-stats div strong { display: block; font-size: 1.9rem; font-weight: 800; color: #fff; }
.hero-stats div span { font-size: .9rem; color: rgba(255,255,255,.8); }
.hero-search { background: #fff; border-radius: var(--radius); padding: .5rem; display: flex; box-shadow: var(--shadow-lg); margin-top: 1.6rem; max-width: 480px; }
.hero-search input { flex: 1; border: 0; padding: .8rem 1rem; font-size: 1rem; font-family: inherit; border-radius: var(--radius-sm); }
.hero-search input:focus { outline: none; }
.hero-visual { position: relative; }
.hero-card {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 20px; padding: 1.5rem;
  backdrop-filter: blur(8px); box-shadow: var(--shadow-lg);
}
.hero-card .mini { display: flex; gap: .8rem; align-items: center; padding: .7rem; background: rgba(255,255,255,.95); border-radius: 12px; margin-bottom: .8rem; color: var(--ink); }
.hero-card .mini:last-child { margin-bottom: 0; }
.hero-card .mini .ic { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.hero-card .mini strong { font-size: .95rem; display: block; }
.hero-card .mini span { font-size: .8rem; color: var(--muted); }

/* ---------- Secciones ---------- */
section { padding: 4rem 0; }
.section-head { text-align: center; max-width: 40em; margin: 0 auto 2.6rem; }
.section-head .kicker { color: var(--sky); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; }
.section-head p { color: var(--slate); font-size: 1.08rem; }
.bg-cloud { background: var(--cloud); }

/* ---------- Grid de cursos ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.6rem; }
.course-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.course-cover { position: relative; aspect-ratio: 1 / 1; }
.course-cover img, .course-cover svg { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.course-badge { position: absolute; top: .7rem; left: .7rem; background: var(--amber); color: #3a2600; font-size: .72rem; font-weight: 800; padding: .3rem .7rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.course-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.course-cat { font-size: .76rem; font-weight: 700; color: var(--sky); text-transform: uppercase; letter-spacing: .05em; }
.course-card h3 { font-size: 1.08rem; margin: .35rem 0 .5rem; line-height: 1.3; }
.course-card h3 a { color: var(--ink); }
.course-card h3 a:hover { color: var(--blue); }
.course-instr { font-size: .85rem; color: var(--muted); margin-bottom: .7rem; }
.course-meta { display: flex; align-items: center; gap: .8rem; font-size: .82rem; color: var(--slate); margin-bottom: .9rem; flex-wrap: wrap; }
.rating { display: inline-flex; align-items: center; gap: .25rem; color: #b8770a; font-weight: 700; }
.rating .stars { color: var(--amber); letter-spacing: -1px; }
.course-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.course-tag-mini { font-size: .78rem; font-weight: 700; color: var(--slate); background: var(--cloud); border: 1px solid var(--line); padding: .3rem .6rem; border-radius: 999px; }
.price { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.price small { font-size: .85rem; color: var(--muted); text-decoration: line-through; font-weight: 600; margin-left: .35rem; }

/* ---------- Categorías ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.cat-card { display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); transition: transform .15s, box-shadow .2s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-ic { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.cat-card h3 { font-size: 1.1rem; margin: 0; color: var(--ink); }
.cat-card p { font-size: .9rem; color: var(--slate); margin: 0; }
.cat-card .cat-count { font-size: .8rem; color: var(--sky); font-weight: 700; margin-top: auto; }

/* ---------- Page header (interior) ---------- */
.page-hero { background: var(--grad); color: #fff; padding: 3rem 0; }
.page-hero h1 { color: #fff; margin-bottom: .4rem; }
.page-hero p { color: rgba(255,255,255,.9); max-width: 46em; }
.breadcrumb { font-size: .85rem; margin-bottom: 1rem; color: rgba(255,255,255,.8); }
.breadcrumb a { color: #fff; opacity: .85; }
.breadcrumb a:hover { opacity: 1; color: #fff; }

/* ---------- Course detail ---------- */
.course-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2.5rem; align-items: start; padding-top: 2.5rem; }
.course-main h2 { margin-top: 2rem; }
.detail-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 1.8rem; }
.detail-cover svg, .detail-cover img { width: 100%; display: block; }
/* La foto real conserva su proporción natural (no se deforma a 16:9). */
.detail-cover img { height: auto; aspect-ratio: auto; object-fit: contain; }
.tag-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.tag { background: var(--cloud); border: 1px solid var(--line); color: var(--slate); font-size: .82rem; font-weight: 600; padding: .35rem .8rem; border-radius: 999px; }
.learn-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1.6rem; }
.learn-list li { position: relative; padding-left: 1.8rem; color: #2d3a5c; }
.learn-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 800; }
.syllabus { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.syllabus details { border-bottom: 1px solid var(--line); }
.syllabus details:last-child { border-bottom: 0; }
.syllabus summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; list-style: none; background: #fff; }
.syllabus summary::-webkit-details-marker { display: none; }
.syllabus summary:hover { background: var(--cloud); }
.syllabus .module-body { padding: 0 1.2rem 1rem; }
.syllabus .module-body ul { margin: 0; }
.syllabus .module-body li { color: var(--slate); padding: .2rem 0; }

/* Sticky buy card */
.buy-card { position: sticky; top: 92px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden; }
.buy-card .bc-cover svg, .buy-card .bc-cover img { width: 100%; display: block; }
.buy-card .bc-body { padding: 1.4rem; }
.buy-card .bc-price { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .3rem; }
.buy-card .bc-price .now { font-size: 2rem; font-weight: 800; color: var(--navy); }
.buy-card .bc-price .was { font-size: 1.05rem; color: var(--muted); text-decoration: line-through; }
.buy-card .bc-off { color: var(--green); font-weight: 700; font-size: .9rem; margin-bottom: 1rem; }
.buy-card ul.bc-feats { list-style: none; padding: 0; margin: 1.2rem 0; font-size: .92rem; }
.buy-card ul.bc-feats li { padding: .4rem 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.buy-card ul.bc-feats li:last-child { border-bottom: 0; }
.buy-card ul.bc-feats li span:first-child { color: var(--slate); }
.buy-card ul.bc-feats li span:last-child { font-weight: 700; }
.guarantee { display: flex; gap: .6rem; align-items: center; font-size: .85rem; color: var(--slate); margin-top: 1rem; justify-content: center; }

/* Instructor box */
.instructor-box { display: flex; gap: 1.2rem; align-items: center; background: var(--cloud); border-radius: var(--radius); padding: 1.4rem; margin: 1.6rem 0; }
.instructor-box .avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; flex-shrink: 0; }

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .8rem; padding: 0 1.2rem; }
.faq summary { cursor: pointer; padding: 1rem 0; font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] { background: var(--cloud); }
.faq .faq-a { padding-bottom: 1rem; color: var(--slate); }

/* ---------- Filtros / toolbar ---------- */
.toolbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 2rem; }
.toolbar .chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: .9rem; font-weight: 600; color: var(--slate); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--sky); color: var(--blue); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.result-count { color: var(--muted); font-size: .92rem; margin-left: auto; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--grad); color: #fff; border-radius: 22px; padding: 3rem; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 36em; margin: 0 auto 1.6rem; }

/* ---------- Features / valor ---------- */
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.6rem; }
.value-card { text-align: center; padding: 1.4rem; }
.value-card .vic { width: 60px; height: 60px; border-radius: 16px; background: var(--cloud); color: var(--blue); display: grid; place-items: center; margin: 0 auto 1rem; }
.value-card h3 { font-size: 1.1rem; }
.value-card p { font-size: .94rem; color: var(--slate); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.75); padding: 3.5rem 0 1.5rem; font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.75); display: block; padding: .25rem 0; }
.site-footer a:hover { color: var(--sky-light); }
.footer-brand img { height: 52px; background: #fff; border-radius: 10px; padding: 6px; }
.footer-brand p { color: rgba(255,255,255,.7); font-size: .92rem; margin-top: 1rem; max-width: 28em; }
.footer-social { display: flex; gap: .7rem; margin-top: 1rem; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.1); display: grid; place-items: center; padding: 0; }
.footer-social a:hover { background: var(--sky); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.5rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .85rem; }
.footer-bottom a { display: inline; }

/* ---------- Disclaimer afiliado ---------- */
.affiliate-note { background: #fff7e8; border: 1px solid #f3d9a0; border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-size: .85rem; color: #7a5a12; margin: 1.6rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 0; }
  .hero-visual { display: none; }
  .course-layout { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .learn-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .header-search { display: none; }
  .main-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 1rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .8rem; border-radius: 8px; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 2rem 1.2rem; }
}
