/*
Theme Name: Transfortis
Theme URI: https://transfortis.es
Author: TRANSFORTIS S.L.
Description: Tema a medida para TRANSFORTIS S.L. — transporte de mercancías refrigerada y seca desde Mercamurcia.
Version: 1.0.6
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: transfortis
*/

:root {
  --bg: oklch(15.5% .012 255);
  --fg: oklch(94% .008 90);
  --card: oklch(19.5% .014 255);
  --muted: oklch(24% .016 255);
  --muted-fg: oklch(68% .02 250);
  --primary: oklch(70.5% .19 55);
  --primary-fg: oklch(16% .02 60);
  --border: oklch(100% 0 0 / .1);
  --radius: .375rem;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: 1.05; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
svg.ico { width: 1.25em; height: 1.25em; flex: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  font-size: .95rem; padding: .95rem 1.5rem; border-radius: 2px; border: 1px solid transparent;
  cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: oklch(76% .18 58); }
.btn-ghost { background: oklch(15.5% .012 255 / .4); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: oklch(15.5% .012 255 / .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; }
.brand-mark { width: 36px; height: 36px; border-radius: var(--radius); background: var(--primary); color: var(--primary-fg); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.brand span.sl { color: var(--primary); }
.nav { display: none; align-items: center; gap: 2rem; }
.nav a { color: var(--muted-fg); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav a:hover { color: var(--fg); }
.header-cta { display: none; padding: .7rem 1.2rem; font-size: .85rem; }
.menu-toggle { background: transparent; border: 1px solid var(--border); color: var(--fg); width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; cursor: pointer; }
.mobile-nav { display: none; border-top: 1px solid var(--border); background: var(--bg); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: .9rem 16px; border-bottom: 1px solid var(--border); font-weight: 500; }
.mobile-nav a.btn { margin: 1rem 16px; display: flex; border-bottom: 0; }
@media (min-width: 900px) {
  .nav, .header-cta { display: inline-flex; }
  .menu-toggle, .mobile-nav, .mobile-nav.open { display: none; }
}

/* Hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 96px 0 64px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(oklch(15.5% .012 255 / .55) 0%, oklch(15.5% .012 255 / .78) 55%, var(--bg) 100%); }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid oklch(70.5% .19 55 / .5); background: oklch(70.5% .19 55 / .1);
  color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: .45rem 1rem; border-radius: 999px; margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.5rem); max-width: 16ch; margin-bottom: 1.5rem; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero-lead { color: var(--muted-fg); font-size: clamp(1rem, 2.2vw, 1.2rem); max-width: 40rem; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* Stats */
.stats { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats .wrap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
@media (min-width: 768px) { .stats .wrap { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 5vw, 3rem); color: var(--primary); line-height: 1.1; }
.stat span { display: block; margin-top: .4rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-fg); font-weight: 600; }

/* Sections */
.section { padding: 5rem 0; }
@media (min-width: 768px) { .section { padding: 7rem 0; } }
.section.alt { background: var(--card); }
.eyebrow { color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 1rem; display: block; }
.section h2 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 1.25rem; }
.section-head { max-width: 46rem; margin-bottom: 3rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.lead { color: var(--muted-fg); font-size: 1.05rem; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--primary), transparent); opacity: .35; }

/* Services */
.services { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .services { grid-template-columns: repeat(4, 1fr); } }
.svc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .25s, transform .25s; }
.svc:hover { border-color: oklch(70.5% .19 55 / .6); transform: translateY(-3px); }
.svc-img { position: relative; aspect-ratio: 16/10; background: var(--muted); }
.svc-img img { width: 100%; height: 100%; object-fit: cover; }
.svc-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--card) 0%, transparent 100%); }
.svc-ico { position: relative; z-index: 1; margin: -1.6rem 0 0 1.5rem; width: 44px; height: 44px; border-radius: var(--radius); background: var(--primary); color: var(--primary-fg); display: grid; place-items: center; }
.svc-ico svg { width: 22px; height: 22px; }
.svc-body { padding: 1.5rem; }
.svc h3 { font-size: 1.25rem; margin-bottom: .75rem; }
.svc p { color: var(--muted-fg); font-size: .95rem; }
.svc .tag { display: inline-block; margin-bottom: .75rem; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); border: 1px solid oklch(70.5% .19 55 / .4); padding: .2rem .55rem; border-radius: 999px; }

/* About */
.about { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .about { grid-template-columns: 1.05fr 1fr; gap: 4rem; } }
.about-img { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 4/3; background: var(--muted); }
.about-img img { width: 100%; height: 100%; object-fit: cover; }
.checks { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .85rem; }
.checks li { display: flex; align-items: center; gap: .75rem; font-weight: 500; }
.checks svg { color: var(--primary); }

/* Coverage */
.route { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0 auto 3rem; max-width: 40rem; }
.route-box { border: 1px solid var(--border); background: var(--bg); padding: 1rem 1.25rem; border-radius: var(--radius); text-align: center; }
.route-box.origin { border-color: oklch(70.5% .19 55 / .6); background: oklch(70.5% .19 55 / .08); }
.route-box small { display: block; font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-fg); font-weight: 700; }
.route-box.origin small { color: var(--primary); }
.route-box b { font-family: var(--display); font-size: 1rem; }
.route-line { flex: 1; height: 1px; background: var(--primary); opacity: .5; position: relative; min-width: 30px; }
.route-line svg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--card); color: var(--primary); width: 26px; height: 26px; padding: 2px; }
.countries { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .countries { grid-template-columns: repeat(4, 1fr); } }
.country { display: flex; align-items: center; gap: .85rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; font-weight: 600; }
.country span { font-family: var(--display); font-size: .75rem; font-weight: 800; color: var(--primary); background: oklch(70.5% .19 55 / .12); padding: .3rem .5rem; border-radius: 3px; }

/* Calculator */
.calc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
@media (min-width: 768px) { .calc { padding: 3rem; } }
.calc-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.calc-head .svc-ico { margin: 0; flex: none; }
.calc-head h2 { margin-bottom: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.calc-intro { color: var(--muted-fg); margin-bottom: 2.5rem; max-width: 60rem; }
.calc-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.2fr 1fr; gap: 3rem; } }
.field { margin-bottom: 1.6rem; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: .6rem; font-size: .95rem; }
.field small { display: block; color: var(--muted-fg); font-size: .78rem; margin-top: .45rem; }
.input, .calc input[type=number], .calc input[type=datetime-local] {
  width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem 1rem; font: inherit; color-scheme: dark;
}
.input:focus, .calc input:focus { outline: none; border-color: var(--primary); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.opt { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem .75rem; text-align: center; cursor: pointer; font: inherit; transition: all .2s; }
.opt b { display: block; font-family: var(--display); font-size: 1rem; }
.opt span { display: block; font-size: .78rem; color: var(--muted-fg); margin-top: .25rem; line-height: 1.35; }
.opt[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.opt[aria-pressed="true"] span { color: oklch(16% .02 60 / .8); }
.result { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; align-self: start; position: sticky; top: 90px; }
.result .k { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-fg); font-weight: 700; }
.result .price { font-family: var(--display); font-weight: 900; font-size: clamp(2.6rem, 6vw, 3.5rem); color: var(--primary); line-height: 1.1; margin: .3rem 0 .4rem; }
.result .price-note { font-size: .78rem; color: var(--muted-fg); line-height: 1.45; margin-bottom: 1.5rem; }
.result .time { font-family: var(--display); font-weight: 800; font-size: 1.8rem; margin: .3rem 0 .25rem; }
.result .time small { font-family: var(--body); font-weight: 500; font-size: .9rem; color: var(--muted-fg); margin-left: .4rem; }
.result .eta { color: var(--primary); font-weight: 600; font-size: .92rem; min-height: 1.4em; }
.breakdown { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; display: grid; gap: .5rem; font-size: .92rem; }
.breakdown div { display: flex; justify-content: space-between; }
.breakdown dt { color: var(--muted-fg); }
.breakdown dd { margin: 0; font-weight: 600; }
.result .note { margin-top: 1.25rem; font-size: .76rem; color: var(--muted-fg); line-height: 1.5; }
.result .btn { width: 100%; margin-top: 1.25rem; }

/* Contact */
.contact { display: grid; gap: 3rem; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.contact-list li { display: flex; gap: .75rem; align-items: flex-start; }
.contact-list svg { color: var(--primary); margin-top: .2rem; }
.contact-list a:hover { color: var(--primary); }
.form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 1rem; }
@media (min-width: 768px) { .form { padding: 2rem; } }
.form textarea { min-height: 140px; resize: vertical; }
.form .check { display: flex; gap: .65rem; align-items: flex-start; font-size: .85rem; color: var(--muted-fg); }
.form .check input { margin-top: .25rem; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.form .check a { color: var(--fg); text-decoration: underline; }
.form .legal-info { font-size: .72rem; color: var(--muted-fg); line-height: 1.5; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.25rem; border-radius: var(--radius); font-weight: 500; }
.notice.ok { background: oklch(55% .13 150 / .2); border: 1px solid oklch(65% .15 150 / .5); }
.notice.err { background: oklch(55% .18 25 / .2); border: 1px solid oklch(65% .18 25 / .5); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 0; font-size: .85rem; color: var(--muted-fg); }
.site-footer .wrap { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .site-footer .wrap { grid-template-columns: auto 1fr auto; align-items: center; } }
.site-footer .brand { color: var(--fg); font-size: 1rem; }
.site-footer .brand-mark { width: 30px; height: 30px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.footer-legal a:hover { color: var(--primary); }

/* Legal / generic pages */
.page-wrap { padding: 8rem 0 5rem; }
.page-wrap .wrap { max-width: 860px; }
.page-wrap h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 2rem; }
.prose { color: oklch(86% .01 250); }
.prose h2 { font-size: 1.35rem; margin: 2.25rem 0 .75rem; color: var(--fg); }
.prose h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.prose p, .prose ul, .prose table { margin: 0 0 1rem; }
.prose ul { padding-left: 1.25rem; }
.prose a { color: var(--primary); text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.prose th { background: var(--card); }
.prose .todo { background: oklch(70.5% .19 55 / .2); color: var(--fg); padding: 0 .3rem; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Origen y destino */
.route-fields { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .route-fields { grid-template-columns: 1fr 1fr; } }
.route-fields label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.route-fields input { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; font: inherit; }
.route-fields input:focus { outline: none; border-color: var(--primary); }
.route-btn { margin-top: .85rem; padding: .75rem 1.2rem; }
.route-pane small[data-route-out] { min-height: 1.2em; line-height: 1.6; }
.route-pane small.err { color: oklch(75% .15 30); }

/* Banderas */
.flag { display: inline-block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px oklch(0% 0 0 / .15); flex: none; object-fit: cover; }
[data-route-out] .flag { width: 20px; height: 14px; vertical-align: -2px; margin-right: .3rem; }
[data-route-out] .cc { font-size: .72rem; font-weight: 800; margin-right: .3rem; opacity: .75; }
