/* ==========================================================================
   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(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(3rem, 6vw, 5rem);
    color: var(--sg-ink);
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

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

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

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

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

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

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

.sg-ref {
    position: sticky;
    top: 1.5rem;
    background: var(--sg-card);
    border: 1px solid var(--sg-line);
    border-radius: 20px;
    padding: clamp(1rem, 2vw, 1.75rem);
    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: 1.1rem 0 0;
    font-size: 1.02rem;
    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: 1.1rem;
    background: var(--sg-card);
    border: 1px solid var(--sg-line);
    border-radius: 18px;
    padding: 1.6rem;
    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: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--sg-muted);
    margin-bottom: 0.5rem;
}

.sg-input {
    width: 100%;
    height: 64px;
    padding: 0 1.1rem;
    font-size: 1.45rem;
    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.6rem;
    height: 56px;
    margin-top: 0.35rem;
    font-family: inherit;
    font-size: 1.2rem;
    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.85rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--sg-ink);
    margin: 2rem 0 1rem;
}

.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.6rem;
    padding: 2.25rem 1.25rem;
    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.7rem; color: #c3c8cf; }
.sg-placeholder p,
.sg-empty p { margin: 0; font-weight: 700; color: var(--sg-ink); }
.sg-empty span { font-size: 0.9rem; }

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

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

.sg-card {
    background: var(--sg-card);
    border: 1px solid var(--sg-line);
    border-radius: 18px;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    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: 1rem;
    padding: 1.15rem 1.25rem;
    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: 3rem;
    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.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sg-hero-color, var(--sg-muted));
    margin-bottom: 0.25rem;
}

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

.sg-status-detail {
    margin: 1.25rem 0 0;
    font-size: 1.25rem;
    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: 1rem;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 1.3rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--sg-line);
}

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

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

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

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

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

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

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

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

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

.sg-punto-row.is-importe {
    margin-top: 0.4rem;
    padding: 0.85rem 1rem;
    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: 1.5rem; 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: 3.5rem;
    padding: 2.25rem clamp(9rem, 30%, 22rem) 2.25rem 2.25rem;
    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 1.35rem;
    font-size: clamp(1.5rem, 2.3vw, 1.95rem);
    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.6rem;
    padding: 0.9rem 1.7rem;
    background: #fff;
    color: #c21403;
    font-size: 1.15rem;
    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(1rem, 3%, 3rem);
    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.15rem; }
    .sg-wsp {
        margin-top: 3rem;
        min-height: 150px;
        padding: 1.6rem 40% 1.6rem 1.5rem;
    }
    .sg-wsp-content { text-align: left; }
    .sg-wsp-copy { margin: 0 0 1rem; font-size: 1.2rem; }
    .sg-wsp-btn { font-size: 1rem; padding: 0.75rem 1.3rem; }
    .sg-wsp-img { height: 130%; max-width: 40%; right: 0.4rem; }
}

/* 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 1.5rem !important;
    color: #fff !important;
    background: var(--sg-red) !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 1.15rem !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 1.1rem !important;
    color: var(--sg-ink) !important;
    background: #fff !important;
    border: 1.5px solid var(--sg-line) !important;
    border-radius: 12px !important;
    font-size: 1.3rem !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.8rem, 3.6vw, 2.6rem) !important; margin-bottom: 0.55rem !important; }
.sg-section .sg-hero-sub { font-size: clamp(1.1rem, 1.5vw, 1.3rem) !important; }
.sg-section .sg-field label { font-size: 0.9rem !important; }
.sg-section .sg-panel-title { font-size: 1.15rem !important; }
.sg-section .sg-status-icon { width: 68px !important; height: 68px !important; font-size: 2.5rem !important; }
.sg-section .sg-status-eyebrow { font-size: 0.8rem !important; }
.sg-section .sg-status-name { font-size: clamp(1.45rem, 2.3vw, 1.75rem) !important; }
.sg-section .sg-status-detail { font-size: 1.15rem !important; }
.sg-section .sg-meta-label { font-size: 0.8rem !important; }
.sg-section .sg-meta-value { font-size: 1.15rem !important; }
.sg-section .sg-card-date strong { font-size: 1.15rem !important; }
.sg-section .sg-punto-title { font-size: 1.05rem !important; }
.sg-section .sg-punto-row dt { font-size: 0.88rem !important; }
.sg-section .sg-punto-row dd { font-size: 1.08rem !important; }
.sg-section .sg-punto-row.is-importe dd { font-size: 1.4rem !important; }
.sg-section .sg-ref-cap { font-size: 1rem !important; }
.sg-section .sg-wsp-copy { font-size: clamp(1.05rem, 1.4vw, 1.28rem) !important; line-height: 1.5 !important; }
.sg-section .sg-wsp-btn { font-size: 1rem !important; padding: 0.75rem 1.5rem !important; }
