/* ==========================================================================
   Omnia_DeliveryEstimate — Stili pagina prodotto
   Personalizzabile via CSS custom properties sul selettore radice:
     --omnia-accent       colore principale (verde)
     --omnia-green-bg     sfondo badge / accenti verdi chiari
     --omnia-green-fg     testo su sfondi verdi chiari
     --omnia-urgent-bg    sfondo badge urgenza
     --omnia-urgent-fg    testo badge urgenza
   ========================================================================== */

.omnia-delivery-estimate {
    --omnia-accent:     #0F6E56;
    --omnia-green-bg:   #E1F5EE;
    --omnia-green-fg:   #085041;
    --omnia-urgent-bg:  #FCEBEB;
    --omnia-urgent-fg:  #791F1F;

    margin: 14px 0;
    line-height: 1.5;
}

/* ── Riga principale ─────────────────────────────────────────────────────── */
.omnia-delivery-estimate__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
}

.omnia-delivery-estimate__icon {
    display: inline-flex;
    align-items: center;
    color: var(--omnia-accent);
    flex-shrink: 0;
}

.omnia-delivery-estimate__prefix {
    font-size: 13px;
    color: #888;
}

.omnia-delivery-estimate__label {
    font-weight: 500;
    color: inherit;
}

/* ── Pulsante info ───────────────────────────────────────────────────────── */
.omnia-delivery-estimate__info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: transparent;
    color: #999;
    font-size: 10px;
    font-weight: 600;
    font-family: sans-serif;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}

.omnia-delivery-estimate__info-btn:hover,
.omnia-delivery-estimate__info-btn:focus {
    border-color: #666;
    color: #444;
    outline: none;
}

/* ── Badge countdown ─────────────────────────────────────────────────────── */
.omnia-delivery-estimate__countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12.5px;
    background: var(--omnia-green-bg);
    color: var(--omnia-green-fg);
    transition: background 0.3s, color 0.3s;
}

.omnia-delivery-estimate__countdown-badge--urgent {
    background: var(--omnia-urgent-bg);
    color: var(--omnia-urgent-fg);
}

.omnia-delivery-estimate__countdown-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.omnia-delivery-estimate__countdown-timer {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

/* ── Overlay modale ──────────────────────────────────────────────────────── */
.omnia-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: omnia-fade-in 0.15s ease;
}

.omnia-modal-overlay[hidden] {
    display: none !important;
}

body.omnia-modal-open {
    overflow: hidden;
}

@keyframes omnia-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Box modale ──────────────────────────────────────────────────────────── */
.omnia-modal {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 26px 26px 22px;
    max-width: 390px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    animation: omnia-slide-up 0.2s ease;
}

@keyframes omnia-slide-up {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Tasto chiudi ────────────────────────────────────────────────────────── */
.omnia-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #bbb;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.omnia-modal__close:hover,
.omnia-modal__close:focus {
    color: #555;
    background: #f0f0f0;
    outline: none;
}

/* ── Titolo ──────────────────────────────────────────────────────────────── */
.omnia-modal__title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    padding-right: 26px;
}

/* ── Card riepilogo (da Variante C) ─────────────────────────────────────── */
.omnia-modal__summary {
    display: flex;
    align-items: center;
    gap: 13px;
    background: var(--omnia-green-bg, #E1F5EE);
    border-radius: 10px;
    padding: 13px 15px;
    margin-bottom: 20px;
}

.omnia-modal__summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #fff;
    color: var(--omnia-accent, #0F6E56);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.omnia-modal__summary-label {
    font-size: 11px;
    color: #3a7a60;
    font-weight: 500;
    margin-bottom: 3px;
}

.omnia-modal__summary-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--omnia-green-fg, #085041);
}

/* ── Timeline (da Variante B) ───────────────────────────────────────────── */
.omnia-modal__timeline {
    display: flex;
    flex-direction: column;
    position: relative;
}

.omnia-modal__tl-step {
    display: flex;
    gap: 13px;
    position: relative;
}

.omnia-modal__tl-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: -2px;
    width: 1.5px;
    background: #d8ede6;
}

.omnia-modal__tl-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--omnia-green-bg, #E1F5EE);
    color: var(--omnia-accent, #0F6E56);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.omnia-modal__tl-dot--done {
    background: var(--omnia-accent, #0F6E56);
    color: #fff;
}

.omnia-modal__tl-body {
    padding-bottom: 16px;
    flex: 1;
}

.omnia-modal__tl-step:last-child .omnia-modal__tl-body {
    padding-bottom: 0;
}

.omnia-modal__tl-label {
    font-size: 10.5px;
    color: #aaa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.omnia-modal__tl-value {
    font-size: 13.5px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
}

.omnia-modal__tl-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    line-height: 1.5;
}

.omnia-modal__tl-desc strong {
    color: #1a1a1a;
    font-weight: 500;
}

.omnia-modal__tl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--omnia-green-bg, #E1F5EE);
    color: var(--omnia-green-fg, #085041);
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 5px;
}

/* ── Nota aggiuntiva ─────────────────────────────────────────────────────── */
.omnia-modal__note {
    margin-top: 16px;
    padding: 10px 12px;
    background: #f6f6f6;
    border-radius: 8px;
    font-size: 12px;
    color: #777;
    line-height: 1.6;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .omnia-modal {
        padding: 22px 18px 20px;
        border-radius: 12px;
    }
    .omnia-modal__title {
        font-size: 15px;
    }
}

/* ── Placeholder loader (mostrato mentre AJAX carica il widget) ────────── */
.omnia-de-wrap {
    margin: 14px 0;
    min-height: 28px;
    display: flex;
    align-items: center;
}

.omnia-de-loader {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 4px 0;
}

.omnia-de-loader span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d0d0d0;
    animation: omnia-loader-pulse 1.2s ease-in-out infinite;
}

.omnia-de-loader span:nth-child(2) { animation-delay: 0.2s; }
.omnia-de-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes omnia-loader-pulse {
    0%, 80%, 100% { transform: scale(0.65); opacity: 0.35; }
    40%            { transform: scale(1);    opacity: 1; }
}

/* ── Banner checkout (sotto logo, sopra i passi) ────────────────────────── */
.omnia-checkout-banner {
    text-align: center;
    padding: 14px 16px 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #efefef;
}

/* Il loader è già centrato da flex, ma nel banner serve inline */
.omnia-checkout-banner .omnia-de-wrap,
.omnia-checkout-banner .omnia-de-loading {
    display: inline-flex;
    justify-content: center;
}

/* Il widget renderizzato dal JS perde il wrapper — lo centra tramite il genitore */
.omnia-checkout-banner .omnia-delivery-estimate {
    display: inline-block;
    margin: 0;
}

.omnia-checkout-banner .omnia-delivery-estimate__row {
    justify-content: center;
}

.omnia-checkout-banner .omnia-delivery-estimate__countdown-badge {
    justify-content: center;
}
