/**
 * Sameday Easybox Module — Frontend Styles
 *
 * Styles for the checkout Easybox modal with Leaflet map.
 */

/* ── Modal Overlay ──────────────────────────────────────────── */

.sameday-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

body.sameday-modal-open {
    overflow: hidden;
}

/* ── Modal Box ───────────────────────────────────────────────── */

.sameday-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: samedayFadeIn 0.25s ease-out;
}

@keyframes samedayFadeIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Modal Header ────────────────────────────────────────────── */

.sameday-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.sameday-modal-header h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
}

.sameday-modal-header h4 i {
    color: #0d6efd;
    margin-right: 8px;
}

.sameday-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.sameday-modal-close:hover {
    color: #dc3545;
}

/* ── Modal Body ──────────────────────────────────────────────── */

.sameday-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* ── Controls ────────────────────────────────────────────────── */

.sameday-modal-controls .form-group {
    margin-bottom: 12px;
}

.sameday-modal-controls label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #495057;
}

/* ── Map + List Side by Side ────────────────────────────────── */

.sameday-map-with-list {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.sameday-map-col {
    flex: 3;
    min-width: 0;
    position: relative;
}

.sameday-locker-list-col {
    flex: 2;
    min-width: 180px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dee2e6;
    padding-left: 12px;
}

.sameday-locker-search {
    margin-bottom: 8px;
}

.sameday-locker-list {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sameday-locker-item {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
}

.sameday-locker-item:hover {
    background: #e7f3ff;
}

.sameday-locker-item-active {
    background: #cce5ff !important;
    border-left: 3px solid #0d6efd;
}

.sameday-locker-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a2e;
}

.sameday-locker-item-address {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Checkout Locker Info ───────────────────────────────────── */

.sameday-checkout-info {
    margin: 8px 0 12px 0;
}

.sameday-checkout-info-box {
    background: #f0fff4;
    border: 1px solid #b7ebc5;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sameday-checkout-info-box .sameday-change-locker-btn {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 2px 10px;
}

/* ── Map ─────────────────────────────────────────────────────── */

.sameday-map-container {
    position: relative;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.sameday-map-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.92);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 0.95rem;
    color: #495057;
}

.sameday-map-placeholder {
    height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    border-radius: 8px;
}

/* ── Selected Locker Alert ───────────────────────────────────── */

.sameday-selected-locker {
    margin-top: 10px;
    padding: 10px 15px;
    font-size: 0.9rem;
}

/* ── Modal Footer ────────────────────────────────────────────── */

.sameday-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.sameday-modal-footer .btn {
    min-width: 140px;
    padding: 8px 20px;
    font-size: 0.95rem;
}

/* ── Marker Popup ────────────────────────────────────────────── */

.sameday-marker-popup h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1a1a2e;
}

.sameday-marker-popup p {
    font-size: 0.8rem;
    margin-bottom: 3px;
}

.sameday-select-btn {
    width: 100%;
    margin-top: 5px;
}

/* ── Leaflet Overrides ───────────────────────────────────────── */

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 10px 12px;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 576px) {
    .sameday-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .sameday-modal-overlay {
        padding: 0;
    }

    .sameday-modal-header {
        border-radius: 0;
    }

    .sameday-modal-footer {
        border-radius: 0;
    }

    #sameday-map {
        height: 280px !important;
    }

    .sameday-map-with-list {
        flex-direction: column;
    }

    .sameday-locker-list-col {
        border-left: none;
        border-top: 1px solid #dee2e6;
        padding-left: 0;
        padding-top: 10px;
        max-width: 100%;
    }

    .sameday-locker-list {
        max-height: 180px;
    }

    .sameday-checkout-info-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .sameday-checkout-info-box .sameday-change-locker-btn {
        margin-left: 0;
        margin-top: 4px;
    }
}
