/**
 * Dealer Locator Styles
 */

/* Hero */
.dealer-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #171717;
    overflow: hidden;
}

.dealer-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.dealer-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.dealer-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 5rem 1.5rem;
    max-width: 800px;
}

.dealer-hero__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #FFFFFF;
}

.dealer-hero__subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Container */
.dealer-locator-container {
    padding: 3rem 1rem 4rem;
}

.dealer-locator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tier Legend */
.dealer-tier-legend {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dealer-tier-legend__title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6c757d;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
}

.dealer-tier-legend__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Tier Badges */
.dealer-tier-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dealer-tier-badge--finalfit {
    background: linear-gradient(135deg, #FDB521 0%, #E5A01E 100%);
    color: #000;
}

.dealer-tier-badge--dap {
    background: #212529;
    color: #fff;
}

.dealer-tier-badge--black {
    background: #000;
    color: #fff;
}

/* Filters */
.dealer-filters {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1.5rem;
    align-items: end;
}

.dealer-filter-group--services {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .dealer-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dealer-filter-group--services {
        grid-column: span 1;
    }
}

.dealer-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.dealer-filter-select,
.dealer-filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dealer-filter-select:focus,
.dealer-filter-input:focus {
    outline: none;
    border-color: #FDB521;
    box-shadow: 0 0 0 3px rgba(200, 169, 107, 0.15);
}

.dealer-filter-checkboxes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dealer-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dealer-filter-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #FDB521;
}

.dealer-service-icon {
    font-size: 0.875rem;
    font-weight: 500;
}

.dealer-service-icon--cert {
    font-weight: 700;
    color: #FDB521;
}

/* Dealer List */
.dealer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .dealer-list {
        grid-template-columns: 1fr;
    }
}

.dealer-list__loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.dealer-list__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top-color: #FDB521;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dealer Card */
.dealer-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dealer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.dealer-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.dealer-card__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

.dealer-card__branch {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.dealer-card__region {
    font-size: 0.75rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* Service Icons */
.dealer-card__services {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.dealer-service {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
}

.dealer-service svg {
    width: 20px;
    height: 20px;
}

.dealer-service--cert {
    background: #fffbf0 !important;
    border: 1px dashed #FDB521;
}

.dealer-service--cert.dealer-service--active {
    background: linear-gradient(135deg, #FDB521 0%, #E5A01E 100%) !important;
    border: none;
    color: #000;
}

.dealer-service--cert.dealer-service--active svg {
    stroke: #000;
}

.dealer-service--active {
    background: #FDB521;
    color: #000;
}

.dealer-service--active svg {
    stroke: #000;
}

.dealer-service--inactive {
    background: #f8f9fa;
    color: #adb5bd;
}

.dealer-service--inactive svg {
    stroke: #adb5bd;
}

/* Contact Info */
.dealer-card__contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dealer-card__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #495057;
}

.dealer-card__contact-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    stroke: #6c757d;
}

.dealer-card__contact-item a {
    color: inherit;
    text-decoration: none;
}

.dealer-card__contact-item a:hover {
    color: #FDB521;
}

.dealer-card__contact-item--address {
    font-size: 0.8125rem;
    color: #6c757d;
}

.dealer-card__contact-item--address span {
    line-height: 1.4;
}

/* No Results */
.dealer-no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.dealer-no-results svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.dealer-no-results p {
    font-size: 1.125rem;
}

/* Count */
.dealer-count {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.dealer-count strong {
    color: #212529;
}

/* Product Lines Display */
.dealer-card__products {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.dealer-product-category {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.dealer-product-category:last-child {
    margin-bottom: 0;
}

.dealer-product-category__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    min-width: 36px;
    padding-top: 0.25rem;
}

.dealer-product-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.dealer-product-line {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dealer-product-line--active {
    background: #FDB521;
    color: #000;
}

.dealer-product-line--inactive {
    background: #f1f3f4;
    color: #adb5bd;
}

.dealer-product-category--empty {
    font-size: 0.8125rem;
    color: #adb5bd;
    font-style: italic;
}

/* Tier badge - Pro style */
.dealer-tier-badge--pro {
    background: #212529;
    color: #fff;
}

/* Tier Legend - Clickable */
.dealer-tier-legend__hint {
    font-size: 0.6875rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 0.5rem;
}

.dealer-tier-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.dealer-tier-btn:hover {
    transform: scale(1.05);
}

.dealer-tier-btn:active {
    transform: scale(0.98);
}

/* Tier Modal */
.tier-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tier-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tier-modal__content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tier-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tier-modal__close:hover {
    background: #e5e7eb;
}

.tier-modal__close svg {
    width: 18px;
    height: 18px;
    stroke: #6b7280;
}

.tier-modal__badge {
    margin-bottom: 1rem;
}

.dealer-tier-badge--large {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.tier-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.5rem 0;
}

.tier-modal__desc {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tier-modal__feature {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.tier-modal__feature-icon {
    width: 40px;
    height: 40px;
    background: #FEF3C7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tier-modal__feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: #D97706;
}

.tier-modal__feature-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tier-modal__feature-text strong {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
}

.tier-modal__feature-text span {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

.tier-modal__services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.tier-modal__service {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    color: #374151;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tier-modal__service--highlight {
    background: #FDB521;
    color: #000;
    font-weight: 600;
}

@media (max-width: 480px) {
    .tier-modal__content {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .tier-modal__title {
        font-size: 1.125rem;
    }
    
    .tier-modal__feature-icon {
        width: 36px;
        height: 36px;
    }
    
    .tier-modal__feature-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* Tier Separator */
.dealer-tier-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    margin: 0.5rem 0;
}

.dealer-tier-separator__line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FDB521 20%, #FDB521 80%, transparent);
    border-radius: 1px;
}

.dealer-tier-separator__text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
    padding: 0.25rem 1rem;
    background: #f8f8f8;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .dealer-tier-separator {
        padding: 1.5rem 0;
    }
    
    .dealer-tier-separator__text {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
}
