/* Header Location Selector */
.header-location-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f8f8f8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
    margin-right: 15px;
}

.header-location-selector:hover {
    background: #f0f0f0;
    border-color: #d0d0d0;
}

.header-location-selector svg {
    stroke-width: 2;
}

.header-location-selector span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.header-location-selector .dropdown-arrow {
    margin-left: 5px;
}

/* Popup Overlay */
.location-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(3px);
}

.location-popup-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease-out;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.location-popup-content {
    padding: 40px;
    position: relative;
}

.location-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f5;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
}

.location-popup-close:hover {
    background: #e5e5e5;
    color: #000;
}

.location-popup-close span {
    display: block;
    line-height: 1;
}

.location-popup-header h2 {
    margin: 0 0 30px 0;
    font-size: 28px;
    color: #2c2c2c;
    font-weight: 600;
    text-align: left;
}

.location-popup-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.location-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.btn-get-location {
    background: #10b981;
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-get-location:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-get-location:active {
    transform: translateY(0);
}

.btn-get-location svg {
    width: 20px;
    height: 20px;
}

.location-separator {
    color: #999;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    padding: 0 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.location-separator::before,
.location-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 100px;
    height: 1px;
    background: #e0e0e0;
}

.location-separator::before {
    right: 100%;
}

.location-separator::after {
    left: 100%;
}

/* NEW: Pincode Input Group with Apply Button */
.pincode-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.pincode-input-wrapper {
    position: relative;
    flex: 1;
}

.pincode-input-wrapper svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    stroke-width: 2;
    width: 20px;
    height: 20px;
}

.pincode-input {
    width: 100% !important;
    padding: 16px 18px 16px 52px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
    background: #fafafa !important;
    text-transform: uppercase !important;
}

.pincode-input::placeholder {
    color: #9ca3af !important;
    text-transform: uppercase !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
}

.pincode-input:focus {
    outline: none !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
    background: #fff !important;
}

/* NEW: Apply Button */
.btn-apply-pincode {
    background: #10b981;
    color: white;
    border: none;
    padding: 0 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-apply-pincode:hover:not(.disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-apply-pincode:active:not(.disabled) {
    transform: translateY(0);
}

.btn-apply-pincode.disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.recent-locations {
    margin-top: 10px;
}

.recent-locations h3 {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 16px 0;
    font-weight: 600;
    text-align: left;
}

.location-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.location-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    background: #fff;
    font-size: 15px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.location-chip:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.location-chip svg {
    stroke-width: 2;
    width: 18px;
    height: 18px;
}

.loading-spinner {
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: #6b7280;
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #a7f3d0;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .location-popup-modal {
        width: 95%;
        max-width: 500px;
    }
    
    .location-popup-content {
        padding: 30px 25px;
    }
    
    .location-popup-header h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .header-location-selector {
        padding: 6px 10px;
        margin-right: 10px;
    }
    
    .header-location-selector span {
        font-size: 13px;
    }

    .btn-get-location {
        padding: 14px 24px;
        font-size: 15px;
    }

    .location-separator::before,
    .location-separator::after {
        width: 60px;
    }

    .pincode-input-group {
        flex-direction: column;
    }

    .btn-apply-pincode {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .location-popup-content {
        padding: 25px 20px;
    }

    .location-popup-header h2 {
        font-size: 22px;
    }

    .location-popup-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: 15px;
        right: 15px;
    }
}