/* =========================================================
   ROYAL LEBENSMITTEL GLOBAL - Corporate Web Styles
   Clean / neutral / elegant. White + Carbon + Royal + Gold.
   ========================================================= */

/* -------- Design Tokens -------- */
:root{
  /* Base */
  --bg:#ffffff;
  --surface:#ffffff;
  --ink:#0B0F14;
  --text:rgba(11,15,20,.90);
  --muted:rgba(11,15,20,.68);
  --soft:rgba(11,15,20,.55);

  /* Brand */
  --royal:#7C1326;       /* headings */
  --royal2:#5A0F1B;      /* details */
  --gold:#FFD44A;        /* primary CTA */
  --goldH:#FFCB2F;

  /* Premium */
  --carbon:#0B0F14;
  --carbon2:#0E141B;

  /* UI */
  --border:rgba(11,15,20,.12);
  --border2:rgba(11,15,20,.08);
  --shadow:0 22px 60px rgba(0,0,0,.12);
  --shadow2:0 14px 36px rgba(0,0,0,.10);

  --radius:22px;
  --radius2:28px;
  --radius-sm:14px;

  --container:1240px;
}

/* -------- Reset / Base -------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x:hidden;
}

.t-royal{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: -.02em;
  color: var(--royal2);
  margin: 0;
}
.sub{
  margin: 10px 0 0;
  color: rgba(11,15,20,.72);
  line-height: 1.75;
  max-width: 92ch;
}
.ticks{
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.ticks p{
  color: rgba(11,15,20,.78);
  line-height: 1.7;
  text-align: center;
}

img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; }

p{ margin:0 0 12px; }
small{ color:var(--soft); }

.container{
  width:min(var(--container), calc(100% - 40px));
  margin:0 auto;
}

hr{
  border:0;
  border-top:1px solid var(--border2);
  margin: 18px 0;
}

/* Focus (accesibilidad premium) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline: none;
  box-shadow: 0 0 0 6px rgba(255,212,74,.22);
  border-radius: 14px;
}

/* -------- Typography -------- */
h1,h2,h3,h4{
  margin:0 0 10px;
  color:var(--ink);
  letter-spacing:-.02em;
}
h1{ font-size: clamp(2.0rem, 3.1vw, 3.2rem); line-height:1.06; font-weight:950; color:var(--royal); }
h2{ font-size: clamp(1.55rem, 2.2vw, 2.25rem); line-height:1.15; font-weight:950; color:var(--royal); }
h3{ font-size: 1.12rem; line-height:1.25; font-weight:900; }
.lead{ color: rgba(11,15,20,.82); line-height:1.75; max-width: 92ch; }

/* -------- Buttons -------- */
.btn, .btnx{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #333333;
  font-weight: 900;
  cursor:pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  text-decoration:none;
}
.btn:hover, .btnx:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow2);
  text-decoration:none;
}
.btn.primary, .btnx.gold{
  background: var(--gold);
  border-color: rgba(0,0,0,.14);
  color: #101318;
  box-shadow: 0 18px 44px rgba(255,212,74,.22);
}
.btn.primary:hover, .btnx.gold:hover{ background: var(--goldH); }
.btn.dark, .btnx.dark{
  background: var(--carbon);
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
}
.btn.dark:hover, .btnx.dark:hover{ box-shadow: 0 22px 60px rgba(0,0,0,.30); }

.btn svg, .btnx svg{ width:18px; height:18px; }

/* -------- Cards / Surfaces -------- */
.card, .cardx, .panel, .mini, .quote, .logo-band, .cta-box, .market{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card{
  box-shadow: 0 12px 34px rgba(0,0,0,.08);
  padding: 18px;
}

.cardx{
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  background-color: rgb(255, 255, 255);
  box-shadow: 0 12px 34px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  min-height: 380px;
  background-color: #646262;
}
.cardx .media{ height: 168px; background-size: cover; background-position: center; position: relative; }
.cardx .media:after{ content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.32)); }
.cardx .body{
  padding: 16px 16px 18px;
  background-color: #646262;
}
.cardx h3{ margin:0 0 6px; font-size: 1.10rem; letter-spacing: .01em; color: var(--ink); text-align: center; }
.cardx p{ margin:0; color: rgba(11,15,20,.74); line-height: 1.7; text-align: center; }
.cardx .link{
  display:inline-flex; align-items:center; gap:10px;
  margin-top: 12px;
  font-weight: 900;
  color: var(--royal-red);
  text-decoration:none;
}
.cardx .link:hover{ text-decoration: underline; }

.cards3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media(max-width: 980px){
  .cards3{ grid-template-columns: 1fr; }
}

.feature-grid{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
  margin-top: 18px;
}
.feature-card{
  border-radius: 22px;
  border: 1px solid rgba(11,15,20,.08);
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 36px rgba(0,0,0,.06);
  overflow:hidden;
}
.feature-card .pad{
  padding: 18px;
  background-color: #646262;
}
.feature-card h3{ margin:0 0 8px; }
.feature-card p{ margin:0; color: rgba(11,15,20,.74); line-height: 1.7; }
.feature-media{
  height: 230px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.feature-media::after{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(11,15,20,.18));
}

.section{
  padding: 34px 0;
}

.section-head{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 18px;
  margin-bottom: 14px;
  text-align:center;
}

.page-index .section-head{
  flex-direction:row;
  align-items:flex-end;
  justify-content:space-between;
  text-align:left;
}

.section-head p{
  margin:0;
  color: var(--muted);
  max-width: 78ch;
  line-height: 1.7;
}

/* -------- Premium Carbon Sections -------- */
.section-carbon, .carbon{
  background: linear-gradient(180deg, var(--carbon), var(--carbon2));
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.section-carbon h1, .section-carbon h2, .section-carbon h3,
.carbon h1, .carbon h2, .carbon h3{ color: rgba(255,255,255,.96); }
.section-carbon p, .carbon p{ color: rgba(255,255,255,.78); }
.section-carbon .ticks p, .carbon .ticks p{ color: rgba(255,255,255,.84); }

/* -------- Page-Specific Carbon Sections -------- */
.contacto-section-carbon{
  background: linear-gradient(180deg, var(--carbon), var(--carbon2));
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.contacto-section-carbon h1, .contacto-section-carbon h2, .contacto-section-carbon h3{ color: rgba(255,255,255,.96); }
.contacto-section-carbon p{ color: rgba(255,255,255,.78); }
.contacto-section-carbon .ticks p{ color: rgba(255,255,255,.84); }

/* -------- Page-Specific Gray Sections -------- */
.contacto-gray-section{
  background-color: #646262;
}

/* -------- Page Hero Sections with Images -------- */
.contacto-hero{
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('../img/home/slider/05-warehouse-pallets-spain.jpg');
  background-size: cover;
  background-position: center;
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.contacto-hero h1, .contacto-hero h2, .contacto-hero h3{ color: rgba(255,255,255,.96); }
.contacto-hero p{ color: rgba(255,255,255,.78); }

.servicios-hero{
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('../img/home/distribucion-alimentaria-spain.jpg');
  background-size: cover;
  background-position: center;
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.servicios-hero h1, .servicios-hero h2, .servicios-hero h3{ color: rgba(255,255,255,.96); }
.servicios-hero p{ color: rgba(255,255,255,.78); }

.sectores-hero{
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('../img/home/slider/04-agro-productores-spain.jpg');
  background-size: cover;
  background-position: center;
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sectores-hero h1, .sectores-hero h2, .sectores-hero h3{ color: rgba(255,255,255,.96); }
.sectores-hero p{ color: rgba(255,255,255,.78); }

.logistica-frio-hero{
  min-height: 440px;
  padding: 72px 0;
  background-image: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.65)), url('../img/home/slider/02-muelle-carga-spain.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: relative;
}
.logistica-frio-hero .section-head{ position: relative; z-index: 1; }
.logistica-frio-hero h1, .logistica-frio-hero h1.t-royal, .logistica-frio-hero h2, .logistica-frio-hero h3{ color: #ffffff; }
.logistica-frio-hero p, .logistica-frio-hero .lead{ color: rgba(255,255,255,.88); }

.calidad-trazabilidad-hero{
  background: linear-gradient(180deg, rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('../img/home/congelado-pescado-spain.jpg');
  background-size: cover;
  background-position: center;
  color: rgba(255,255,255,.92);
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.calidad-trazabilidad-hero h1, .calidad-trazabilidad-hero h2, .calidad-trazabilidad-hero h3{ color: rgba(255,255,255,.96); }
.calidad-trazabilidad-hero p{ color: rgba(255,255,255,.78); }

/* -------- Header / Topbar (works with your /partials/header.html) -------- */
.topbar{
  background: rgba(11,15,20,.96);
  color: rgba(255,255,255,.90);
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.topbar .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 8px 0;
  gap: 12px;
}
.topbar a{ color: rgba(255,255,255,.90); text-decoration:none; }
.topbar a:hover{ text-decoration:underline; }

.site-header{
  position: sticky; /* compatible con el cálculo de padding en JS */
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border2);
}
.site-header .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}
.brand img{ height: 42px; width:auto; }
.brand .name{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}
.brand .name strong{ color: var(--ink); font-weight: 950; letter-spacing:.02em; }
.brand .name span{ color: var(--soft); font-size: 12px; }

.nav{
  display:flex;
  align-items:center;
  gap: 16px;
}
.nav a{
  color: rgba(11,15,20,.78);
  font-weight: 850;
  font-size: 14px;
  text-decoration:none;
  padding: 8px 10px;
  border-radius: 12px;
}
.nav a:hover{
  background: rgba(11,15,20,.04);
  text-decoration:none;
}
.nav a.active{
  color: var(--royal2);
  background: rgba(124,19,38,.06);
  border: 1px solid rgba(124,19,38,.12);
}

/* Mobile nav */
.nav-toggle{
  display:none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
}
.nav-toggle svg{ width:20px;height:20px; }
.nav-mobile{
  display:none;
  border-top: 1px solid var(--border2);
  background: rgba(255,255,255,.96);
}
.nav-mobile .container{
  padding: 12px 0 14px;
  display:grid;
  gap: 8px;
}
.nav-mobile a{
  display:flex;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: rgba(11,15,20,.02);
  color: rgba(11,15,20,.84);
  font-weight: 900;
  text-decoration:none;
}
.nav-mobile a:hover{
  background: rgba(11,15,20,.04);
}

@media(max-width: 980px){
  .nav{ display:none; }
  .nav-toggle{ display:inline-flex; align-items:center; justify-content:center; }
  .nav-mobile.is-open{ display:block; }
}

/* -------- Footer -------- */
.site-footer{
  background: linear-gradient(180deg, var(--carbon), var(--carbon2));
  color: rgba(255,255,255,.84);
  border-top: 1px solid rgba(255,255,255,.10);
}
.site-footer a{ color: rgba(255,255,255,.88); text-decoration:none; }
.site-footer a:hover{ text-decoration:underline; }
.site-footer .container{
  padding: 28px 0;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 16px;
}
.footer-title{
  color: rgba(255,255,255,.95);
  font-weight: 950;
  margin:0 0 10px;
}
.footer-note{
  color: rgba(255,255,255,.70);
  line-height: 1.7;
}
.footer-links{
  display:grid;
  gap: 8px;
  margin-top: 8px;
}
.footer-bottom{
  border-top: 1px solid rgba(255,255,255,.10);
  padding: 12px 0 18px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
}
.footer-bottom .container{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap:wrap;
}

/* -------- Legal Modal (footer) -------- */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 2000;
}
.modal-window{
  width: min(860px, 100%);
  max-height: min(82vh, 820px);
  overflow:auto;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, #10161E, #0B0F14);
  color: rgba(255,255,255,.88);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  outline: none;
}
.modal-head{
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}
.modal-head h3{
  margin:0;
  color: rgba(255,255,255,.96);
  font-weight: 950;
}
.modal-close{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
}
.modal-body{
  padding: 16px;
  line-height: 1.8;
  color: rgba(255,255,255,.82);
}
.modal-actions{
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.10);
  display:flex;
  justify-content:flex-end;
}

/* -------- Helpers -------- */
.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3{ display:grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media(max-width:980px){
  .grid-2, .grid-3{ grid-template-columns: 1fr; }
}

/* -------- Legal Pages -------- */
.legal-page{
  background:#fff;
}
.legal-hero{
  background: linear-gradient(180deg, rgba(11,15,20,.055), rgba(255,255,255,0));
  border-bottom:1px solid var(--border2);
  text-align:center;
  padding:56px 0 42px;
}
.legal-wrap{
  width:min(980px, calc(100% - 40px));
  max-width:980px;
  margin-left:auto;
  margin-right:auto;
}
.legal-hero .legal-wrap{
  width:min(860px, calc(100% - 40px));
  max-width:860px;
}
.legal-hero .lead{
  margin-left:auto;
  margin-right:auto;
}
.legal-kicker{
  margin:0 0 10px;
  color:var(--royal2);
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.legal-date{
  margin:16px 0 0;
  color:var(--soft);
  font-size:.92rem;
  text-align:center;
}
.legal-block{
  width:100%;
  margin:0 auto 22px;
  padding:30px 30px 32px;
  border:1px solid var(--border2);
  border-radius:18px;
  background:linear-gradient(180deg, #fff, rgba(11,15,20,.018));
  box-shadow:0 12px 34px rgba(0,0,0,.045);
}
.legal-block:first-child{
  padding-top:30px;
}
.legal-block h2{
  font-size:clamp(1.25rem, 1.7vw, 1.65rem);
  margin:0 auto 18px;
  text-align:center;
  max-width:760px;
  color:var(--royal);
}
.legal-block h3{
  margin:20px auto 10px;
  text-align:center;
  max-width:720px;
}
.legal-block p,
.legal-block li{
  color:rgba(11,15,20,.78);
  line-height:1.75;
}
.legal-block p{
  max-width:78ch;
  margin-left:auto;
  margin-right:auto;
  text-align:center;
}
.legal-block ul{
  width:min(760px, 100%);
  margin:16px auto 0;
  padding:0;
  list-style:none;
  display:grid;
  gap:10px;
}
.legal-block li{
  position:relative;
  padding:11px 14px 11px 34px;
  border:1px solid var(--border2);
  border-radius:12px;
  background:rgba(11,15,20,.025);
  text-align:left;
}
.legal-block li::before{
  content:"";
  position:absolute;
  left:14px;
  top:1.15em;
  width:7px;
  height:7px;
  border-radius:50%;
  background:var(--gold);
  box-shadow:0 0 0 4px rgba(255,212,74,.18);
}
.legal-block a{
  color:var(--royal2);
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
}
.legal-table{
  width:100%;
  overflow:auto;
  margin:18px auto;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.045);
}
.legal-table table{
  width:100%;
  min-width:680px;
  border-collapse:collapse;
}
.legal-table th,
.legal-table td{
  padding:15px 16px;
  border-bottom:1px solid var(--border2);
  vertical-align:top;
  text-align:center;
  color:rgba(11,15,20,.80);
  line-height:1.55;
}
.legal-table th{
  width:30%;
  color:var(--royal2);
  background:rgba(90,15,27,.075);
  font-weight:900;
}
.legal-table tr:last-child th,
.legal-table tr:last-child td{
  border-bottom:0;
}
.legal-table code{
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:.9em;
}
@media(max-width:680px){
  .legal-hero{
    padding:38px 0 30px;
  }
  .legal-block{
    padding:22px 18px 24px;
    border-radius:14px;
  }
  .legal-block p{
    text-align:left;
  }
  .legal-table th,
  .legal-table td{
    text-align:left;
  }
}

/* -------- CRM Auth -------- */
.auth-page{
  min-height:70vh;
  display:grid;
  place-items:start center;
  padding:64px 20px;
  background:linear-gradient(180deg, rgba(11,15,20,.045), rgba(255,255,255,0));
}
.auth-panel{
  width:min(560px, 100%);
  padding:32px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:0 18px 48px rgba(0,0,0,.09);
  text-align:center;
}
.auth-panel h1{
  margin:0 0 10px;
  color:var(--royal);
}
.auth-panel p{
  color:var(--muted);
  line-height:1.65;
}
.auth-form{
  display:grid;
  gap:14px;
  margin:22px 0 0;
  text-align:left;
}
.auth-form label{
  display:grid;
  gap:8px;
  color:var(--ink);
  font-weight:900;
}
.auth-form input{
  width:100%;
  padding:13px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  color:#333333;
  background:#ffffff;
  font:inherit;
}
input, select, textarea {
  color: #333333 !important;
}
.auth-alert,
.auth-success{
  margin:18px 0;
  padding:12px 14px;
  border-radius:12px;
  font-weight:800;
  line-height:1.55;
}
.auth-alert{
  border:1px solid rgba(192,57,43,.25);
  background:rgba(192,57,43,.10);
  color:#7B241C;
}
.auth-success{
  border:1px solid rgba(39,174,96,.25);
  background:rgba(39,174,96,.12);
  color:#145A32;
}
.auth-foot{
  margin:20px 0 0;
  font-size:.95rem;
}
.auth-foot a{
  color:var(--royal2);
  font-weight:900;
}
.crm-panel{
  width:min(760px, 100%);
}
.crm-stats{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(130px, 1fr));
  gap:12px;
  margin:22px 0;
}
.crm-stats div{
  padding:16px;
  border:1px solid var(--border2);
  border-radius:14px;
  background:rgba(11,15,20,.025);
}
.crm-stats strong{
  display:block;
  color:var(--royal);
  font-size:1.8rem;
}
.crm-stats span{
  color:var(--muted);
  font-weight:800;
}
