/*
Theme Name:        THM Logistics
Theme URI:         https://thm.cl
Description:       Tema de bloques corporativo para THM Logistics. Portada "Muelle" con menú blanco, páginas institucionales, formularios propios (contacto y postulación), botón WhatsApp e integración visual con los plugins Calculadora de Transporte de Contenedores y Calculadora de Fletes 30T.
Version:           1.0.0
Requires at least: 6.4
Tested up to:      6.7
Requires PHP:      7.4
Text Domain:       thm
License:           GPL-2.0-or-later
*/

/* Lo que theme.json no cubre. */
:root{--thm-navy:#0b1f3a;--thm-deep:#071629;--thm-blue:#1d5fae;--thm-orange:#f18a00;--thm-line:#c9ced4;--thm-muted:#5d6268;--thm-ink-soft:#c3d0dd}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--thm-orange);outline-offset:2px}
.has-text-wrap-pretty,p{text-wrap:pretty}

/* Encabezado */
.thm-topbar a{color:inherit}.thm-topbar a:hover{color:var(--thm-orange)}
.thm-header{position:sticky;top:0;z-index:50}
.admin-bar .thm-header{top:32px}
@media (max-width:782px){.admin-bar .thm-header{top:46px}}
.thm-header .wp-block-navigation-item__content:hover,.thm-header .current-menu-item>.wp-block-navigation-item__content{color:var(--thm-blue)}
.thm-header .wp-block-navigation__responsive-container.is-menu-open{background:#fff;color:var(--thm-navy)}

/* Pestañas de la portada */
.thm-tabs{background:#fff;color:var(--thm-navy)}
.thm-tabs__nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.thm-tabs__nav button{all:unset;cursor:pointer;padding:16px 24px;font:700 17px/1.2 var(--wp--preset--font-family--condensed);letter-spacing:.08em;text-transform:uppercase;border-top:4px solid transparent;background:#eef1f5;color:var(--thm-muted);text-align:left}
.thm-tabs__nav button[aria-selected="true"]{background:#fff;color:var(--thm-navy);border-top-color:var(--thm-orange)}
.thm-tabs__nav button:hover{color:var(--thm-navy)}
.thm-tabs__nav button:focus-visible{outline:2px solid var(--thm-orange);outline-offset:-2px}
.thm-tabs__panel{padding:20px 24px 24px}
.thm-tabs__panel[hidden]{display:none}
.thm-tabs__row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;align-items:end}
.thm-tabs__panel p{margin:0 0 14px;color:var(--thm-muted);font-size:15px}
.thm-field{display:flex;flex-direction:column;gap:6px}
.thm-field>span{font:600 12px var(--wp--preset--font-family--condensed);letter-spacing:.12em;text-transform:uppercase;color:var(--thm-muted)}
.thm-field input,.thm-field select,.thm-field textarea{height:44px;padding:0 12px;border:1px solid var(--thm-line);border-radius:0;background:#fff;font:500 15px var(--wp--preset--font-family--body);color:var(--thm-navy);width:100%;box-sizing:border-box}
.thm-field textarea{height:auto;min-height:120px;padding:10px 12px;resize:vertical}
.thm-field input:hover,.thm-field select:hover,.thm-field textarea:hover{border-color:var(--thm-blue)}
.thm-btn{display:inline-flex;align-items:center;justify-content:center;height:46px;padding:0 22px;background:var(--thm-orange);color:var(--thm-navy)!important;border:0;border-radius:0;font:700 16px var(--wp--preset--font-family--condensed);letter-spacing:.1em;text-transform:uppercase;text-decoration:none;cursor:pointer;box-sizing:border-box}
.thm-btn:hover{background:#ffa733}.thm-btn:active{background:#d77a00}
.thm-btn--ghost{background:transparent;border:1px solid currentColor;color:inherit!important}
.thm-btn--ghost:hover{background:rgba(241,138,0,.12)}
.thm-btn--navy{background:var(--thm-navy);color:#fff!important}.thm-btn--navy:hover{background:var(--thm-blue)}

/* Tarjetas de servicio */
.thm-card{transition:border-color .2s}
.thm-card:hover{border-color:var(--thm-orange)!important}

/* Contadores */
.thm-count{font-variant-numeric:tabular-nums}

/* Clientes */
.thm-clients .wp-block-image img{filter:grayscale(1) brightness(1.6);opacity:.75;transition:filter .2s,opacity .2s}
.thm-clients .wp-block-image:hover img{filter:none;opacity:1}

/* Mapas */
.thm-map iframe{display:block;width:100%;height:280px;border:0;filter:grayscale(.4)}

/* Formularios propios */
.thm-form{display:grid;gap:16px}
.thm-form .thm-grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.thm-form .thm-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
.thm-form small{color:var(--thm-muted)}
.thm-notice{padding:12px 16px;border:1px solid;font-size:15px}
.thm-notice--ok{border-color:#1e6b3a;color:#1e6b3a;background:#eef7f1}
.thm-notice--err{border-color:#a8322d;color:#a8322d;background:#fbf1f0}

/* WhatsApp flotante */
.thm-wa{position:fixed;right:24px;bottom:24px;z-index:90;display:inline-flex;align-items:center;gap:10px;padding:14px 20px;border-radius:999px;background:#25d366;color:#071629!important;font:700 15px var(--wp--preset--font-family--condensed);letter-spacing:.08em;text-transform:uppercase;text-decoration:none;box-shadow:0 10px 30px rgba(7,22,41,.3)}
.thm-wa:hover{background:#3be07a}
.thm-wa svg{width:22px;height:22px}

/* Cotizador: selector entre calculadoras */
.thm-quote-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--thm-line);max-width:720px}
.thm-quote-switch button{all:unset;cursor:pointer;padding:18px 22px;background:#fff;border-top:4px solid transparent}
.thm-quote-switch button+button{border-left:1px solid var(--thm-line)}
.thm-quote-switch button strong{display:block;font:700 20px var(--wp--preset--font-family--condensed);text-transform:uppercase;letter-spacing:.04em;color:var(--thm-navy)}
.thm-quote-switch button span{font-size:14px;color:var(--thm-muted)}
.thm-quote-switch button[aria-selected="true"]{border-top-color:var(--thm-orange);background:#f3f5f8}
.thm-quote-switch button:focus-visible{outline:2px solid var(--thm-orange);outline-offset:-2px}
.thm-quote-panel[hidden]{display:none}
.thm-missing{padding:20px;border:1px dashed var(--thm-line);color:var(--thm-muted)}

/* Integración visual con los plugins de calculadora (variables propias de cada plugin) */
.ctc-wrap{--n9:#0b1f3a;--ac:#1d5fae;--ac6:#174d8e;--ac7:#123d71;--ac9:#071629;--ac1:#e8eef6;--bg:#f3f5f8;max-width:none;margin:0}
.ctc-wrap .ctc-print{background:var(--thm-orange);color:var(--thm-navy)}
.ctc-wrap .ctc-print:hover{background:#ffa733}
.ctc-wrap .ctc-total-v{color:var(--thm-orange)}
.lcf{--tx:#0b1f3a;--ac:#1d5fae;--ac6:#174d8e;--ac7:#123d71;--ac1:#e8eef6;--bg:#f3f5f8;max-width:none;margin:0}
.lcf .lcf-btn{background:var(--thm-orange);color:var(--thm-navy)}
.lcf .lcf-btn:hover{background:#ffa733}

@media (max-width:781px){
  .thm-tabs__nav button{padding:12px 10px;font-size:14px}
  .thm-quote-switch{grid-template-columns:1fr}
  .thm-quote-switch button+button{border-left:0;border-top:1px solid var(--thm-line)}
  .thm-wa span{display:none}.thm-wa{padding:14px}
}

/* Impresión de cotización: solo la calculadora */
@media print{
  .thm-topbar,.thm-header,.thm-footer,.thm-wa,.thm-page-hero,.thm-quote-switch,.thm-quote-intro{display:none!important}
  body{background:#fff!important}
  .thm-quote-panel[hidden]{display:none!important}
}
