/* ===== gualamba-ui-v2.css ===== */
/* Gualamba UI System v2 — legibilidad, ritmo y consistencia */
:root{
  --ui-bg:#f5f2ea;
  --ui-surface:#fffdf8;
  --ui-surface-2:#f0eee6;
  --ui-text:#17231d;
  --ui-text-2:#3f4d45;
  --ui-muted:#65736a;
  --ui-line:#d6d4ca;
  --ui-green:#1f513d;
  --ui-green-2:#163b2d;
  --ui-gold:#c9954f;
  --ui-focus:#2f7656;
  --ui-shadow:0 12px 32px rgba(23,43,33,.08);
  --ui-shadow-lg:0 24px 60px rgba(23,43,33,.12);
}
html{font-size:16px;scroll-behavior:smooth;scroll-padding-top:92px;color-scheme:light dark}
body{
  font-family:"Manrope",Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif !important;
  font-size:16px !important;
  line-height:1.65 !important;
  letter-spacing:-.005em;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,h5,h6,button,.btn,a.btn,label,.eyebrow,.kicker,.pro-kicker,.brand-copy strong,.site-nav a,.nav a,.nav-actions a,.nav-actions button{
  font-family:"Manrope",Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Arial,sans-serif !important;
}
h1,h2,h3,h4{font-weight:800;letter-spacing:-.025em;line-height:1.16}
h1{font-size:clamp(2rem,4vw,3.75rem)}
h2{font-size:clamp(1.35rem,2.2vw,2rem)}
h3{font-size:clamp(1.08rem,1.6vw,1.35rem)}
p,li,td,th,label,input,select,textarea{font-size:1rem}
p{max-width:76ch}
a{transition:color .18s ease,background-color .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease}
button,input,select,textarea{font-family:inherit}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{
  outline:3px solid color-mix(in srgb,var(--ui-focus) 72%,transparent);
  outline-offset:3px;
}

/* Header / navegación */
.topbar,.top{
  border-bottom:1px solid rgba(234,215,181,.18) !important;
  box-shadow:0 4px 20px rgba(0,0,0,.08);
}
.topbar-inner,.topin{
  width:min(1240px,calc(100% - 32px)) !important;
  margin-inline:auto !important;
}
.topbar-inner{
  grid-template-columns:150px minmax(0,1fr) auto !important;
  gap:18px !important;
  padding:10px 0 !important;
}
.brand-logo-image{width:150px !important;height:auto !important;max-height:76px;object-fit:contain}
.site-nav,.nav{gap:3px !important;align-items:center !important}
.site-nav a,.nav a{
  font-size:14px !important;
  line-height:1.2 !important;
  font-weight:750 !important;
  letter-spacing:-.01em;
  padding:10px 12px !important;
  border-radius:10px !important;
}
.site-nav a:hover,.nav a:hover{background:rgba(234,215,181,.12) !important}
.site-nav a.active,.nav a.active{background:rgba(234,215,181,.14)}
.nav-actions{gap:8px !important}
.nav-actions a,.nav-actions button,.theme-toggle,.site-theme-toggle{
  min-height:40px !important;
  padding:9px 14px !important;
  border-radius:11px !important;
  font-size:13px !important;
  font-weight:800 !important;
}

/* Contenedores: menos ancho visual, mejor lectura */
main,.wrap,.container,.market-pro-page{width:min(1240px,calc(100% - 32px));margin-inline:auto}
.market-pro-page{padding:38px 0 76px !important}
.pro-hero{max-width:900px !important;padding:34px 0 38px !important}
.pro-hero h1{font-size:clamp(2.15rem,4.6vw,3.65rem) !important;line-height:1.08 !important;margin:.25rem 0 1rem !important}
.pro-hero p{font-size:1.08rem !important;line-height:1.7 !important;color:var(--ui-text-2)}
.pro-pillars{gap:18px !important;margin:0 0 20px !important}
.pro-pillar,.pro-choice-note,.pro-help,.pro-result,.pro-compare-insight,.pro-alert,.source-box,.pro-agro-compare{
  box-shadow:var(--ui-shadow) !important;
}
.pro-pillar{padding:25px !important;border-radius:18px !important}
.pro-pillar h2{font-size:1.4rem !important;margin:7px 0 8px !important}
.pro-pillar p{font-size:1rem !important;line-height:1.65 !important}
.pro-subnav{gap:8px !important;margin:0 0 28px !important;flex-wrap:wrap}
.pro-subnav a{font-size:14px !important;font-weight:800 !important;padding:10px 14px !important;border-radius:10px !important}

/* Cards, panels y módulos */
.card,.panel,.section-card,.box,.table-wrap,.note,.portal-group,.portal-card,.news-card,.agenda-card{
  border-radius:16px !important;
}
.card,.panel,.section-card,.box,.table-wrap{box-shadow:var(--ui-shadow)}
.card h2,.section h2{line-height:1.22 !important}
.card p,.section p,.note p{line-height:1.68 !important}

/* Formularios: etiquetas visibles y campos cómodos */
label{font-size:13px !important;font-weight:800 !important;letter-spacing:.01em}
input,select,textarea{
  min-height:46px !important;
  padding:11px 13px !important;
  border-radius:11px !important;
  font-size:16px !important;
}
button,.btn,a.btn{min-height:44px;font-weight:800}

/* Tablas */
table{font-size:15px !important}
th{font-weight:800 !important}
th,td{padding:11px 13px !important;line-height:1.45 !important}

/* Evitar textos diminutos */
small,.small,.muted,.eyebrow,.kicker,.pro-kicker,.crumbs,.foot{line-height:1.5}
.foot,.crumbs{font-size:13px !important}
.pro-kicker,.eyebrow{font-size:12px !important;letter-spacing:.08em !important}

/* Tema claro: superficies sólidas y contraste estable */
html[data-theme="light"] body{background:var(--ui-bg) !important;color:var(--ui-text) !important}
html[data-theme="light"] .card,html[data-theme="light"] .panel,html[data-theme="light"] .section-card,html[data-theme="light"] .box,html[data-theme="light"] .table-wrap,html[data-theme="light"] .pro-pillar{
  background:var(--ui-surface) !important;color:var(--ui-text) !important;border-color:var(--ui-line) !important;
}
html[data-theme="light"] p,html[data-theme="light"] .muted,html[data-theme="light"] small,html[data-theme="light"] .crumbs{color:var(--ui-muted)}
html[data-theme="light"] input,html[data-theme="light"] select,html[data-theme="light"] textarea{background:#fff !important;color:var(--ui-text) !important;border-color:#c9c9c0 !important}
html[data-theme="light"] .pro-result{background:#eef4ef !important;color:var(--ui-text) !important}

/* Tema oscuro: evitar verdes demasiado similares y transparencias */
html[data-theme="dark"] body{background:#0b1210 !important;color:#e9f1ec !important}
html[data-theme="dark"] .card,html[data-theme="dark"] .panel,html[data-theme="dark"] .section-card,html[data-theme="dark"] .box,html[data-theme="dark"] .table-wrap,html[data-theme="dark"] .pro-pillar{
  background:#17241e !important;color:#e9f1ec !important;border-color:#345044 !important;
}
html[data-theme="dark"] p,html[data-theme="dark"] .muted,html[data-theme="dark"] small,html[data-theme="dark"] .crumbs{color:#b7c7bf !important}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4,html[data-theme="dark"] .title{color:#f0f6f2 !important}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#0e1713 !important;color:#eef5f1 !important;border-color:#456255 !important}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#8fa198 !important}
html[data-theme="dark"] .pro-result{background:#1d3027 !important;color:#edf5f0 !important}
html[data-theme="dark"] .pro-help-grid>div,html[data-theme="dark"] .pro-help-formula{background:#101a15 !important;border-color:#355044 !important}
html[data-theme="dark"] table th{background:#203129 !important;color:#dce9e2 !important}
html[data-theme="dark"] table td{border-color:#30483d !important;color:#d8e6df !important}

/* Controles de tema */
.theme-toggle,.site-theme-toggle{box-shadow:0 8px 24px rgba(0,0,0,.18) !important}
.site-theme-toggle{right:18px !important;bottom:18px !important}

/* Homepage: lectura más editorial */
.hero h1{max-width:900px;line-height:1.05 !important}
.hero p{line-height:1.7 !important}
.portal-group-content{padding-top:8px}
.portal-group-title small{font-size:13px !important;line-height:1.45 !important}
.portal-group-links a,.portal-seo-links a{font-size:14px !important}

/* Respeta preferencias del sistema y reduce movimiento si se solicita */
@media (prefers-contrast:more){
  body{--ui-muted:#4d5b53}
  .card,.panel,.section-card,.box,.table-wrap,.pro-pillar{border-width:2px !important}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto !important;transition-duration:.001ms !important;animation-duration:.001ms !important;animation-iteration-count:1 !important}
}

@media (max-width:980px){
  .topbar-inner{grid-template-columns:140px minmax(0,1fr) !important}
  .nav-actions{grid-column:1/-1;justify-content:flex-end}
  .site-nav{justify-content:flex-start !important;overflow-x:auto;scrollbar-width:none}
  .site-nav::-webkit-scrollbar{display:none}
}
@media (max-width:760px){
  html{font-size:15.5px}
  main,.wrap,.container,.market-pro-page{width:min(100% - 24px,1240px)}
  .topbar-inner,.topin{width:calc(100% - 24px) !important}
  .topbar-inner{grid-template-columns:1fr !important;gap:8px !important}
  .brand-logo-image{width:138px !important}
  .site-nav{width:100%;padding-bottom:3px}
  .site-nav a,.nav a{font-size:13px !important;padding:9px 10px !important}
  .nav-actions{justify-content:flex-start;flex-wrap:wrap}
  .nav-actions a,.nav-actions button{font-size:12px !important}
  .pro-pillars{grid-template-columns:1fr !important}
  .pro-hero{padding:25px 0 28px !important}
  .pro-hero h1{font-size:clamp(2rem,10vw,2.8rem) !important}
  .pro-hero p{font-size:1rem !important}
  .pro-pillar{padding:20px !important}
  .site-theme-toggle{right:12px !important;bottom:12px !important}
}


/* V38 — panel principal: color por función + Herramientas */
.portal-group{
  border-width:1px !important;
  background:transparent !important;
  box-shadow:0 14px 34px rgba(20,38,29,.07) !important;
}
.portal-group>summary{
  min-height:82px;
  padding:18px 22px !important;
  border:1px solid transparent !important;
  transition:transform .18s ease,filter .18s ease,box-shadow .18s ease !important;
}
.portal-group>summary:hover{transform:translateY(-1px);filter:saturate(1.04)}
.portal-group-title{color:inherit !important}
.portal-group-title small{color:inherit !important;opacity:.78 !important;font-weight:650 !important}
.portal-group>summary:after{color:currentColor !important;opacity:.72}
.portal-group-content{border-left:1px solid transparent;border-right:1px solid transparent;border-bottom:1px solid transparent}

/* Claro: cada acceso tiene una identidad cromática suave, sin convertirlo en un arcoíris. */
html[data-theme="light"] .portal-group--market>summary,
html[data-theme="light"] #grupoMercado>summary{
  background:linear-gradient(110deg,#fff7df,#fffdf8) !important;color:#6f4a18 !important;border-color:#e7c77e !important;
}
html[data-theme="light"] #grupoClima>summary{
  background:linear-gradient(110deg,#e8f7f8,#f8fcfb) !important;color:#185f67 !important;border-color:#9dd5d8 !important;
}
html[data-theme="light"] #grupoActualidad>summary{
  background:linear-gradient(110deg,#f0ecfa,#fbf9ff) !important;color:#55417b !important;border-color:#c7b8e4 !important;
}
html[data-theme="light"] #grupoHerramientas>summary{
  background:linear-gradient(110deg,#e8f4ec,#f8fcf9) !important;color:#215d43 !important;border-color:#a9ceb9 !important;
}
html[data-theme="light"] #grupoLotes>summary{
  background:linear-gradient(110deg,#f7ece6,#fffaf7) !important;color:#7a3f2d !important;border-color:#dfb4a2 !important;
}
html[data-theme="light"] #grupoMercado .portal-group-content{background:#fffaf0 !important;border-color:#e7c77e !important}
html[data-theme="light"] #grupoClima .portal-group-content{background:#f2fbfb !important;border-color:#9dd5d8 !important}
html[data-theme="light"] #grupoActualidad .portal-group-content{background:#f8f6fc !important;border-color:#c7b8e4 !important}
html[data-theme="light"] #grupoHerramientas .portal-group-content{background:#f3faf5 !important;border-color:#a9ceb9 !important}
html[data-theme="light"] #grupoLotes .portal-group-content{background:#fcf5f1 !important;border-color:#dfb4a2 !important}

/* Oscuro: superficies profundas y acentos más luminosos para que no aparezcan tarjetas blancas. */
html[data-theme="dark"] .portal-group>summary{box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 10px 24px rgba(0,0,0,.16) !important}
html[data-theme="dark"] #grupoMercado>summary{background:linear-gradient(110deg,#302714,#1b1810) !important;color:#f4cf7c !important;border-color:#755d2d !important}
html[data-theme="dark"] #grupoClima>summary{background:linear-gradient(110deg,#12373b,#11211f) !important;color:#8bdde1 !important;border-color:#347c81 !important}
html[data-theme="dark"] #grupoActualidad>summary{background:linear-gradient(110deg,#2a2140,#181521) !important;color:#c9b4f2 !important;border-color:#65558c !important}
html[data-theme="dark"] #grupoHerramientas>summary{background:linear-gradient(110deg,#153c2b,#10231b) !important;color:#8fe0b5 !important;border-color:#397457 !important}
html[data-theme="dark"] #grupoLotes>summary{background:linear-gradient(110deg,#3a2119,#211714) !important;color:#f1b49e !important;border-color:#825443 !important}
html[data-theme="dark"] #grupoMercado .portal-group-content{background:#17140d !important;border-color:#755d2d !important}
html[data-theme="dark"] #grupoClima .portal-group-content{background:#0f2423 !important;border-color:#347c81 !important}
html[data-theme="dark"] #grupoActualidad .portal-group-content{background:#171321 !important;border-color:#65558c !important}
html[data-theme="dark"] #grupoHerramientas .portal-group-content{background:#0f2119 !important;border-color:#397457 !important}
html[data-theme="dark"] #grupoLotes .portal-group-content{background:#211612 !important;border-color:#825443 !important}

/* Tarjetas internas de Herramientas */
.homepage-tools-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.homepage-tool-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;min-height:92px;padding:16px 17px;border-radius:15px;text-decoration:none !important;border:1px solid;box-shadow:0 8px 22px rgba(20,38,29,.06);transition:transform .18s ease,box-shadow .18s ease,filter .18s ease}
.homepage-tool-card:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(20,38,29,.11);filter:saturate(1.05)}
.homepage-tool-card strong{display:block;font-size:15px;font-weight:850;line-height:1.25}
.homepage-tool-card small{display:block;margin-top:4px;font-size:12px;line-height:1.45;font-weight:650}
.homepage-tool-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;font-size:20px}
.homepage-tool-arrow{font-size:20px;font-weight:800;opacity:.7}
html[data-theme="light"] .homepage-tool-card{color:#20382c}
html[data-theme="light"] .homepage-tool-card--ganaderia{background:#edf7f0;border-color:#a9ceb9}
html[data-theme="light"] .homepage-tool-card--ganaderia .homepage-tool-icon{background:#d7ecdf}
html[data-theme="light"] .homepage-tool-card--agricultura{background:#f0f7e9;border-color:#bed19b}
html[data-theme="light"] .homepage-tool-card--agricultura .homepage-tool-icon{background:#deedc9}
html[data-theme="light"] .homepage-tool-card--mercado{background:#fff6df;border-color:#e5c57d}
html[data-theme="light"] .homepage-tool-card--mercado .homepage-tool-icon{background:#f5e4b6}
html[data-theme="dark"] .homepage-tool-card{color:#e9f4ee}
html[data-theme="dark"] .homepage-tool-card small{color:#b7c9bf}
html[data-theme="dark"] .homepage-tool-card--ganaderia{background:#132b20;border-color:#397457}
html[data-theme="dark"] .homepage-tool-card--ganaderia .homepage-tool-icon{background:#1d4935}
html[data-theme="dark"] .homepage-tool-card--agricultura{background:#202c15;border-color:#5c7640}
html[data-theme="dark"] .homepage-tool-card--agricultura .homepage-tool-icon{background:#354b22}
html[data-theme="dark"] .homepage-tool-card--mercado{background:#302714;border-color:#755d2d}
html[data-theme="dark"] .homepage-tool-card--mercado .homepage-tool-icon{background:#55451f}

@media(max-width:820px){.homepage-tools-grid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){
  .portal-group>summary{min-height:72px;padding:15px 16px !important}
  .homepage-tools-grid{grid-template-columns:1fr}
  .homepage-tool-card{min-height:82px}
}


/* V39 — arquitectura del inicio: cuatro dimensiones principales + Hacienda */
.portal-home-groups{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  align-items:start;
}
.portal-home-groups > .portal-group{margin:0 !important;min-width:0}
.portal-home-groups > #grupoLotes{grid-column:1 / -1}

/* En desktop mantenemos una lectura de dos columnas sin tocar el contenido funcional. */
@media (min-width:981px){
  .portal-home-groups > .portal-group > summary{min-height:86px}
}

/* V39 — móvil: las 4 dimensiones prioritarias quedan arriba en una grilla 2×2. */
@media (max-width:760px){
  .portal-home-groups{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .portal-home-groups > .portal-group > summary{min-height:88px;padding:14px 13px !important}
  .portal-home-groups > .portal-group .portal-group-title{font-size:15px;line-height:1.12}
  .portal-home-groups > .portal-group .portal-group-title small{font-size:10.5px;line-height:1.35;margin-top:4px}
  .portal-home-groups > #grupoLotes{grid-column:1 / -1}
}

/* V39 — encabezado móvil más compacto: marca + cuenta en una fila y navegación debajo. */
@media (max-width:760px){
  .topbar-inner,.topin{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
    gap:6px 10px !important;
    padding:7px 0 !important;
  }
  .topbar-inner > .brand,.topin > .brand{order:1;flex:0 0 auto}
  .topbar-inner > .nav-actions{order:2;margin-left:auto;flex:0 0 auto}
  .topbar-inner > .site-nav{order:3;flex:0 0 100%;width:100%;margin:0 !important;padding:2px 0 1px !important}
  .topin > .nav{order:3;flex:0 0 100%;width:100%;margin:0 !important;padding:2px 0 1px !important}
  .brand-logo-image{width:108px !important;max-height:52px !important}
  .brand-mark{width:38px;height:38px;flex-basis:38px}
  .brand-copy strong{font-size:15px}
  .brand-copy span{font-size:8px;letter-spacing:1.35px;margin-top:3px}
  .site-nav a,.nav a{font-size:12px !important;padding:7px 9px !important;white-space:nowrap}
  .nav-actions{gap:5px !important;flex-wrap:nowrap !important}
  .nav-actions a,.nav-actions button,.theme-toggle,.site-theme-toggle{min-height:34px !important;padding:7px 9px !important;font-size:11px !important}
}

/* V39 — botón flotante de tema menos invasivo en pantallas chicas. */
@media (max-width:560px){
  .site-theme-toggle{width:40px !important;height:40px !important;min-height:40px !important;padding:0 !important;right:10px !important;bottom:10px !important;border-radius:50% !important}
}



