/* ============================================================
   Delivery Location Widget — "Deliver to [ZIP]"
   Dark-theme, matches the existing WheelFront header palette.
   ============================================================ */

/* ---- Trigger button ---- */
.wf-deliver-to-widget {
    display: inline-flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.wf-deliver-to-trigger {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 0 16px !important;
    border-radius: 12px !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 14px !important;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
    line-height: 1.2 !important;
    min-width: 120px !important;
    max-width: 150px !important;
    height: 46px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.wf-deliver-to-trigger:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px) !important;
}

.wf-dt-icon {
    flex-shrink: 0 !important;
    width: 20px !important;
    height: 20px !important;
    opacity: 0.85 !important;
    display: block !important;
}

.wf-dt-label {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
}

.wf-dt-prefix {
    font-size: 10px !important;
    text-transform: none !important;
    letter-spacing: 0.05em !important;
    opacity: 0.6 !important;
    font-weight: 600 !important;
    display: block !important;
}

.wf-dt-value {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #fff !important;
    max-width: 70px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
}

.wf-dt-chevron {
    flex-shrink: 0 !important;
    width: 14px !important;
    height: 14px !important;
    opacity: 0.5 !important;
    margin-left: 2px !important;
    transition: transform 0.2s !important;
    display: block !important;
}

.wf-deliver-to-widget.wf-dt-open .wf-dt-chevron {
    transform: rotate(180deg) !important;
}

@media (min-width: 768px) and (max-width: 1599px) {
    .wf-deliver-to-trigger {
        gap: 8px !important;
        min-width: 54px !important;
        width: 54px !important;
        max-width: 54px !important;
        padding: 0 10px !important;
        justify-content: center !important;
    }

    .wf-dt-label {
        display: none !important;
    }

    .wf-dt-chevron {
        margin-left: 0 !important;
    }
}

/* ---- Overlay ---- */
.wf-dt-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 99998;
}

.wf-dt-overlay.wf-dt-active {
    display: block;
}

/* ---- Popup ---- */
.wf-deliver-to-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(420px, 94vw);
    background: #0e1623;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.wf-deliver-to-popup:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.wf-dt-popup-inner {
    padding: 24px;
}

/* Header */
.wf-dt-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wf-dt-popup-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.wf-dt-popup-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wf-dt-popup-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Body */
.wf-dt-popup-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.wf-dt-input-row {
    display: flex;
    gap: 10px;
}

.wf-dt-zip-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.18s, background 0.18s;
}

.wf-dt-zip-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
    letter-spacing: 0;
}

.wf-dt-zip-input:focus {
    border-color: rgba(99, 179, 237, 0.65);
    background: rgba(255, 255, 255, 0.1);
}

.wf-dt-apply-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.18s;
    white-space: nowrap;
}

.wf-dt-apply-btn:hover {
    background: #1d4ed8;
}

.wf-dt-apply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status messages */
.wf-dt-status {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
    color: rgba(255, 255, 255, 0.75);
}

.wf-dt-status.wf-dt-success {
    color: #86efac;
}

.wf-dt-status.wf-dt-error {
    color: #fca5a5;
}

/* ============================================================
   Shipping estimate rows on listing cards
   ============================================================ */

/* Skeleton shimmer while loading */
.wf-ship-estimate {
    display: inline-block;
    font-size: 12px;
    color: inherit;
    opacity: 0.8;
}

.wf-ship-skeleton {
    display: inline-block;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: wf-shimmer 1.4s infinite;
    border-radius: 4px;
    min-width: 90px;
    height: 14px;
    vertical-align: middle;
}

@keyframes wf-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wf-ship-free {
    color: #86efac;
    font-weight: 600;
}

.wf-ship-paid {
    color: inherit;
}

/* ============================================================
   Single listing: Buy Box shipping block
   ============================================================ */

.wf-listing-shipping-box {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 14px;
    margin-top: 14px;
    font-size: 15px;
}

.wf-lsb-loading {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    font-size: 13px;
}

.wf-lsb-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.wf-lsb-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.6);
}

.wf-lsb-content {
    flex: 1;
}

.wf-lsb-price {
    font-weight: 700;
    color: #fff;
    font-size: 16px;
}

.wf-lsb-price.wf-lsb-free {
    color: #86efac;
}

.wf-lsb-eta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1px;
}

.wf-lsb-eta strong {
    color: #fff;
}

.wf-lsb-carrier {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
}

.wf-lsb-expedited {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
    margin-top: 8px;
}

.wf-lsb-expedited strong {
    color: #fff;
    font-weight: 600;
}

.wf-lsb-location,
.wf-lsb-change-zip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #60a5fa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    margin-top: 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wf-lsb-location {
    color: rgba(255, 255, 255, 0.68);
    cursor: default;
    text-decoration: none;
}

.wf-lsb-change-zip:hover {
    color: #93c5fd;
}

/* Light-mode cards (when card_theme=light) */
.wf-card-theme-light .wf-ship-estimate {
    color: #334155;
}

.wf-card-theme-light .wf-ship-skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.09) 50%, rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
}

.wf-card-theme-light .wf-ship-free {
    color: #16a34a;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .wf-deliver-to-widget {
        width: 100% !important;
        display: inline-flex !important;
    }

    .wf-deliver-to-trigger {
        height: 44px !important;
        width: 100% !important;
        max-width: none !important;
        justify-content: flex-start !important;
    }

    .wf-dt-label {
        display: flex !important;
    }

    .wf-dt-value {
        max-width: none !important;
    }

    .wf-garage-location-pair .wf-deliver-to-widget {
        width: auto !important;
    }

    .wf-garage-location-pair .wf-deliver-to-trigger {
        width: 100% !important;
        padding: 0 14px !important;
        gap: 10px !important;
    }

    .wf-garage-location-pair .wf-dt-value {
        max-width: none !important;
    }
}

@media (max-width: 480px) {
    .wf-garage-location-pair .wf-deliver-to-trigger {
        padding: 0 12px !important;
        gap: 8px !important;
    }

    .wf-garage-location-pair .wf-dt-value {
        max-width: none !important;
    }

}
