/* ====================================================
   AutoScout24 Händler Plugin – Frontend Styles
   ==================================================== */

/* --- Filter-Leiste --- */
.as24-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.as24-filters input,
.as24-filters select {
    flex: 1 1 220px;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: border-color .2s;
}

.as24-filters input:focus,
.as24-filters select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,.12);
}

/* --- Fahrzeug-Grid --- */
.as24-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* --- Karte --- */
.as24-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}

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

.as24-card-img {
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.as24-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.as24-card:hover .as24-card-img img {
    transform: scale(1.04);
}

.as24-no-img {
    color: #9ca3af;
    font-size: 13px;
}

.as24-card-body {
    padding: 16px;
}

.as24-card-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.as24-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.as24-card-meta span {
    font-size: 12px;
    background: #f3f4f6;
    color: #374151;
    padding: 3px 8px;
    border-radius: 20px;
}

.as24-card-price {
    font-size: 20px;
    font-weight: 800;
    color: #0073aa;
    margin-bottom: 14px;
}

/* --- Buttons --- */
.as24-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #0073aa;
    color: #fff;
    transition: background .2s, transform .15s;
    text-decoration: none;
}

.as24-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    color: #fff;
}

.as24-btn-outline {
    background: transparent;
    border: 2px solid #0073aa;
    color: #0073aa;
    margin-top: 16px;
}

.as24-btn-outline:hover {
    background: #0073aa;
    color: #fff;
}

/* --- Loading / Spinner --- */
.as24-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #6b7280;
}

.as24-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: as24-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

.as24-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #9ca3af;
}

.as24-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
}

/* --- Paginierung --- */
.as24-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px 0 32px;
}

.as24-page-btn {
    padding: 7px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
}

.as24-page-btn:hover,
.as24-page-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.as24-page-btn.active {
    font-weight: 700;
    pointer-events: none;
}

/* --- Modal --- */
.as24-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.as24-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
}

.as24-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: as24-modal-in .25s ease;
}

@keyframes as24-modal-in {
    from { opacity:0; transform: translateY(20px) scale(.97); }
    to   { opacity:1; transform: translateY(0)   scale(1);    }
}

.as24-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
}

.as24-modal-close:hover { background: #e5e7eb; }

/* --- Detail-Ansicht --- */
.as24-detail h2 {
    margin: 0 0 4px;
    font-size: 24px;
    color: #111827;
}

.as24-detail-price {
    font-size: 28px;
    font-weight: 800;
    color: #0073aa;
    margin-bottom: 20px;
}

.as24-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
    border-radius: 10px;
    overflow: hidden;
}

.as24-gallery img:first-child {
    grid-column: 1 / -1;
    height: 280px;
    object-fit: cover;
}

.as24-gallery img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    cursor: zoom-in;
}

.as24-specs {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.as24-specs th,
.as24-specs td {
    padding: 9px 12px;
    font-size: 14px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.as24-specs th {
    color: #6b7280;
    font-weight: 500;
    width: 40%;
}

.as24-specs td {
    font-weight: 600;
    color: #111827;
}

.as24-desc {
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .as24-grid { grid-template-columns: 1fr; }
    .as24-modal-content { padding: 20px; }
    .as24-gallery img:first-child { height: 200px; }
}
