/* =============================================================================
   LQE Frontend Styles — logistics-query-engine  v1.2
   All shortcodes: fully responsive, no overflow on any viewport.
   box-sizing scoped to plugin elements only (no theme interference).
============================================================================= */
.rhqe-widget *,.rhqe-card *,.rhqe-modal *,.rhqe-cs-results *{ box-sizing:border-box; }

:root{
  --rhqe-primary:#0f766e; --rhqe-accent:#14b8a6; --rhqe-green:#16a34a;
  --rhqe-wa:#25d366; --rhqe-bg:#f8fafc; --rhqe-surface:#fff;
  --rhqe-border:#e2e8f0; --rhqe-text:#1e293b; --rhqe-muted:#64748b;
  --rhqe-radius:12px; --rhqe-shadow:0 4px 20px rgba(0,0,0,.09);
  --rhqe-shadow-lg:0 12px 40px rgba(0,0,0,.14); --rhqe-t:.22s ease;
}

/* ── Widget container ─────────────────────────────────────────── */
.rhqe-widget{
  background:var(--rhqe-surface); border-radius:var(--rhqe-radius);
  box-shadow:var(--rhqe-shadow); padding:clamp(14px,4vw,30px);
  width:100%; max-width:100%; position:relative; overflow:hidden;
}
.rhqe-widget-header{ margin-bottom:20px; }
.rhqe-widget-header h3{
  font-size:clamp(17px,4vw,22px); font-weight:800; color:var(--rhqe-text);
  margin:0 0 6px; line-height:1.25;
}
.rhqe-widget-sub{ color:var(--rhqe-muted); font-size:14px; margin:0; line-height:1.5; }

/* ── Search form ──────────────────────────────────────────────── */
.rhqe-search-form{
  display:grid;
  grid-template-columns:1fr;
  gap:14px 16px;
  align-items:start;
}
.rhqe-field-group{
  display:flex; flex-direction:column; gap:6px;
  width:100%; min-width:0;
}
/* Full-width rows */
.rhqe-field-volume,
.rhqe-field-quantity,
.rhqe-field-mode,
.rhqe-weight-notice,
.rhqe-vol-missing-notice,
.rhqe-btn-query{ grid-column:1 / -1; }
.rhqe-field-label{
  font-size:11px; font-weight:700; color:var(--rhqe-muted);
  text-transform:uppercase; letter-spacing:.5px; white-space:nowrap;
}
.rhqe-country-select,.rhqe-weight-input{
  width:100%; max-width:100%; padding:11px 12px; border:1.5px solid var(--rhqe-border);
  border-radius:8px; font-size:15px; color:var(--rhqe-text);
  background:#fff; font-family:inherit; min-width:0;
  transition:border-color var(--rhqe-t),box-shadow var(--rhqe-t);
  /* Prevent native select from expanding beyond container */
  overflow:hidden; text-overflow:ellipsis;
}
.rhqe-country-select:focus,.rhqe-weight-input:focus{
  outline:none; border-color:var(--rhqe-accent);
  box-shadow:0 0 0 3px rgba(20,184,166,.15);
}
.rhqe-field-mode{ width:100%; }
.rhqe-mode-tabs{ display:flex; gap:6px; flex-wrap:wrap; }
.rhqe-mode-btn{
  padding:7px 13px; border:1.5px solid var(--rhqe-border); border-radius:20px;
  background:#fff; font-size:13px; font-weight:600; cursor:pointer;
  color:var(--rhqe-muted); transition:all var(--rhqe-t); white-space:nowrap;
}
.rhqe-mode-btn.active,.rhqe-mode-btn:hover{
  background:var(--rhqe-primary); color:#fff; border-color:var(--rhqe-primary);
}

/* ── Query button ─────────────────────────────────────────────── */
.rhqe-btn-query{
  width:100%; padding:12px 20px;
  background:linear-gradient(90deg,var(--rhqe-primary),var(--rhqe-accent));
  color:#fff; border:none; border-radius:8px; font-size:16px; font-weight:700;
  cursor:pointer; transition:opacity var(--rhqe-t),transform var(--rhqe-t);
  white-space:nowrap; text-align:center;
}
.rhqe-btn-query:hover{ opacity:.9; transform:translateY(-1px); }
.rhqe-btn-query:disabled{ opacity:.6; cursor:not-allowed; transform:none; }

/* ── Results area ─────────────────────────────────────────────── */
.rhqe-results-wrap{
  margin-top:22px; border-top:2px solid var(--rhqe-border);
  padding-top:18px; overflow:hidden;
}
.rhqe-results-header{
  display:flex; align-items:flex-start; justify-content:space-between;
  flex-wrap:wrap; gap:8px; margin-bottom:14px;
}
.rhqe-results-header h4{ font-size:16px; font-weight:700; margin:0; color:var(--rhqe-text); }
.rhqe-results-meta{ font-size:13px; color:var(--rhqe-muted); }
.rhqe-results-cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(200px,100%),1fr));
  gap:12px;
}

/* ── Result card ──────────────────────────────────────────────── */
.rhqe-result-card{
  background:#f8fafc; border:1.5px solid var(--rhqe-border); border-radius:10px;
  padding:14px; display:flex; flex-direction:column; gap:6px;
  min-width:0; word-break:break-word;
  transition:box-shadow var(--rhqe-t),border-color var(--rhqe-t),transform var(--rhqe-t);
  cursor:pointer; position:relative;
}
.rhqe-result-card:hover{ box-shadow:var(--rhqe-shadow-lg,0 8px 24px rgba(0,0,0,.12)); border-color:#5eead4; transform:translateY(-2px); }
.rhqe-result-top{
  border-color:var(--rhqe-green); background:#f0fdf4;
  box-shadow:0 0 0 2px rgba(22,163,74,.15);
}
.rhqe-rc-head{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:4px; }
.rhqe-rc-mode{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--rhqe-muted); }
.rhqe-best-badge{ background:var(--rhqe-green); color:#fff; font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px; white-space:nowrap; }
.rhqe-rc-service{ font-weight:700; font-size:14px; color:var(--rhqe-text); }
.rhqe-rc-dest{ font-size:12px; color:var(--rhqe-muted); }
.rhqe-rc-price{ font-size:clamp(14px,3.5vw,18px); font-weight:800; color:var(--rhqe-primary); }
.rhqe-rc-total{ font-size:13px; color:var(--rhqe-text); }
.rhqe-rc-updated{ font-size:11px; color:#94a3b8; }
.rhqe-saving{ font-size:11px; color:var(--rhqe-muted); display:block; }
.rhqe-vol{ font-size:11px; background:#e0f2fe; color:#0369a1; padding:1px 6px; border-radius:6px; font-weight:600; }
.rhqe-res-link{ font-size:12px; color:var(--rhqe-accent); text-decoration:none; }
.rhqe-res-link:hover{ text-decoration:underline; }

/* ── WhatsApp row ─────────────────────────────────────────────── */
.rhqe-wa-row{ margin-top:16px; }
.rhqe-wa-card{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:#f0fdf4; border:1.5px solid #86efac; border-radius:10px; padding:14px 16px;
}
.rhqe-wa-title{ font-weight:700; color:#14532d; font-size:14px; flex:1 1 auto; }
.rhqe-wa-agent{ font-size:13px; color:#166534; flex:1 1 100%; margin-top:-4px; }
.rhqe-btn-wa{
  display:inline-flex; align-items:center; gap:8px; background:var(--rhqe-wa);
  color:#fff!important; padding:10px 18px; border-radius:8px; font-weight:700;
  font-size:14px; text-decoration:none; transition:opacity var(--rhqe-t); white-space:nowrap;
}
.rhqe-btn-wa:hover{ opacity:.88; }

/* ── Error / empty states ─────────────────────────────────────── */
.rhqe-no-results,.rhqe-error-msg{
  padding:16px; text-align:center; color:var(--rhqe-muted);
  background:#fff7ed; border-radius:8px; border:1px solid #fdba74;
  font-size:14px; line-height:1.5;
}
.rhqe-on-req{ color:var(--rhqe-muted); font-size:13px; font-style:italic; }
.rhqe-error{ color:#dc2626; font-style:italic; font-size:13px; }
.rhqe-err{ color:#dc2626; font-size:13px; }

/* ── Share Modal ──────────────────────────────────────────────── */
.rhqe-modal{
  position:fixed; inset:0; z-index:999999; background:rgba(0,0,0,.50);
  display:flex; align-items:center; justify-content:center;
  padding:16px; overflow-y:auto;
}
.rhqe-modal-box{
  background:#fff; border-radius:16px; padding:clamp(20px,5vw,36px);
  width:100%; max-width:480px; box-shadow:var(--rhqe-shadow-lg);
  animation:rhqe-pop .28s cubic-bezier(.34,1.56,.64,1); position:relative;
}
@keyframes rhqe-pop{ from{transform:scale(.85);opacity:0} to{transform:scale(1);opacity:1} }
.rhqe-modal-box h3{ font-size:clamp(17px,4vw,22px); font-weight:800; margin:0 0 10px; line-height:1.25; color:#1e293b; }
.rhqe-modal-box p{ font-size:14px; color:#64748b; line-height:1.65; margin:0 0 10px; }
.rhqe-modal-box{ color:#1e293b; }
.rhqe-share-bonus{
  background:#fefce8; border:1px solid #fde68a; padding:12px 14px;
  border-radius:8px; font-size:13px; margin:12px 0; line-height:1.55;
  color:#1e293b;
}
.rhqe-modal-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
.rhqe-btn-share{
  flex:1 1 auto; padding:10px 14px; border:none; border-radius:8px;
  font-weight:700; font-size:13px; cursor:pointer; background:var(--rhqe-primary);
  color:#fff; transition:opacity var(--rhqe-t); text-align:center; white-space:nowrap;
}
.rhqe-btn-share-wa{ background:var(--rhqe-wa); }
.rhqe-btn-share:hover{ opacity:.88; }
.rhqe-btn-secondary{ background:#e0f2fe; color:#0c4a6e; }
.rhqe-btn-skip{
  flex:1 1 100%; background:none; border:1px solid var(--rhqe-border);
  color:var(--rhqe-muted); padding:9px 14px; border-radius:8px; font-size:13px;
  cursor:pointer; transition:background var(--rhqe-t); text-align:center;
}
.rhqe-btn-skip:hover{ background:#f1f5f9; }

/* ── [rhqe_card] single channel card ──────────────────────────── */
.rhqe-card{
  background:var(--rhqe-surface); border:1.5px solid var(--rhqe-border);
  border-radius:var(--rhqe-radius); padding:clamp(14px,4vw,22px);
  box-shadow:var(--rhqe-shadow); width:100%; max-width:420px;
  overflow:hidden; word-break:break-word;
}
.rhqe-card-head{
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:6px; margin-bottom:4px;
}
.rhqe-card-country{ font-weight:800; font-size:clamp(14px,3.5vw,17px); color:var(--rhqe-text); }
.rhqe-mode-tag{
  font-size:11px; font-weight:700; text-transform:uppercase;
  padding:2px 9px; border-radius:10px; color:#fff; white-space:nowrap;
}
.rhqe-mode-tag.rhqe-mode-air  { background:#0d9488; }
.rhqe-mode-tag.rhqe-mode-sea  { background:#0891b2; }
.rhqe-mode-tag.rhqe-mode-rail { background:#7c3aed; }
.rhqe-mode-tag.rhqe-mode-truck{ background:#92400e; }
.rhqe-card-service{ font-size:13px; color:var(--rhqe-muted); margin-bottom:12px; }
.rhqe-card-rates{ border-top:1px solid var(--rhqe-border); padding-top:10px; margin-bottom:14px; }
.rhqe-rate-row{
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:4px; padding:5px 0; border-bottom:1px dashed #f1f5f9;
}
.rhqe-rate-row:last-child{ border-bottom:none; }
.rhqe-rate-bracket{ font-size:12px; color:var(--rhqe-muted); }
.rhqe-rate-price strong{ color:var(--rhqe-primary); font-size:15px; font-weight:700; }
.rhqe-card-calc{ background:#f8fafc; border-radius:8px; padding:12px; }
.rhqe-card-calc-row{ display:flex; gap:8px; margin-top:6px; }
.rhqe-card-weight{
  flex:1 1 80px; min-width:0; padding:9px 12px; border:1.5px solid var(--rhqe-border);
  border-radius:7px; font-size:14px; font-family:inherit;
}
.rhqe-card-btn-calc{
  flex:0 0 auto; padding:9px 14px; background:var(--rhqe-primary); color:#fff;
  border:none; border-radius:7px; font-weight:700; font-size:13px;
  cursor:pointer; transition:opacity var(--rhqe-t); white-space:nowrap;
}
.rhqe-card-btn-calc:hover{ opacity:.88; }
.rhqe-card-result{ margin-top:10px; font-size:14px; }
.rhqe-calc-result{ display:flex; flex-direction:column; gap:3px; }
.rhqe-calc-unit{ color:var(--rhqe-muted); font-size:12px; }
.rhqe-calc-total strong{ color:var(--rhqe-primary); font-size:clamp(15px,4vw,18px); }
.rhqe-card-footer{
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:4px; margin-top:12px; font-size:11px; color:#94a3b8;
}
.rhqe-contact-us{ color:var(--rhqe-muted); font-size:12px; font-style:italic; }
.rhqe-vol-note{ font-size:11px; background:#e0f2fe; color:#0369a1; padding:1px 6px; border-radius:6px; font-weight:600; }

/* ── Pre-populated results (req #4) ──────────────────────────── */
.rhqe-prepop-wrap{
  background:#f0fdfa; border:1px solid #99f6e4; border-radius:8px;
  padding:12px 14px; margin-bottom:12px;
}
.rhqe-prepop-label{ font-size:11px; font-weight:700; color:var(--rhqe-muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:8px; }
.rhqe-prepop-grid{ display:flex; flex-wrap:wrap; gap:8px; }
.rhqe-prepop-item{ background:#fff; border-radius:7px; padding:8px 12px; border:1px solid #99f6e4; min-width:0; }
.rhqe-prepop-bracket{ font-size:11px; color:var(--rhqe-muted); }
.rhqe-prepop-price{ font-size:16px; font-weight:800; color:var(--rhqe-primary); }
.rhqe-prepop-note{ font-size:11px; color:#94a3b8; }

/* ── [rhqe_country_search] results ────────────────────────────── */
.rhqe-cs-results{
  margin-top:16px; display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(190px,100%),1fr));
  gap:12px; overflow:hidden;
}
.rhqe-cs-card{
  background:#fff; border:1.5px solid var(--rhqe-border); border-radius:10px;
  padding:14px; min-width:0; word-break:break-word;
}
.rhqe-cs-mode{ font-size:11px; font-weight:700; color:var(--rhqe-muted); text-transform:uppercase; }
.rhqe-cs-service{ font-weight:700; font-size:14px; color:var(--rhqe-text); margin:4px 0; }
.rhqe-cs-price{ font-size:clamp(14px,3.5vw,16px); font-weight:800; color:var(--rhqe-primary); }
.rhqe-cs-total{ font-size:12px; color:var(--rhqe-muted); }
.rhqe-cs-link{ font-size:12px; color:var(--rhqe-accent); text-decoration:none; margin-top:6px; display:inline-block; }
.rhqe-cs-wa{ grid-column:1/-1; }
.rhqe-no-res{ color:var(--rhqe-muted); text-align:center; padding:20px; }

/* ── Admin ────────────────────────────────────────────────────── */
.rhqe-admin-wrap{ max-width:1200px; }
.rhqe-stat-row{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:28px; }
.rhqe-stat{ background:#fff; border:1px solid var(--rhqe-border); border-radius:10px; padding:18px 22px; text-align:center; flex:1 1 120px; }
.rhqe-stat span{ display:block; font-size:clamp(24px,5vw,36px); font-weight:800; color:var(--rhqe-primary); line-height:1; }
.rhqe-agent-form{ background:#fff; border:1px solid var(--rhqe-border); border-radius:10px; padding:22px; max-width:800px; margin-bottom:28px; }
.rhqe-form-row{ display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
.rhqe-form-row label{ display:flex; flex-direction:column; gap:5px; font-size:13px; font-weight:500; }
.rhqe-form-row input,.rhqe-form-row select{ width:100%; padding:9px 12px; border:1.5px solid var(--rhqe-border); border-radius:7px; font-size:14px; font-family:inherit; }
.rhqe-toggle{ position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.rhqe-toggle input{ opacity:0; width:0; height:0; }
.rhqe-toggle-slider{ position:absolute; inset:0; background:#cbd5e1; border-radius:24px; cursor:pointer; transition:background var(--rhqe-t); }
.rhqe-toggle-slider::before{ content:''; position:absolute; width:18px; height:18px; border-radius:50%; background:#fff; left:3px; top:3px; transition:transform var(--rhqe-t); box-shadow:0 1px 4px rgba(0,0,0,.2); }
.rhqe-toggle input:checked+.rhqe-toggle-slider{ background:var(--rhqe-green); }
.rhqe-toggle-grey input:checked+.rhqe-toggle-slider{ background:#64748b; }
.rhqe-toggle input:checked+.rhqe-toggle-slider::before{ transform:translateX(20px); }

/* ── Responsive ───────────────────────────────────────────────── */
/* Tablet/desktop: tidy two-column grid (Country|Weight, Volume, Boxes, Mode, button) */
@media(min-width:600px){
  .rhqe-search-form{ grid-template-columns:1fr 1fr; }
  .rhqe-btn-query{ justify-self:end; width:auto; min-width:220px; }
}
@media(min-width:900px){
  .rhqe-search-form{ gap:16px 20px; }
}
@media(max-width:479px){
  .rhqe-widget{ padding:14px; }
  .rhqe-card{ max-width:100%; }
  .rhqe-search-form{ grid-template-columns:1fr; gap:12px; }
  .rhqe-btn-query{ width:100%; min-width:0; justify-self:stretch; }
  .rhqe-results-cards,.rhqe-cs-results{ grid-template-columns:1fr; }
  .rhqe-modal{ padding:0; align-items:flex-end; }
  .rhqe-modal-box{ border-radius:16px 16px 0 0; max-width:100%; }
  .rhqe-modal-actions{ flex-direction:column; }
  .rhqe-btn-share{ flex:1 1 100%; }
  .rhqe-wa-card{ flex-direction:column; align-items:flex-start; }
  .rhqe-stat-row{ flex-direction:column; }
  .rhqe-form-row{ grid-template-columns:1fr; }
  .rhqe-card-calc-row{ flex-direction:column; }
  .rhqe-card-weight,.rhqe-card-btn-calc{ width:100%; }
  .rhqe-prepop-grid{ flex-direction:column; }
}
.rhqe-card-detail-link{
  display:block; text-align:center; background:var(--rhqe-primary); color:#fff!important;
  text-decoration:none; padding:9px; border-radius:7px; font-size:13px; font-weight:600;
  margin-top:8px; transition:opacity var(--rhqe-t);
}
.rhqe-card-detail-link:hover{ opacity:.88; }
/* ── Per-mode result card styles ─────────────────────────── */
.rhqe-rc-mode-badge{
  display:inline-flex;align-items:center;gap:4px;
  color:#fff;font-size:11px;font-weight:700;padding:3px 9px;
  border-radius:12px;letter-spacing:.04em;
}
.rhqe-rc-detail-btn{
  display:block;text-align:center;
  background:var(--rhqe-primary);color:#fff!important;
  text-decoration:none;padding:9px 14px;border-radius:8px;
  font-size:13px;font-weight:700;margin-top:8px;
  transition:opacity var(--rhqe-t);
}
.rhqe-rc-detail-btn:hover{opacity:.88;}
.rhqe-region-link-wrap{
  margin:10px 0;text-align:center;
}
.rhqe-region-link{
  display:inline-flex;align-items:center;gap:6px;
  color:var(--rhqe-accent);font-size:13px;font-weight:600;
  text-decoration:none;padding:6px 14px;
  border:1px solid var(--rhqe-border);border-radius:20px;
  transition:all var(--rhqe-t);background:#fff;
}
.rhqe-region-link:hover{background:var(--rhqe-primary);color:#fff;border-color:var(--rhqe-primary);}
.rhqe-region-link-bottom{margin-top:14px;}
.rhqe-result-card[role="link"]:focus{outline:2px solid var(--rhqe-accent);outline-offset:2px;}

/* ══ Volumetric weight input row ═══════════════════════════════ */
.rhqe-field-volume { }
.rhqe-vol-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rhqe-vol-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1.5px solid var(--rhqe-border);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  color: var(--rhqe-text);
  background: #fff;
  transition: border-color var(--rhqe-t);
}
.rhqe-vol-row input:focus {
  outline: none;
  border-color: var(--rhqe-accent);
}
.rhqe-vol-sep {
  font-size: 14px;
  color: var(--rhqe-muted);
  font-weight: 700;
  flex-shrink: 0;
}
.rhqe-vol-hint {
  font-size: 11px;
  color: var(--rhqe-muted);
  margin-top: 5px;
  line-height: 1.4;
}
/* Weight notice (shown after query with chargeable weight) */
.rhqe-weight-notice {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  color: #0f766e;
  margin-top: 4px;
}
/* Card volume input row */
.rhqe-card-vol-row {
  margin-top: 8px;
}
.rhqe-card-vol-row .rhqe-vol-row input {
  padding: 7px 8px;
  font-size: 13px;
}
/* Calc result vol note */
.rhqe-calc-vol {
  display: block;
  font-size: 11px;
  color: var(--rhqe-muted);
  margin-top: 5px;
}
/* Responsive volume row */
@media (max-width: 480px) {
  .rhqe-vol-row { flex-wrap: wrap; }
  .rhqe-vol-row input { flex: 1 1 60px; }
}

/* ── Volume missing notice ──────────────────────────────────── */
.rhqe-vol-missing-notice {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 3px solid #f59e0b;
  border-radius: 7px;
  padding: 9px 13px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.5;
  transition: opacity .3s ease;
}
.rhqe-vol-missing-notice.rhqe-vol-notice-hidden {
  display: none;
}

/* ── Result card disclaimer ─────────────────────────────────── */
.rhqe-rc-disclaimer {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.45;
  border-top: 1px solid #f1f5f9;
  margin-top: 8px;
  padding-top: 6px;
}

/* ── Box quantity field ─────────────────────────────────────── */
.rhqe-field-quantity .rhqe-qty-input,
.rhqe-card-qty-row .rhqe-card-qty {
  width: 160px;
  padding: 9px 12px;
  border: 1.5px solid var(--rhqe-border, #e2e8f0);
  border-radius: 8px;
  font-size: 15px;
  color: var(--rhqe-text, #1e293b);
  background: var(--rhqe-input-bg, #fff);
  transition: border-color .2s;
}
.rhqe-field-quantity .rhqe-qty-input:focus,
.rhqe-card-qty-row .rhqe-card-qty:focus {
  outline: none;
  border-color: var(--rhqe-primary, #14b8a6);
  box-shadow: 0 0 0 3px rgba(20,184,166,.12);
}
.rhqe-card-qty-row {
  margin-top: 8px;
}
