/* Dealers Locator Styles - Calidra Branding */

:root {
    --calidra-red: #E21E26;
    --calidra-red-hover: #b71c1c;
    --calidra-dark: #171D2B;
    --calidra-gray: #C1BEBE;
    --calidra-light-gray: #f4f4f4;
    --calidra-border: #ddd;
    --calidra-font: "Century Gothic", sans-serif;
}

.dealers-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--calidra-font) !important;
}

.dealers-layout {
    display: flex;
    gap: 30px;
    min-height: 800px;
}

/* Sidebar Styling */
.dealers-sidebar {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--calidra-border);
    border-radius: 8px;
    overflow: hidden;
}

.filter-section {
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid var(--calidra-border);
}

.filter-label {
    display: block;
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.state-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--calidra-border);
    border-radius: 4px;
    font-family: var(--calidra-font);
    font-size: 1em;
    outline: none;
}

.state-select:focus {
    border-color: var(--calidra-red);
}

/* Dealers List Styling */
.dealers-list {
    flex-grow: 1;
    overflow-y: auto;
    height: 0;
    padding: 15px;
    background: var(--calidra-light-gray);
}

/* Custom Scrollbar */
.dealers-list::-webkit-scrollbar {
    width: 6px;
}
.dealers-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.dealers-list::-webkit-scrollbar-thumb {
    background: var(--calidra-gray);
    border-radius: 10px;
}
.dealers-list::-webkit-scrollbar-thumb:hover {
    background: var(--calidra-red);
}

.dealer-card {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.dealer-card:hover {
    border-color: var(--calidra-red);
    transform: translateY(-2px);
}

.dealer-card.active {
    border-left: 5px solid var(--calidra-red);
    background: #fffafa;
}

.dealer-card h3 {
    font-size: 1.1em;
    margin: 0 0 8px 0;
    color: var(--calidra-dark);
    font-weight: 800;
    text-transform: uppercase;
}

.dealer-card p {
    font-size: 0.9em;
    color: #555;
    margin: 0;
    line-height: 1.4;
}

/* Main Content Styling */
.dealers-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dealers-title {
    font-size: 2.2em !important;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--calidra-red);
}

.map-container {
    width: 100%;
    height: 450px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--calidra-border);
}

#google-map {
    width: 100%;
    height: 100%;
}

/* Dealer Details Styling */
.dealer-details {
    background: white;
    padding: 25px;
    border: 1px solid var(--calidra-border);
    border-radius: 8px;
    animation: fadeIn 0.4s ease;
}

.dealer-details.empty-state {
    text-align: center;
    color: #999;
    padding: 50px;
}

.details-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
}

.details-title {
    text-align: center;
    font-size: 1.8em;
    color: var(--calidra-dark);
    margin: 0 0 20px 0;
    text-transform: uppercase;
    width: 100%;
}

.details-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.details-info {
    flex: 1;
}

.details-info p {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.details-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 25px;
}

.contact-item {
    font-size: 1em;
    color: #444;
}

.contact-item strong {
    color: var(--calidra-dark);
}

.details-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 200px;
    align-items: flex-end;
}

.action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: #B3B3B3;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #999;
    color: white;
}

/* Products Table Styling */
.products-section {
    margin-top: 30px;
}

.products-section h3 {
    font-size: 1.5em;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: var(--calidra-dark);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.product-category {
    border: 1px solid var(--calidra-border);
    border-radius: 6px;
    overflow: hidden;
}

.category-title {
    background: #333;
    color: white;
    padding: 10px;
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
}

/* Colors for categories from screenshot */
.cat-construccion .category-title { background: #E21E26; }
.cat-mezclas .category-title { background: #333333; }
.cat-industria .category-title { background: #999999; }

.industria-extra {
    padding: 15px;
    text-align: center;
    font-size: 0.85em;
    color: #666;
    border-top: 1px solid #eee;
}

.industria-btn {
    display: block;
    background: #B3B3B3;
    color: white;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}
.industria-btn:hover {
    background: #999;
    color: white;
}

.product-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.85em;
}

.product-item:last-child {
    border-bottom: none;
}

.status-check {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.status-check.available {
    background: #444;
    color: white;
    border-color: #444;
}

.status-check.available::after {
    content: "✓";
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
.mobile-map-hint {
    display: none;
    margin-top: 15px;
    font-size: 0.9em;
    color: var(--calidra-red);
    text-align: center;
    font-weight: bold;
    margin-bottom: 0;
}

@media (max-width: 992px) {
    .dealers-layout {
        flex-direction: column;
    }
    .dealers-sidebar {
        flex: 0 0 auto;
    }
    .dealers-list {
        display: none !important;
    }
    .mobile-map-hint {
        display: block;
    }
    .details-header-content {
        flex-direction: column !important;
        gap: 20px;
    }
    .details-actions {
        flex-direction: row !important;
        width: 100%;
        gap: 15px;
        align-items: center;
        min-width: unset;
    }
    .action-btn {
        flex: 1;
        padding: 12px 10px;
        font-size: 0.9em;
    }
    .details-info {
        width: 100%;
    }
    .details-contact {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
    }
    .contact-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
