/* Shipping Preview Widget — prefijo .spw- */

.spw-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    width: 600px;
    transform: translateY(120px);
    opacity: 0;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    pointer-events: none;
}
.spw-container.spw-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }

/* ── Card ── */
.spw-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    overflow: hidden;
    max-height: 680px;
    display: flex;
    flex-direction: column;
}
.spw-loading .spw-header { border-radius: 12px; }

/* ── Header ── */
.spw-header {
    background: #E85A00;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    gap: 12px;
    flex-shrink: 0;
}
.spw-header-text { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.spw-close {
    background: none; border: none; color: #fff;
    font-size: 1.8rem; line-height: 1; cursor: pointer;
    padding: 0 4px; opacity: .85; transition: opacity .15s;
}
.spw-close:hover { opacity: 1; }

/* ── Body ── */
.spw-body { overflow-y: auto; padding: 20px 24px; font-size: 1.05rem; color: #222; flex: 1; }

.spw-section-title {
    font-size: .9rem; font-weight: 700; color: #888;
    text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 10px;
}
.spw-section-title:first-child { margin-top: 0; }

/* ── Opción ── */
.spw-option { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f3f3f3; }
.spw-option:last-of-type { border-bottom: none; }
.spw-option-icon { font-size: 1.6rem; flex-shrink: 0; }
.spw-option-info { flex: 1; min-width: 0; }
.spw-option-label { font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spw-option-eta { font-size: .9rem; color: #666; margin-top: 3px; }
.spw-option-price { font-weight: 700; font-size: 1.05rem; white-space: nowrap; color: #1a1a1a; }
.spw-free { color: #27ae60; }

/* ── Pickup ── */
.spw-pickup-point { padding: 6px 0; border-bottom: 1px solid #f3f3f3; }
.spw-pickup-point:last-child { border-bottom: none; }
.spw-pickup-name { font-weight: 600; font-size: .82rem; }
.spw-pickup-address, .spw-pickup-hours { font-size: .73rem; color: #666; margin-top: 1px; }
.spw-empty { color: #999; font-size: .8rem; padding: 6px 0; }

/* ── Selector de comuna ── */
.spw-ask-text { font-size: .82rem; color: #444; margin: 0 0 8px; }
.spw-select {
    width: 100%; padding: 7px 10px; border: 1px solid #ddd;
    border-radius: 7px; font-size: .82rem; color: #222;
    background: #fff; margin-bottom: 8px; cursor: pointer; appearance: auto;
}
.spw-select:focus { outline: 2px solid #E85A00; border-color: #E85A00; }
.spw-btn {
    width: 100%; background: #E85A00; color: #fff; border: none;
    border-radius: 7px; padding: 9px; font-size: .84rem;
    font-weight: 700; cursor: pointer; transition: background .15s;
}
.spw-btn:hover { background: #cf4e00; }

/* Loading */
.spw-card.spw-loading-data { opacity: .6; pointer-events: none; }

/* ── Chip minimizado — GRANDE ── */
@keyframes spw-float {
    0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 8px 30px rgba(232,90,0,.45); }
    50%       { transform: translateY(-7px) scale(1.01); box-shadow: 0 16px 40px rgba(232,90,0,.55); }
}

.spw-chip {
    display: none !important;
    width: fit-content !important;
    margin-right: auto !important;
    border-radius: 20px !important;
    background: #E85A00 !important;
    border: none !important;
    color: #fff !important;
    font-size: 2.0rem !important;
    font-weight: 700 !important;
    padding: 28px 40px !important;
    cursor: pointer !important;
    text-align: center !important;
    letter-spacing: .01em !important;
    white-space: nowrap !important;
    box-shadow: 0 8px 30px rgba(232,90,0,.45) !important;
    animation: spw-float 2.8s ease-in-out infinite !important;
}
.spw-chip:hover {
    background: #cf4e00;
    animation-play-state: paused;
    transform: scale(1.02);
    transition: transform .15s, background .15s;
}

/* Minimizado */
.spw-container.spw-minimized .spw-card { display: none; }
.spw-container.spw-minimized .spw-chip { display: block !important; }
.spw-container.spw-minimized { transform: translateY(0) !important; opacity: 1 !important; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .spw-container { bottom: 0; right: 0; left: 0; width: 100%; transform: translateY(100%); }
    .spw-container.spw-visible { transform: translateY(0); }
    .spw-card { border-radius: 14px 14px 0 0; max-height: 60vh; }
    .spw-container.spw-minimized { bottom: 0; height: auto; }
    .spw-container.spw-minimized .spw-chip {
        border-radius: 14px 14px 0 0; display: block;
        position: static; width: 100%; font-size: 1.8rem; padding: 18px 24px;
    }
}

/* ── Cambiar comuna ── */
.spw-change-commune {
    display: block; text-align: center;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: .85rem; color: #E85A00; cursor: pointer;
    background: none; border-left: none; border-right: none; border-bottom: none;
    width: 100%; font-weight: 600;
    text-decoration: underline; text-underline-offset: 3px;
}
.spw-change-commune:hover { color: #cf4e00; }

/* ── Disclaimer referencial ── */
.spw-disclaimer {
    margin: 12px 0 4px;
    padding: 6px 10px;
    background: #fff8f0;
    border-left: 3px solid #E85A00;
    border-radius: 4px;
    font-size: .78rem;
    color: #888;
    line-height: 1.4;
}
