/**
 * Stinger Dealer Locator Styles
 */

.sdl-dealer-locator {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sdl-dealer-locator * {
    box-sizing: border-box;
}

/* Header */
.sdl-header {
    margin-bottom: 20px;
}

.sdl-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.sdl-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Form */
.sdl-form {
    margin-bottom: 20px;
}

.sdl-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.sdl-field {
    flex: 1;
    min-width: 120px;
}

.sdl-field-address {
    flex: 3;
    min-width: 250px;
}

.sdl-field-product {
    flex: 2;
}

.sdl-field-radius {
    flex: 1;
}

.sdl-field-submit {
    flex: 0 0 auto;
}

.sdl-field input,
.sdl-field select {
    width: 100%;
    height: 42px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}

.sdl-field input:focus,
.sdl-field select:focus {
    outline: none;
    border-color: var(--ast-global-color-0);
    box-shadow: 0 0 0 1px var(--ast-global-color-0);
}

.sdl-field button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: var(--ast-global-color-0);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, filter 0.2s;
    white-space: nowrap;
}

.sdl-field button:hover {
    filter: brightness(0.85);
}

.sdl-field button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.sdl-search-icon {
    margin-right: 5px;
    vertical-align: middle;
}

/* Content area - results and map */
.sdl-content {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

.sdl-results-panel {
    flex: 0 0 35%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.sdl-map-panel {
    flex: 1;
    min-width: 0;
}

#sdl-map {
    width: 100%;
    height: 500px;
    background-color: #e5e3df;
    border-radius: 4px;
}

/* Results list */
.sdl-results-list {
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.sdl-results-list:empty {
    border: none;
}

.sdl-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.sdl-result-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sdl-result-item:hover {
    background-color: #f7f7f7;
}

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

.sdl-result-item.sdl-paid {
    background-color: #fffbeb;
    border-left: 3px solid #f59e0b;
}

.sdl-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.sdl-result-rank {
    font-weight: 700;
    color: #333;
    margin-right: 8px;
}

.sdl-result-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.sdl-result-distance {
    font-size: 12px;
    color: #fff;
    background-color: var(--ast-global-color-0);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.sdl-result-details {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.sdl-result-details a {
    color: var(--ast-global-color-0);
    text-decoration: none;
}

.sdl-result-details a:hover {
    text-decoration: underline;
}

.sdl-result-directions {
    margin-top: 8px;
}

.sdl-result-directions a {
    font-size: 12px;
    font-weight: 600;
}

.sdl-result-note {
    margin-top: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

/* Pagination */
.sdl-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 10px;
}

.sdl-pagination button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 3px;
}

.sdl-pagination button.active {
    background-color: var(--ast-global-color-0);
    color: #fff;
    border-color: var(--ast-global-color-0);
}

.sdl-pagination button:hover:not(.active) {
    background-color: #f0f0f0;
}

/* Results footer */
.sdl-results-footer {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #eee;
}

.sdl-feedback {
    margin-top: 10px;
}

.sdl-feedback a {
    color: var(--ast-global-color-0);
    margin: 0 5px;
    font-size: 18px;
}

/* Loading state */
.sdl-loading {
    position: relative;
}

.sdl-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sdl-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: sdl-spin 1s linear infinite;
    margin-right: 8px;
    flex-shrink: 0;
}

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

/* Alert messages */
.sdl-alert {
    padding: 15px;
    margin: 10px;
    border-radius: 4px;
}

.sdl-alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.sdl-alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Info window */
.sdl-info-window {
    max-width: 250px;
    font-size: 13px;
    line-height: 1.4;
}

.sdl-info-window h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.sdl-info-window p {
    margin: 0 0 5px 0;
}

.sdl-info-window a {
    color: var(--ast-global-color-0);
}

/* Responsive */
@media (max-width: 768px) {
    .sdl-content {
        flex-direction: column;
    }

    .sdl-results-panel {
        flex: none;
        max-width: 100%;
        order: 2;
    }

    .sdl-map-panel {
        order: 1;
    }

    #sdl-map {
        height: 300px;
    }

    .sdl-results-list {
        max-height: 400px;
    }

    .sdl-form-row {
        flex-direction: column;
    }

    .sdl-field {
        min-width: 100%;
    }
}
