/* ==========================================================================
   Código postal: búsqueda de cobertura (campo del encabezado, botón móvil y hoja inferior)
   ========================================================================== */

/* ---------- Campo del encabezado (escritorio) ---------- */
.zip.is-ok { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(61,220,132,.18); }
.zip.is-ok .zip__label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: var(--ok); font-weight: 700; }
.zip__go:disabled { cursor: default; opacity: .85; }
.zip.is-busy .zip__go { background: #14486F; }

/* ---------- Tarjeta de resultado ---------- */
.zipres { position: absolute; top: calc(100% + 14px); right: 0; z-index: 80; width: min(370px, calc(100vw - 24px)); }
.zipres[hidden] { display: none; }
.zipres::before { content: ""; position: absolute; top: -7px; right: 64px; width: 14px; height: 14px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--panel); transform: rotate(45deg); z-index: 1; }

.zr { position: relative; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 30px 70px -20px rgba(0,0,0,.85); animation: zrIn .38s cubic-bezier(.2,1.3,.3,1); }
.zr--ok { border-color: rgba(61,220,132,.6); box-shadow: 0 30px 70px -20px rgba(0,0,0,.85), 0 0 0 3px rgba(61,220,132,.12); }
.zr--err { border-color: var(--red-hot); }
@keyframes zrIn { from { opacity: 0; transform: translateY(-8px) scale(.96); } }

.zr__t { display: block; font-size: 17px; font-weight: 800; line-height: 1.2; }
.zr__c { display: block; margin-top: 3px; font-size: 14px; line-height: 1.4; color: var(--mute); }
.zr__c strong { color: #fff; font-weight: 700; }
.zr--ok .zr__t { color: var(--ok); }
.zr--err .zr__t { color: #FFB3C0; }

/* Buscando: radar con un pin */
.zr--busy { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; }
.zr__radar { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.zr__radar svg { position: relative; width: 26px; height: 26px; color: var(--red-hot); animation: pinBob .6s ease-in-out infinite alternate; }
.zr__radar i { position: absolute; inset: 0; border: 2px solid var(--blue); border-radius: 50%; opacity: 0; animation: radar 1.5s ease-out infinite; }
.zr__radar i:nth-child(2) { animation-delay: .5s; }
.zr__radar i:nth-child(3) { animation-delay: 1s; }
@keyframes radar { 0% { transform: scale(.25); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
@keyframes pinBob { to { transform: translateY(-5px); } }
.zr__bar { display: block; height: 5px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #0D1B31; }
.zr__bar i { display: block; width: 100%; height: 100%; border-radius: inherit; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--blue), var(--ok)); animation: zbar var(--dur, 1500ms) cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes zbar { to { transform: scaleX(1); } }

/* Encontrado: el check se dibuja */
.zr__top { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: center; }
.zr__check svg { display: block; width: 52px; height: 52px; fill: none; stroke: var(--ok); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.zr__check circle { fill: rgba(61,220,132,.14); stroke-dasharray: 151; stroke-dashoffset: 151; animation: zdraw .55s ease-out forwards; }
.zr__check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: zdraw .4s ease-out .45s forwards; }
@keyframes zdraw { to { stroke-dashoffset: 0; } }

.zr__list { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.zr__list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; animation: zli .4s ease-out calc(.5s + var(--i, 0) * .09s) both; }
.zr__list svg { flex: none; width: 20px; height: 20px; color: var(--blue); }
@keyframes zli { from { opacity: 0; transform: translateX(-8px); } }
.zr__act { display: grid; gap: 8px; justify-items: start; margin-top: 12px; }
.zr__chg { padding: 0; border: 0; background: none; font-size: 13.5px; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.zr__chg:hover { color: #fff; }

/* ---------- Botón del encabezado (móvil) ---------- */
.zipbtn { display: none; align-items: center; gap: 7px; height: 40px; padding: 0 13px 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--bone); font-size: 14px; font-weight: 700; white-space: nowrap; }
.zipbtn svg { flex: none; width: 18px; height: 18px; color: var(--red-hot); }
.zipbtn.is-ok { border-color: rgba(61,220,132,.7); }
.zipbtn.is-ok svg { color: var(--ok); }
.zipbtn.is-busy svg { animation: pinBob .5s ease-in-out infinite alternate; }

/* ---------- Hoja inferior (móvil) ---------- */
.zs { position: relative; display: grid; gap: 14px; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
.zs__x { position: absolute; top: 14px; right: 14px; }
.zs h2 { padding-right: 56px; font-size: 34px; line-height: .92; font-weight: 900; font-style: italic; font-stretch: 62%; text-transform: uppercase; }
.zs__sub { font-size: 15px; line-height: 1.4; color: var(--mute); }
.zs__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.zs__form input { width: 100%; height: 56px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--ink); outline: none; font-size: 20px; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.zs__form input::placeholder { font-size: 16px; font-weight: 500; letter-spacing: 0; color: #5F7694; }
.zs__form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,144,226,.25); }
.zs__form .btn { height: 56px; padding: 0 22px; }
.zs__out:empty { display: none; }
.zs .zr { box-shadow: none; }
.zs .zr__act { justify-items: stretch; }
.zs .zr__chg { justify-self: center; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .zipbtn { display: inline-flex; margin-left: auto; }
  .top .dchip, .top .cartbtn { margin-left: 0; }
  .top.has-chip .zipbtn__t { display: none; }
  .top.has-chip .zipbtn { padding: 0 11px; }
}
@media (max-width: 359px) {
  .brand__word { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .zr__radar i, .zr__radar svg, .zipbtn.is-busy svg { animation: none !important; }
  .zr__bar i { animation-duration: .01ms !important; }
}
