/* --- Zaf Locations Widget --- */

.zaf-locations-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: inherit;
}

.zaf-continent-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.zaf-continent-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.zaf-continent-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.zaf-continent-header .count-badge {
    background: #007bff;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.zaf-countries-grid {
    padding: 20px;
    display: grid;
    /* User requested 2x2 grid like currency widget */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.zaf-country-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    background: #fff;
    height: 100%;
    min-height: 140px;
    justify-content: center;
    box-sizing: border-box;
}

.zaf-country-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    border-color: #007bff;
}

.zaf-flag-wrapper {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    flex-shrink: 0;
}

/* CRITICAL: Fix giant flags with important */
.zaf-flag-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.zaf-country-name {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.3;
}

.zaf-car-count {
    font-size: 11px;
    color: #fff;
    background: #28a745;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* --- Zaf Currency Switcher Widget --- */

.zaf-currency-widget-grid {
    display: grid;
    /* Default fallback if Elementor doesn't inject it */
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.zaf-currency-widget-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 12px;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    user-select: none;
    min-height: 80px;
}

.zaf-currency-widget-item:hover {
    border-color: #bbb;
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.zaf-currency-widget-item.active {
    background: #cf2e2e;
    /* Default red, overriden by inline */
    color: #fff;
    border-color: #cf2e2e;
    box-shadow: 0 4px 10px rgba(207, 46, 46, 0.25);
}

.zaf-cur-top {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
}

.zaf-cur-flag {
    width: 20px;
    height: 14px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zaf-cur-symbol {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

/* Active State Colors */
.zaf-currency-widget-item.active .zaf-cur-top {
    color: inherit;
    opacity: 0.95;
}

/* --- Widget Container Styles (Matching Zaf Locations) --- */

.zaf-makes-wrapper,
.zaf-currency-widget-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

/* Widget Title Header - Full Width Bar */
.zaf-widget-header {
    background: #f8f9fa;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    text-transform: none;
    /* Match Locations style */
}

/* Add padding to grids inside the wrapper */
.zaf-makes-grid,
.zaf-currency-widget-grid {
    padding: 20px;
    box-sizing: border-box;
}

.zaf-currency-widget-item.active .zaf-cur-symbol {
    color: inherit;
}

/* --- Zaf Search By Make Widget --- */

.zaf-makes-grid {
    display: grid;
    /* Default fallback */
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.zaf-make-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    height: 100%;
    min-height: 120px;
    text-align: center;
}

.zaf-make-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    border-color: #007bff;
}

.zaf-make-logo {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zaf-make-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.2s ease;
}

.zaf-make-card:hover .zaf-make-logo img {
    filter: none;
    opacity: 1;
    transform: scale(1.1);
}

.zaf-make-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
}

/* --- Zaf Mobile Tabs Widget --- */

.zaf-mobile-tabs-wrapper {
    width: 100%;
    font-family: inherit;
}

.zaf-mobile-tabs-nav {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 12px 12px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.zaf-mobile-tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.zaf-tab-btn {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 15px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.zaf-tab-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.zaf-tab-btn:hover {
    background: rgba(207, 46, 46, 0.1);
}

.zaf-tab-btn.active {
    background: #cf2e2e;
    color: #fff;
    box-shadow: 0 4px 10px rgba(207, 46, 46, 0.3);
}

.zaf-tab-btn.active i {
    transform: scale(1.1);
}

.zaf-mobile-tabs-content {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.zaf-tab-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.zaf-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Tabs - Currency Widget Overrides */
.zaf-tab-content .zaf-currency-widget-grid {
    padding: 0;
}

/* Mobile Tabs - Makes Widget Overrides */
.zaf-tab-content .zaf-makes-grid {
    padding: 0;
}

/* Mobile Tabs - Locations Accordion */
.zaf-tab-content .zaf-locations-accordion .zaf-continent-section {
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

.zaf-tab-content .zaf-continent-header {
    background: #f8f9fa;
    transition: background 0.3s ease;
}

.zaf-tab-content .zaf-continent-header:hover {
    background: #e9ecef;
}

.zaf-tab-content .zaf-continent-header i {
    transition: transform 0.3s ease;
}

.zaf-tab-content .zaf-continent-section.open .zaf-continent-header i {
    transform: rotate(180deg);
}

.zaf-tab-content .zaf-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.zaf-tab-content .zaf-continent-section.open .zaf-accordion-content {
    max-height: 1000px;
}

/* Mobile Tabs - Search Widget Overrides */
.zaf-tab-content .zaf-search-container {
    padding: 0;
    background: transparent !important;
}

.zaf-tab-content .zaf-search-field {
    margin-bottom: 12px;
}

.zaf-tab-content .zaf-search-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zaf-tab-content .zaf-search-field select:focus {
    outline: none;
    border-color: #cf2e2e;
    box-shadow: 0 0 0 3px rgba(207, 46, 46, 0.1);
}

.zaf-tab-content .zaf-advanced-toggle {
    text-align: center;
    cursor: pointer;
    margin-bottom: 15px;
    font-size: 14px;
    color: #cf2e2e;
    font-weight: 600;
    user-select: none;
}

.zaf-tab-content .zaf-advanced-toggle:hover {
    color: #a02424;
}

.zaf-tab-content .zaf-advanced-toggle i {
    transition: transform 0.3s ease;
}

.zaf-tab-content .zaf-advanced-fields.open + .zaf-advanced-toggle i {
    transform: rotate(180deg);
}

.zaf-tab-content .zaf-search-btn {
    width: 100%;
    padding: 14px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    background: #cf2e2e;
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.zaf-tab-content .zaf-search-btn:hover {
    background: #a02424;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(207, 46, 46, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .zaf-tab-btn span {
        font-size: 11px;
    }
    
    .zaf-tab-btn i {
        font-size: 16px;
    }
    
    .zaf-tab-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .zaf-tab-btn {
        min-width: 70px;
        padding: 10px 8px;
    }
    
    .zaf-tab-btn span {
        font-size: 10px;
    }
    
    .zaf-tab-btn i {
        font-size: 14px;
    }
}