/* Dealers Location Page Styles - Matching Site Color Scheme */

.dealers-location-container {
    padding: 0;
    min-height: auto;
}

.dealers-header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1.5rem 1rem 1rem;
}

.dealers-header h1 {
    font-size: 2.5rem;
    color: #000;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

.dealers-header p {
    font-size: 1.1rem;
    color: #666;
}

/* Loading State */
.map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #666;
}

.map-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #FFA500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #fff;
    color: #FFA500;
    padding: 2rem;
    text-align: center;
}

.map-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #FFA500;
}

.map-error p {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

/* Search Container */
.search-container {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: #FFA500;
    box-shadow: 0 2px 10px rgba(255, 165, 0, 0.2);
}

.search-box i.fa-search {
    color: #999;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.clear-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    color: #FFA500;
}

/* Map Container - map fully fitted in box */
.map-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid #FFA500;
}

#dealers-map {
    width: 100%;
    height: 100%;
    min-height: 100%;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

#dealers-map .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 350px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    max-height: calc(100% - 40px);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    border: 2px solid #FFA500;
}

.info-panel.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-panel-header {
    background: linear-gradient(135deg, #FFA500 0%, #FF9F00 100%);
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.info-panel-content {
    padding: 1.5rem;
    max-height: calc(600px - 80px);
    overflow-y: auto;
}

.info-placeholder {
    color: #999;
    text-align: center;
    font-style: italic;
    margin: 1rem 0;
}

.dealer-info-item {
    margin-bottom: 1.5rem;
}

.dealer-info-item:last-child {
    margin-bottom: 0;
}

.dealer-info-item h4 {
    color: #FFA500;
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.dealer-info-item p {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.6;
}

.dealer-info-item i {
    color: #FFA500;
    margin-right: 0.5rem;
    width: 20px;
}

/* Dealers List */
.dealers-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

.dealers-list-container h2 {
    font-size: 2rem;
    color: #000;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}

.dealers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dealer-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.dealer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: #FFA500;
}

.dealer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.dealer-card-header h3 {
    margin: 0;
    color: #000;
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
}

.view-on-map-btn {
    background: #FFA500;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-on-map-btn:hover {
    background: #FF9F00;
    color: #fff;
}

.dealer-card-body {
    color: #666;
}

.dealer-phone,
.dealer-address {
    margin: 0.75rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.dealer-phone i,
.dealer-address i {
    color: #FFA500;
    margin-top: 0.2rem;
}

.no-dealers {
    text-align: center;
    color: #999;
    font-size: 1.1rem;
    padding: 2rem;
    grid-column: 1 / -1;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 2px solid #FFA500;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 1rem;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.toast-notification.show {
    display: flex;
}

.toast-notification.error {
    border-color: #FFA500;
    color: #FFA500;
}

.toast-notification.success {
    border-color: #28a745;
    color: #28a745;
}

.toast-notification i {
    font-size: 1.5rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom Leaflet popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 2px solid #FFA500;
}

.leaflet-popup-content {
    margin: 1rem;
}

.leaflet-popup-content h4 {
    margin: 0 0 0.5rem 0;
    color: #FFA500;
    font-size: 1.1rem;
    font-weight: 600;
}

.leaflet-popup-content p {
    margin: 0.25rem 0;
    color: #555;
}

.leaflet-popup-content i {
    color: #FFA500;
    margin-right: 0.5rem;
}

/* Responsive Design */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
    .map-container {
        height: 450px;
        margin-bottom: 1.5rem;
    }
    
    .info-panel {
        width: 320px;
    }
    
    .dealers-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

/* Tablets */
@media (max-width: 968px) {
    .dealers-header {
        margin-bottom: 0.75rem;
        padding: 1rem;
    }
    
    .dealers-header h1 {
        font-size: 2rem;
    }
    
    .dealers-header p {
        font-size: 1rem;
    }
    
    .map-container {
        height: 450px;
        padding: 0 0.75rem;
    }
    
    .info-panel {
        width: 300px;
        top: 15px;
        right: 15px;
    }
    
    .info-panel-content {
        padding: 1.25rem;
    }
    
    .dealers-list-container h2 {
        font-size: 1.75rem;
    }
    
    .dealers-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

/* Small Tablets and Large Phones */
@media (max-width: 768px) {
    .dealers-header {
        margin-bottom: 0.5rem;
        padding: 1rem 0.75rem;
    }
    
    .dealers-header h1 {
        font-size: 1.75rem;
    }
    
    .dealers-header p {
        font-size: 0.95rem;
    }
    
    .map-container {
        height: 400px;
        margin-bottom: 1.5rem;
        padding: 0 0.75rem;
        border-radius: 6px;
    }
    
    .info-panel {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
        top: 15px;
        max-height: calc(450px - 30px);
    }
    
    .info-panel-header {
        padding: 0.875rem 1.25rem;
    }
    
    .info-panel-header h3 {
        font-size: 1.1rem;
    }
    
    .info-panel-content {
        padding: 1.25rem;
        max-height: calc(450px - 70px);
    }
    
    .dealer-info-item h4 {
        font-size: 1.2rem;
    }
    
    .dealer-info-item p {
        font-size: 0.9rem;
    }
    
    .search-container {
        padding: 0 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .search-box {
        padding: 0.625rem 1.25rem;
    }
    
    .search-box i.fa-search {
        font-size: 1rem;
        margin-right: 0.625rem;
    }
    
    .search-box input {
        font-size: 0.9rem;
    }
    
    .dealers-list-container {
        padding: 0 0.75rem 2rem;
    }
    
    .dealers-list-container h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .dealers-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dealer-card {
        padding: 1.25rem;
    }
    
    .dealer-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dealer-card-header h3 {
        font-size: 1.2rem;
    }
    
    .view-on-map-btn {
        width: 100%;
        justify-content: center;
        padding: 0.625rem 1rem;
    }
    
    .dealer-phone,
    .dealer-address {
        font-size: 0.9rem;
    }
    
    .map-loading .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .map-loading p {
        font-size: 0.9rem;
    }
    
    .map-error i {
        font-size: 2.5rem;
    }
    
    .map-error p {
        font-size: 1rem;
    }
    
    .toast-notification {
        top: 15px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 0.875rem 1.25rem;
    }
    
    .toast-notification i {
        font-size: 1.3rem;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .dealers-location-container {
        padding: 1rem 0;
    }
    
    .dealers-header {
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }
    
    .dealers-header h1 {
        font-size: 1.5rem;
    }
    
    .dealers-header p {
        font-size: 0.875rem;
    }
    
    .map-container {
        height: 400px;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
        border-radius: 4px;
    }
    
    .info-panel {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        top: 10px;
        max-height: calc(400px - 20px);
        border-radius: 6px;
    }
    
    .info-panel-header {
        padding: 0.75rem 1rem;
    }
    
    .info-panel-header h3 {
        font-size: 1rem;
    }
    
    .close-btn {
        width: 28px;
        height: 28px;
    }
    
    .info-panel-content {
        padding: 1rem;
        max-height: calc(400px - 60px);
    }
    
    .dealer-info-item {
        margin-bottom: 1.25rem;
    }
    
    .dealer-info-item h4 {
        font-size: 1.1rem;
    }
    
    .dealer-info-item p {
        font-size: 0.85rem;
    }
    
    .search-container {
        padding: 0 0.5rem;
        margin-bottom: 1.25rem;
    }
    
    .search-box {
        padding: 0.5rem 1rem;
        border-radius: 30px;
    }
    
    .search-box i.fa-search {
        font-size: 0.95rem;
        margin-right: 0.5rem;
    }
    
    .search-box input {
        font-size: 0.85rem;
    }
    
    .dealers-list-container {
        padding: 0 0.5rem 1.5rem;
    }
    
    .dealers-list-container h2 {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }
    
    .dealers-list {
        gap: 0.875rem;
    }
    
    .dealer-card {
        padding: 1rem;
    }
    
    .dealer-card-header h3 {
        font-size: 1.1rem;
    }
    
    .view-on-map-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .dealer-phone,
    .dealer-address {
        font-size: 0.85rem;
        margin: 0.625rem 0;
    }
    
    .map-loading .spinner {
        width: 35px;
        height: 35px;
        border-width: 3px;
    }
    
    .map-loading p {
        font-size: 0.85rem;
    }
    
    .map-error {
        padding: 1.5rem;
    }
    
    .map-error i {
        font-size: 2rem;
    }
    
    .map-error p {
        font-size: 0.9rem;
    }
    
    .toast-notification {
        top: 10px;
        right: 5px;
        left: 5px;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .toast-notification i {
        font-size: 1.2rem;
    }
    
    .leaflet-popup-content {
        margin: 0.75rem;
    }
    
    .leaflet-popup-content h4 {
        font-size: 1rem;
    }
    
    .leaflet-popup-content p {
        font-size: 0.85rem;
    }
}

/* Extra Small Phones */
@media (max-width: 360px) {
    .dealers-header h1 {
        font-size: 1.35rem;
    }
    
    .dealers-header p {
        font-size: 0.8rem;
    }
    
    .map-container {
        height: 350px;
        padding: 0 0.375rem;
    }
    
    .info-panel {
        width: calc(100% - 15px);
        right: 7.5px;
        left: 7.5px;
        top: 7.5px;
        max-height: calc(350px - 15px);
    }
    
    .info-panel-header {
        padding: 0.625rem 0.875rem;
    }
    
    .info-panel-header h3 {
        font-size: 0.95rem;
    }
    
    .info-panel-content {
        padding: 0.875rem;
        max-height: calc(350px - 55px);
    }
    
    .dealer-info-item h4 {
        font-size: 1rem;
    }
    
    .dealer-info-item p {
        font-size: 0.8rem;
    }
    
    .search-box {
        padding: 0.5rem 0.875rem;
    }
    
    .search-box input {
        font-size: 0.8rem;
    }
    
    .dealers-list-container h2 {
        font-size: 1.25rem;
    }
    
    .dealer-card {
        padding: 0.875rem;
    }
    
    .dealer-card-header h3 {
        font-size: 1rem;
    }
    
    .view-on-map-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .map-loading .spinner {
        width: 30px;
        height: 30px;
    }
    
    .map-loading p {
        font-size: 0.8rem;
    }
}
