/* ==========================================================================
   Seguimiento de envíos — rediseño limpio y funcional
   Marca SendBox: rojo #e61804, oscuro #1e252b, tipografía Nunito.
   Scope: todo bajo .sg-section para no filtrar estilos al resto del tema.
   ========================================================================== */

.sg-section,
.sg-section *,
.sg-section *::before,
.sg-section *::after {
    box-sizing: border-box;
}

.sg-section {
    --sg-red: #e61804;
    --sg-red-dark: #c21403;
    --sg-ink: #1e252b;
    --sg-muted: #6b7280;
    --sg-line: #e6e8eb;
    --sg-bg: #f6f7f9;
    --sg-card: #ffffff;
    --sg-green: #0a9d54;
    --sg-amber: #d97706;
    --sg-blue: #1473f7;

    max-width: 1160px;
    margin: 0 auto;
    padding: clamp(1.5625rem, 5vw, 2.8125rem) clamp(0.78125rem, 4vw, 1.5625rem) clamp(1.875rem, 6vw, 3.125rem);
    color: var(--sg-ink);
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- Hero ---------------------------------------------------------------- */

.sg-hero {
    text-align: center;
    margin-bottom: clamp(1.25rem, 4vw, 2.03125rem);
}

.sg-hero-title {
    font-size: clamp(1.25rem, 4.4vw, 1.875rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--sg-ink);
    margin: 0 0 0.375rem;
    text-wrap: balance;
}

.sg-hero-sub {
    font-size: clamp(0.75rem, 1.8vw, 0.9375rem);
    color: var(--sg-muted);
    margin: 0;
}

/* ---- Grid ---------------------------------------------------------------- */

.sg-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(0.9375rem, 3vw, 1.5625rem);
    align-items: start;
}

/* ---- Etiqueta de referencia --------------------------------------------- */

.sg-ref {
    position: sticky;
    top: 0.9375rem;
    background: var(--sg-card);
    border: 1px solid var(--sg-line);
    border-radius: 20px;
    padding: clamp(0.625rem, 2vw, 1.09375rem);
    box-shadow: 0 18px 40px -28px rgba(30, 37, 43, 0.45);
}

.sg-ref-img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    border-radius: 12px;
}

.sg-ref-cap {
    margin: 0.6875rem 0 0;
    font-size: 0.6375rem;
    line-height: 1.5;
    color: var(--sg-muted);
    text-align: center;
}

.sg-ref-cap strong { color: var(--sg-ink); font-weight: 700; }

/* ---- Panel derecho ------------------------------------------------------- */

.sg-panel { min-width: 0; }

/* ---- Formulario ---------------------------------------------------------- */

.sg-form {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0.6875rem;
    background: var(--sg-card);
    border: 1px solid var(--sg-line);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 18px 40px -30px rgba(30, 37, 43, 0.4);
}

.sg-field { display: flex; flex-direction: column; min-width: 0; }

.sg-field label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--sg-muted);
    margin-bottom: 0.3125rem;
}

.sg-input {
    width: 100%;
    height: 64px;
    padding: 0 0.6875rem;
    font-size: 0.90625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--sg-ink);
    background: #fff;
    border: 1.5px solid var(--sg-line);
    border-radius: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -moz-appearance: textfield;
}

.sg-input::placeholder { color: #b6bcc4; font-weight: 600; letter-spacing: 0.04em; }

.sg-input:focus {
    outline: none;
    border-color: var(--sg-red);
    box-shadow: 0 0 0 4px rgba(230, 24, 4, 0.12);
}

.sg-input.input-error {
    border-color: var(--sg-red);
    box-shadow: 0 0 0 4px rgba(230, 24, 4, 0.14);
}

.sg-btn {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 56px;
    margin-top: 0.21875rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    background: var(--sg-red);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
    box-shadow: 0 12px 24px -12px rgba(230, 24, 4, 0.7);
}

.sg-btn:hover { background: var(--sg-red-dark); }
.sg-btn:active { transform: translateY(1px); }
.sg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(230, 24, 4, 0.28); }
.sg-btn .hidden { display: none; }

/* ---- Título del panel ---------------------------------------------------- */

.sg-panel-title {
    display: flex;
    align-items: center;
    gap: 0.53125rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--sg-ink);
    margin: 1.25rem 0 0.625rem;
}

.sg-panel-title::after {
    content: "";
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--sg-red), transparent);
    border-radius: 2px;
}

/* ---- Contenedor de resultado -------------------------------------------- */

.sg-result { min-height: 120px; }

/* Placeholder / vacío / carga */
.sg-placeholder,
.sg-empty,
.sg-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.375rem;
    padding: 1.40625rem 0.78125rem;
    background: var(--sg-bg);
    border: 1px dashed var(--sg-line);
    border-radius: 16px;
    color: var(--sg-muted);
}

.sg-placeholder i,
.sg-empty i { font-size: 1.0625rem; color: #c3c8cf; }
.sg-placeholder p,
.sg-empty p { margin: 0; font-weight: 700; color: var(--sg-ink); }
.sg-empty span { font-size: 0.5625rem; }

.sg-loading { flex-direction: row; border-style: solid; color: var(--sg-ink); font-weight: 700; }
.sg-loading i { color: var(--sg-red); font-size: 0.8125rem; }

/* ---- Tarjeta de resultado ----------------------------------------------- */

.sg-card {
    background: var(--sg-card);
    border: 1px solid var(--sg-line);
    border-radius: 18px;
    padding: clamp(0.78125rem, 2.5vw, 1.09375rem);
    box-shadow: 0 22px 50px -34px rgba(30, 37, 43, 0.5);
    animation: sg-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes sg-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero de estado: el estado es el protagonista de la tarjeta. */
.sg-status-hero {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.71875rem 0.78125rem;
    border-radius: 14px;
    background: var(--sg-hero-bg, rgba(107, 114, 128, 0.1));
}

.sg-status-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    flex: none;
    border-radius: 50%;
    font-size: 1.875rem;
    color: #fff;
    background: var(--sg-hero-color, var(--sg-muted));
    box-shadow: 0 12px 24px -8px var(--sg-hero-color, var(--sg-muted));
}

.sg-status-body { min-width: 0; }

.sg-status-eyebrow {
    display: block;
    font-size: 0.53125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sg-hero-color, var(--sg-muted));
    margin-bottom: 0.15625rem;
}

.sg-status-name {
    display: block;
    font-size: clamp(1rem, 2.8vw, 1.25rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--sg-ink);
    text-wrap: balance;
}

.sg-status-detail {
    margin: 0.78125rem 0 0;
    font-size: 0.78125rem;
    line-height: 1.55;
    color: #3b444d;
}

/* Paletas por estado (fondo del hero + color del ícono/eyebrow) */
.sg-card.is-entregado { --sg-hero-bg: rgba(10, 157, 84, 0.1); --sg-hero-color: var(--sg-green); }
.sg-card.is-retiro { --sg-hero-bg: rgba(230, 24, 4, 0.09); --sg-hero-color: var(--sg-red); }
.sg-card.is-transito { --sg-hero-bg: rgba(217, 119, 6, 0.12); --sg-hero-color: var(--sg-amber); }
.sg-card.is-cancelado { --sg-hero-bg: rgba(107, 114, 128, 0.14); --sg-hero-color: #52606d; }
.sg-card.is-pendiente { --sg-hero-bg: rgba(107, 114, 128, 0.1); --sg-hero-color: #52606d; }

/* Meta (destinatario + fecha) al pie de la tarjeta */
.sg-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0.8125rem;
    padding-top: 0.71875rem;
    border-top: 1px solid var(--sg-line);
}

.sg-meta-label {
    display: block;
    font-size: 0.53125rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sg-muted);
    margin-bottom: 0.1875rem;
}

.sg-meta-value {
    margin: 0;
    font-size: 0.78125rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--sg-ink);
}

.sg-card-date { text-align: right; }
.sg-card-date strong {
    font-size: 0.78125rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--sg-ink);
}

/* ---- Bloque de punto (solo "Disponible para retiro") -------------------- */

.sg-punto {
    margin-top: 0.9375rem;
    padding-top: 0.84375rem;
    border-top: 1px solid var(--sg-line);
}

.sg-punto-title {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    margin: 0 0 0.5625rem;
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--sg-ink);
}
.sg-punto-title i { color: var(--sg-red); }

.sg-punto-list { margin: 0; display: grid; gap: 0.0625rem; }

.sg-punto-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.625rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--sg-line);
}
.sg-punto-row:last-child { border-bottom: none; }

.sg-punto-row dt {
    font-size: 0.59375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--sg-muted);
}
.sg-punto-row dd { margin: 0; font-size: 0.7375rem; font-weight: 600; color: var(--sg-ink); line-height: 1.4; }

.sg-punto-row.is-importe {
    margin-top: 0.25rem;
    padding: 0.53125rem 0.625rem;
    background: rgba(230, 24, 4, 0.06);
    border: 1px solid rgba(230, 24, 4, 0.18);
    border-radius: 12px;
    align-items: center;
}
.sg-punto-row.is-importe dt { color: var(--sg-red); }
.sg-punto-row.is-importe dd { font-size: 0.9375rem; font-weight: 800; color: var(--sg-red); font-variant-numeric: tabular-nums; }

/* ---- Tarjeta WhatsApp ---------------------------------------------------- */

/* Banner horizontal a ancho completo. La repartidora sobresale por el borde
   superior (overflow visible + margen superior para que la gorra asome). */
.sg-wsp {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2.1875rem;
    padding: 1.40625rem clamp(5.625rem, 30%, 13.75rem) 1.40625rem 1.40625rem;
    min-height: 172px;
    background: linear-gradient(135deg, #ef2410 0%, #d3140b 100%);
    border-radius: 30px;
    overflow: visible;
    box-shadow: 0 24px 50px -28px rgba(230, 24, 4, 0.75);
}

.sg-wsp-content {
    position: relative;
    z-index: 2;
    margin: 0 auto;
    max-width: 44ch;
    text-align: center;
}

.sg-wsp-copy {
    margin: 0 0 0.84375rem;
    font-size: clamp(0.9375rem, 2.3vw, 1.21875rem);
    line-height: 1.45;
    font-weight: 700;
    color: #fff;
}
.sg-wsp-copy strong { font-weight: 800; white-space: nowrap; }

.sg-wsp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.0625rem;
    background: #fff;
    color: #c21403;
    font-size: 0.71875rem;
    font-weight: 800;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s ease, box-shadow 0.18s ease;
}
.sg-wsp-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(0, 0, 0, 0.55); }
.sg-wsp-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.sg-wsp-btn-icon {
    width: 1.5em !important;
    height: 1.5em !important;
    max-width: none !important;
    flex: none;
    fill: #25d366;
}

/* Anclada abajo-derecha y más alta que el banner: la cabeza/gorra asoma por
   el borde superior sobre el fondo blanco de la página. */
.sg-wsp-img {
    position: absolute !important;
    right: clamp(0.625rem, 3%, 1.875rem);
    bottom: 0 !important;
    top: auto !important;
    height: 128% !important;
    width: auto !important;
    max-width: 34% !important;
    max-height: none !important;
    object-fit: contain;
    object-position: bottom right;
    pointer-events: none;
    z-index: 1;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.2));
}

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 900px) {
    .sg-grid { grid-template-columns: 1fr; }
    .sg-ref { position: static; order: 2; max-width: 460px; margin: 0 auto; width: 100%; }
    .sg-panel { order: 1; }
}

@media (max-width: 520px) {
    .sg-form { grid-template-columns: 1fr; }
    .sg-card-meta { flex-direction: column; }
    .sg-card-date { text-align: left; }
    .sg-punto-row { grid-template-columns: 1fr; gap: 0.09375rem; }
    .sg-wsp {
        margin-top: 1.875rem;
        min-height: 150px;
        padding: 1rem 40% 1rem 0.9375rem;
    }
    .sg-wsp-content { text-align: left; }
    .sg-wsp-copy { margin: 0 0 0.625rem; font-size: 0.75rem; }
    .sg-wsp-btn { font-size: 0.625rem; padding: 0.46875rem 0.8125rem; }
    .sg-wsp-img { height: 130%; max-width: 40%; right: 0.25rem; }
}

/* Pantallas muy chicas: la foto pierde protagonismo antes que romper el texto. */
@media (max-width: 360px) {
    .sg-wsp { padding-right: 34%; }
    .sg-wsp-img { max-width: 36%; opacity: 0.94; }
}

@media (prefers-reduced-motion: reduce) {
    .sg-card { animation: none; }
}

/* =========================================================================
   Blindaje contra Elementor / tema Hello.
   Sus reglas (.elementor button/input) le ganan por especificidad a las
   clases sueltas, así que acá subimos la especificidad (.sg-section + clase)
   y forzamos las propiedades que el builder tiende a pisar (fondo del botón,
   bordes, alturas, line-height). Valores iguales en desktop y mobile.
   ========================================================================= */

.sg-section .sg-btn {
    display: inline-flex !important;
    width: 100% !important;
    height: 56px !important;
    padding: 0 0.9375rem !important;
    color: #fff !important;
    background: var(--sg-red) !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 0.71875rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
}
.sg-section .sg-btn:hover { background: var(--sg-red-dark) !important; }

.sg-section .sg-input {
    width: 100% !important;
    height: 60px !important;
    padding: 0 0.6875rem !important;
    color: var(--sg-ink) !important;
    background: #fff !important;
    border: 1.5px solid var(--sg-line) !important;
    border-radius: 12px !important;
    font-size: 0.8125rem !important;
    line-height: normal !important;
}
.sg-section .sg-input:focus { border-color: var(--sg-red) !important; }
.sg-section .sg-input.input-error { border-color: var(--sg-red) !important; }

/* ---- Escala tipográfica (intermedia) + blindaje de headings vs Elementor ---- */
.sg-section .sg-hero-title { font-size: clamp(1.125rem, 3.6vw, 1.625rem) !important; margin-bottom: 0.34375rem !important; }
.sg-section .sg-hero-sub { font-size: clamp(0.6875rem, 1.5vw, 0.8125rem) !important; }
.sg-section .sg-field label { font-size: 0.5625rem !important; }
.sg-section .sg-panel-title { font-size: 0.71875rem !important; }
.sg-section .sg-status-icon { width: 68px !important; height: 68px !important; font-size: 1.5625rem !important; }
.sg-section .sg-status-eyebrow { font-size: 0.5rem !important; }
.sg-section .sg-status-name { font-size: clamp(0.90625rem, 2.3vw, 1.09375rem) !important; }
.sg-section .sg-status-detail { font-size: 0.71875rem !important; }
.sg-section .sg-meta-label { font-size: 0.5rem !important; }
.sg-section .sg-meta-value { font-size: 0.71875rem !important; }
.sg-section .sg-card-date strong { font-size: 0.71875rem !important; }
.sg-section .sg-punto-title { font-size: 0.65625rem !important; }
.sg-section .sg-punto-row dt { font-size: 0.55rem !important; }
.sg-section .sg-punto-row dd { font-size: 0.675rem !important; }
.sg-section .sg-punto-row.is-importe dd { font-size: 0.875rem !important; }
.sg-section .sg-ref-cap { font-size: 0.625rem !important; }
.sg-section .sg-wsp-copy { font-size: clamp(0.8125rem, 1.8vw, 0.95625rem) !important; line-height: 1.5 !important; }
.sg-section .sg-wsp-btn { font-size: 0.78125rem !important; padding: 0.53125rem 1.0625rem !important; text-decoration: none !important; }

/* =========================================================================
   Modo landing: la URL trae ?z= y ?g= (link armado por un sistema externo).
   Sin buscador ni etiqueta de referencia: el envío ya viene identificado.

   Acá el estado es el único contenido, así que la escala sube respecto de
   /seguimiento —donde el módulo comparte el ancho con el formulario y la
   etiqueta— y la tarjeta y el banner comparten el mismo ancho para que no
   queden desalineados.
   ========================================================================= */

.sg-section.is-landing .sg-grid,
.sg-section.is-landing .sg-wsp {
    max-width: 53.75rem;      /* 860px */
    margin-inline: auto;
}

.sg-section.is-landing .sg-grid {
    grid-template-columns: 1fr;
}

.sg-hero-guia {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--sg-muted);
    font-variant-numeric: tabular-nums;
}
.sg-hero-guia strong {
    color: var(--sg-ink);
    font-weight: 800;
    letter-spacing: 0.03em;
}

.sg-form-wrap[hidden] { display: none !important; }

/* --- Escala propia de la landing (gana por especificidad del blindaje) --- */

.sg-section.is-landing .sg-panel-title    { font-size: 0.875rem !important; }
.sg-section.is-landing .sg-status-eyebrow { font-size: 0.65625rem !important; }
.sg-section.is-landing .sg-status-name    { font-size: 1.625rem !important; }
.sg-section.is-landing .sg-status-detail  { font-size: 0.9375rem !important; }
.sg-section.is-landing .sg-meta-label     { font-size: 0.65625rem !important; }
.sg-section.is-landing .sg-meta-value     { font-size: 0.9375rem !important; }
.sg-section.is-landing .sg-card-date strong { font-size: 0.9375rem !important; }

.sg-section.is-landing .sg-status-icon {
    width: 4.25rem !important;
    height: 4.25rem !important;
    font-size: 2rem !important;
}

.sg-otro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 1.1rem auto 0;
    padding: 0.6rem 1.2rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--sg-red);
    background: #fff;
    border: 1.5px solid var(--sg-line);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.sg-otro:hover { border-color: var(--sg-red); background: rgba(230, 24, 4, 0.05); }
.sg-otro:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(230, 24, 4, 0.2); }

/* Blindaje del botón secundario frente a los estilos de button de Elementor */
.sg-section .sg-otro {
    width: auto !important;
    height: auto !important;
    color: var(--sg-red) !important;
    background: #fff !important;
    border: 1.5px solid var(--sg-line) !important;
    border-radius: 999px !important;
    font-size: 0.8125rem !important;
    text-transform: none !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
}
.sg-section .sg-otro:hover { border-color: var(--sg-red) !important; background: rgba(230, 24, 4, 0.05) !important; }

/* En mobile el banner comparte ancho con la repartidora: el tamaño grande de
   desktop no entra. Se baja acá con la misma especificidad del blindaje para
   poder ganarle al !important de la escala. */
@media (max-width: 520px) {
    .sg-section .sg-wsp { padding-right: 38% !important; }
    .sg-section .sg-wsp-copy { font-size: 0.65625rem !important; }
    .sg-section .sg-wsp-btn { font-size: 0.59375rem !important; padding: 0.4375rem 0.75rem !important; }
}
