/* =========================================================
   OJITOCORP · Base: fuentes, paletas por ambiente, header,
   botones, contacto, footer y diálogos comunes.
   ========================================================= */

@font-face { font-family: Manrope; src: url('../assets/fonts/manrope-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url('../assets/fonts/manrope-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url('../assets/fonts/manrope-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Sora; src: url('../assets/fonts/sora-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: Sora; src: url('../assets/fonts/sora-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ---------- Paletas: cada ambiente define los mismos tokens ---------- */
:root {
  --brand: #173a32;
  --brand-deep: #0f2a24;
  --mint: #b9ce91;
  --gutter: clamp(20px, 4vw, 72px);
  --container: 1280px;
  --radius: 14px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
[data-theme="inicio"] {
  --bg: #f4f1e8; --surface: #fffdf6; --ink: #173a32; --muted: #4d5f57; --line: #d6dacd;
  --accent: #a3c96b; --accent-2: #e8b44a; --accent-ink: #2c6a3c;
  --btn-bg: #173a32; --btn-ink: #f4f1e8; --glow: #a3c96b55;
}
[data-theme="tecnologia"] {
  --bg: #08161b; --surface: #0f2329; --ink: #eaf6f1; --muted: #a9bfba; --line: #24423f;
  --accent: #b4f24a; --accent-2: #33e1c9; --accent-ink: #b4f24a;
  --btn-bg: #b4f24a; --btn-ink: #08161b; --glow: #b4f24a40;
  color-scheme: dark;
}
[data-theme="negocios"] {
  --bg: #f5eee1; --surface: #fffaf1; --ink: #1d2436; --muted: #555a66; --line: #ddd0ba;
  --accent: #d6a23a; --accent-2: #1d2436; --accent-ink: #8a5f12;
  --btn-bg: #1d2436; --btn-ink: #f5eee1; --glow: #d6a23a45;
}
[data-theme="digital"] {
  --bg: #f2ecff; --surface: #fdfbff; --ink: #20133a; --muted: #5a4d70; --line: #ddd0f5;
  --accent: #e1338a; --accent-2: #6c47ff; --accent-ink: #b0156a;
  --btn-bg: linear-gradient(120deg, #d61f7f, #6a46f0); --btn-ink: #fff; --glow: #8b4cff40;
}
[data-theme="alimentos"] {
  --bg: #fbe8cf; --surface: #fff6ea; --ink: #3a1d12; --muted: #6e4c3b; --line: #ecc9a2;
  --accent: #e0662a; --accent-2: #7b8b2a; --accent-ink: #a63c12;
  --btn-bg: #a63c12; --btn-ink: #fff6ea; --glow: #e0662a45;
}
[data-theme="formacion"] {
  --bg: #e8f1fc; --surface: #f8fbff; --ink: #13304d; --muted: #4a5f75; --line: #c9d9ee;
  --accent: #3a7bea; --accent-2: #ff7a59; --accent-ink: #1f58c0;
  --btn-bg: #1f58c0; --btn-ink: #fff; --glow: #3a7bea40;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.7 Manrope, system-ui, Arial, sans-serif; -webkit-font-smoothing: antialiased; transition: background-color .6s var(--ease), color .6s var(--ease); }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: Sora, Manrope, sans-serif; font-weight: 600; line-height: 1.12; letter-spacing: -.04em; }
h1 { font-size: clamp(42px, 5.4vw, 80px); }
h2 { font-size: clamp(28px, 3vw, 46px); }
h3 { font-size: 22px; }
p { max-width: 65ch; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; border: 0; background: transparent; }
img { display: block; max-width: 100%; object-fit: cover; }
[hidden] { display: none !important; }
.container { width: min(var(--container), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 16px; background: var(--brand); color: #fff; padding: 12px; z-index: 100; }
.skip-link:focus { top: 10px; }
.icon { width: 22px; height: 22px; display: block; flex: none; }
.eyebrow { font-size: 12px; letter-spacing: .16em; font-weight: 700; line-height: 1.6; margin-bottom: 16px; text-transform: uppercase; color: var(--accent-ink); }

/* ---------- Botones y enlaces ---------- */
.button { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; justify-content: center; align-items: center; gap: 14px; min-height: 50px; padding: 12px 24px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink); font-size: 14px; font-weight: 700; transition: transform .25s var(--ease), box-shadow .25s var(--ease); box-shadow: 0 8px 24px -10px var(--glow); }
.button::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, #ffffff40 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s var(--ease); }
.button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--glow); }
.button:hover::before { transform: translateX(120%); }
.button .icon { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.button:hover .icon { transform: translate(2px, -2px); }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; font-size: 14px; font-weight: 700; line-height: 1.4; text-align: left; }
.text-link .icon { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.text-link .link-label { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--ease); padding-bottom: 2px; }
.text-link:hover .link-label { background-size: 100% 1.5px; }
.text-link:hover .icon { transform: translate(2px, -2px); }

/* ---------- Header ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transform: scaleX(0); }
.header { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in srgb, var(--bg) 86%, transparent); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); transition: background-color .6s var(--ease), color .6s var(--ease), border-color .6s; }
.nav-wrap { min-height: 78px; display: flex; align-items: center; gap: 32px; }
.brand { flex: none; display: flex; align-items: center; color: var(--ink); }
.logo { display: block; height: 46px; aspect-ratio: 1020 / 518; background: currentColor; -webkit-mask: url('../assets/brand/logo-mask.png') center / contain no-repeat; mask: url('../assets/brand/logo-mask.png') center / contain no-repeat; transition: background-color .6s var(--ease); }
.navigation { position: relative; display: flex; align-items: center; gap: clamp(14px, 1.8vw, 30px); margin-left: auto; }
.navigation a { position: relative; font-size: 14px; font-weight: 600; min-height: 44px; display: flex; align-items: center; white-space: nowrap; opacity: .78; transition: opacity .2s; }
.navigation a:hover, .navigation a[aria-current] { opacity: 1; }
.navigation a[aria-current] { font-weight: 700; }
.nav-indicator { position: absolute; left: 0; bottom: 6px; height: 3px; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: transform .5s var(--ease), width .5s var(--ease), opacity .3s; pointer-events: none; }
.header-contact { min-height: 44px; padding: 10px 20px; font-size: 13px; white-space: nowrap; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; padding: 10px; }
.menu-toggle span { height: 2px; display: block; background: currentColor; margin: 7px 0; transition: transform .25s; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Contacto (superficie de marca común) ---------- */
.contact-section { position: relative; overflow: hidden; background: var(--brand); color: #f4f6ee; padding: 88px 0; --accent-ink: #c9e59a; }
.contact-glow { position: absolute; inset: -30% -10% auto auto; width: 60vw; height: 60vw; border-radius: 50%; background: radial-gradient(circle, #b9ce9133, transparent 65%); pointer-events: none; }
.contact-layout { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); grid-template-areas: 'copy form' 'guide form'; grid-template-rows: auto 1fr; gap: 32px 56px; }
.contact-copy { grid-area: copy; min-width: 0; }
.contact-copy .eyebrow { color: var(--mint); }
.contact-copy h2 { font-size: clamp(38px, 4.2vw, 60px); max-width: 16ch; margin-bottom: 20px; }
.contact-title-tail { color: var(--mint); }
#contact-title:focus-visible { outline-color: var(--mint); }
.contact-copy > p:not(.eyebrow) { color: #d3dfd4; margin-bottom: 24px; }
.contact-copy .text-link { color: var(--mint); min-height: 48px; }
.contact-line { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 12px; border: 1px solid #f3f6ed30; border-radius: 12px; background: #ffffff08; transition: background .25s, border-color .25s, transform .25s var(--ease); }
.contact-line:hover { background: #ffffff12; border-color: var(--mint); transform: translateX(4px); }
.contact-line .icon { color: var(--mint); }
.contact-line small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; display: block; color: #c4d3c6; }
.contact-line strong { font-size: 16px; overflow-wrap: anywhere; }
.contact-copy > p.location { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; color: #f4f6ee; }
.location .icon { color: var(--mint); width: 20px; height: 20px; }
.consultation-guide { grid-area: guide; border-top: 1px solid #f3f6ed30; padding-top: 24px; min-width: 0; }
.consultation-guide h3 { font-size: 19px; margin-bottom: 12px; }
.consultation-guide ol { padding-left: 20px; margin: 0; font-size: 14px; color: #d3dfd4; }
.consultation-guide li + li { margin-top: 8px; }
.contact-form { grid-area: form; background: #fcfcf7; color: var(--brand); border-radius: 22px; align-self: start; min-width: 0; padding: 36px; box-shadow: 0 30px 80px -30px #000a; --accent-ink: #2c6a3c; --btn-bg: var(--brand); --btn-ink: #f4f6ee; --glow: #0f2a2466; }
.form-header { display: flex; justify-content: space-between; align-items: center; }
.form-header h3 { font-size: 28px; }
.form-header .icon { color: #6b9a3a; }
.form-intro { font-size: 14px; color: #52635a; margin: 10px 0 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; border: 1.5px solid #c9d3c1; border-radius: 10px; padding: 12px 14px; background: #fff; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #4d7f3a; box-shadow: 0 0 0 4px #a3c96b55; }
.field-note { font-size: 13px; margin: -6px 0 14px; color: #2c6a3c; font-weight: 600; }
.field-note:empty { display: none; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.6; margin: 16px 0; }
.consent input { flex: none; margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); }
.inline-link { text-decoration: underline; padding: 0; font: inherit; }
.submit-button { width: 100%; }
.form-note { font-size: 12px; text-align: center; margin: 12px auto 0; color: #52635a; }
.form-result { margin-top: 22px; border: 1px solid #b5c69b; background: #eef4e3; border-radius: 12px; padding: 18px; font-size: 14px; }
.form-result p { margin-bottom: 12px; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.result-actions a:not(.button) { text-decoration: underline; font-weight: 600; }

/* ---------- Footer ---------- */
.footer { padding: 56px 0 28px; background: var(--brand-deep); color: #e7eee6; }
.footer .brand { color: #f4f6ee; margin-bottom: 16px; }
.footer .logo { height: 54px; }
.footer-main { display: grid; grid-template-columns: 1.1fr .8fr 1fr 1.1fr; gap: 32px; }
.footer h3 { font-size: 15px; margin-bottom: 12px; color: var(--mint); }
.footer p, .footer-links a { font-size: 14px; color: #c7d4c9; }
.footer-links a { display: block; min-height: 34px; overflow-wrap: anywhere; transition: color .2s, transform .2s; }
.footer-links a:hover { color: #fff; transform: translateX(3px); }
.footer-note p { margin-bottom: 14px; }
.footer-note .text-link { color: var(--mint); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid #ffffff1f; font-size: 13px; padding-top: 18px; margin-top: 36px; color: #a9b9ac; }
.footer-bottom div { display: flex; flex-wrap: wrap; }
.footer-bottom button { padding: 8px 10px; font-size: 13px; min-height: 44px; color: #c7d4c9; }
.footer-bottom button:hover { color: #fff; text-decoration: underline; }
.footer :focus-visible { outline-color: var(--mint); }

/* ---------- Botones flotantes ---------- */
.whatsapp-float { position: fixed; bottom: 22px; right: 22px; z-index: 45; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #1f8a4c; color: #fff; box-shadow: 0 10px 28px -8px #0f3d2299; transition: transform .25s var(--ease); }
.whatsapp-float:hover { transform: scale(1.08) rotate(-6deg); }
.whatsapp-float .icon { width: 26px; height: 26px; }
.motion-toggle { position: fixed; bottom: 22px; left: 22px; z-index: 45; display: inline-flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--ink); border: 1px solid var(--line); padding: 8px 14px 8px 10px; border-radius: 24px; font-size: 12px; font-weight: 600; min-height: 44px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.motion-toggle .icon { width: 16px; height: 16px; }
.motion-toggle:disabled { cursor: default; opacity: .8; }

/* ---------- Diálogos ---------- */
.modal { border: 0; padding: 0; width: min(1000px, calc(100% - 32px)); max-height: calc(100svh - 40px); background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: 0 40px 120px -30px #000c; }
.modal[open] { animation: modal-in .35s var(--ease); }
.modal::backdrop { background: #0b1a17b3; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body.dialog-open { overflow: hidden; }
.dialog-shell { position: relative; background: inherit; }
.dialog-toolbar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: flex-end; padding: 12px 16px; background: inherit; }
.modal-close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--ink); border: 1px solid var(--line); transition: transform .25s var(--ease); }
.modal-close:hover { transform: rotate(90deg); }
.modal-close .icon { width: 20px; height: 20px; }
#service-detail, #policy-content { padding: 0 36px 36px; }
.detail-layout { display: grid; grid-template-columns: .85fr 1fr; gap: 28px 32px; }
.detail-image { position: relative; min-width: 0; min-height: 280px; overflow: hidden; border-radius: 14px; }
.detail-image img { position: absolute; inset: 0; width: 100%; height: 100%; }
.detail-image img.is-zoomed { transform: scale(var(--zoom)); }
.detail-image .photo-unavailable { position: absolute; inset: 0; min-height: 0; }
.detail-content { min-width: 0; }
.detail-content .eyebrow { margin-bottom: 12px; }
.detail-content h2 { margin-bottom: 16px; font-size: 34px; }
.detail-content p:not(.eyebrow) { color: var(--muted); }
.detail-sections { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; border-top: 1px solid var(--line); padding-top: 24px; }
.detail-section h3 { font-size: 18px; margin-bottom: 12px; }
.detail-section ul { list-style: none; padding: 0; margin: 0; }
.detail-section li { display: flex; gap: 10px; align-items: flex-start; }
.detail-section li + li { margin-top: 6px; }
.detail-section li .icon { width: 16px; height: 16px; margin-top: 5px; color: var(--accent-ink); }
.detail-options { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 24px; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-section .variant-chips li { margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.detail-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.detail-cta { width: 280px; max-width: 100%; justify-content: space-between; }
.detail-note { flex: 1; max-width: none; font-size: 13px; color: var(--muted); }
.policy-modal { max-width: 720px; }
.policy-modal h2 { margin-bottom: 20px; }
.policy-modal h3 { font-size: 19px; margin: 24px 0 10px; }
.policy-modal p { margin-bottom: 14px; color: var(--muted); }
.policy-modal a { text-decoration: underline; }
.credits-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.credits-list li { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); }
.credits-list span { color: var(--muted); }

.fallback-intro { padding-block: 80px; }
.fallback-intro p { margin: 20px 0; }
.photo-unavailable { display: grid; place-items: center; min-height: 220px; border: 1px dashed currentColor; padding: 20px; font-size: 14px; }

/* ---------- Responsive común ---------- */
@media (min-width: 1800px) {
  :root { --container: 1400px; }
  body { font-size: 18px; }
}
@media (max-width: 1099px) {
  .nav-wrap { min-height: 68px; }
  .logo { height: 42px; }
  .menu-toggle { display: block; margin-left: 0; }
  .header-contact { margin-left: auto; }
  .nav-indicator { display: none; }
  .navigation { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 14px var(--gutter) 24px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px #0005; }
  .navigation.open { display: flex; flex-direction: column; align-items: stretch; gap: 2px; animation: menu-in .3s var(--ease); }
  .navigation a { font-size: 18px; padding: 8px 0; opacity: 1; border-bottom: 1px solid var(--line); }
  .navigation a[aria-current] { color: var(--accent-ink); }
  .contact-layout { grid-template-columns: 1fr; grid-template-areas: 'copy' 'form' 'guide'; grid-template-rows: auto; max-width: 760px; }
  .footer-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  :root { --gutter: 20px; }
  h1 { font-size: clamp(36px, 10vw, 52px); }
  .nav-wrap { min-height: 64px; gap: 12px; }
  .logo { height: 38px; }
  .header-contact { padding: 8px 16px; }
  .contact-section { padding: 56px 0; }
  .contact-form { padding: 24px 18px; border-radius: 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-header h3 { font-size: 24px; }
  .footer-main { gap: 28px; }
  .footer-note { grid-column: 1 / -1; }
  .footer-links a { min-height: 44px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .modal { width: calc(100% - 20px); max-height: calc(100svh - 20px); }
  #service-detail, #policy-content { padding: 0 20px 24px; }
  .dialog-toolbar { padding: 12px; }
  .detail-layout { grid-template-columns: 1fr; gap: 22px; }
  .detail-image { min-height: 0; aspect-ratio: 16 / 10; }
  .detail-content h2 { font-size: 28px; }
  .detail-sections { grid-template-columns: 1fr; }
  .detail-footer { flex-direction: column; align-items: stretch; gap: 16px; }
  .detail-cta { width: 100%; }
  .whatsapp-float { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .motion-toggle { left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .motion-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .motion-toggle { padding: 0; width: 44px; justify-content: center; }
}
