/* TruckScout24 Extension Styles
 * Basiert auf Fliegl-Branding aus dem Prototyp
 * ------------------------------------------------ */

:root {
    --ts24-primary: #a4c60d;
    --ts24-primary-hover: #93b207;
    --ts24-primary-text: #20240f;
    --ts24-light: #f5fadc;
    --ts24-border: #e5efc2;
}

.btn.btn-primary {
    background: var(--ts24-primary) !important;
    border: 2px solid var(--ts24-primary-hover) !important;
    color: var(--ts24-primary-text) !important;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    padding: 12px 20px;
    text-decoration: none;
    display: inline-block;
}
.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background: var(--ts24-primary-hover) !important;
    color: var(--ts24-primary-text) !important;
    text-decoration: none;
}
.btn.btn-outline-secondary {
    border-color: #9ec013 !important;
    color: #9ec013 !important;
}
.btn.btn-outline-secondary:hover,
.btn.btn-outline-secondary:focus {
    background: #9ec013 !important;
    border-color: #9ec013 !important;
    color: #20240f !important;
}

/* Filter */
.ts24-filters-wrap {
    background: var(--ts24-light);
    border: 1px solid var(--ts24-border);
    border-radius: 6px;
}

/* Listing-Karten */
.ts24-card {
    border: 1px solid #ececec;
    border-radius: 6px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.ts24-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.ts24-card-image-link {
    position: relative;
    display: block;
}
.ts24-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #f0f0f0;
}
.ts24-card-no-image {
    aspect-ratio: 16 / 10;
}
.ts24-card-price {
    color: #1b1b1b;
}

/* Status-Badge */
.badge-status {
    background: #101010;
    color: #fff;
}

/* Spec-Grid in Karten */
.spec-grid { font-size: .86rem; color: #555; }
.spec-item {
    padding: .2rem 0;
    border-bottom: 1px solid #f2f2f2;
}

/* AJAX Loading */
.ts24-results-shell {
    position: relative;
    min-height: 280px;
}
.ts24-results-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.84);
    display: none;
    align-items: stretch;
    justify-content: center;
    z-index: 2;
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}
.ts24-results-shell.loading .ts24-results-overlay {
    display: flex;
    opacity: 1;
}
.ts24-results-shell.loading .ts24-results-content {
    opacity: .45;
}
.ts24-results-content {
    transition: opacity .2s ease;
}

/* Skeleton */
.ts24-skeleton-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}
.ts24-skeleton-card {
    border: 1px solid #ececec;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.ts24-skeleton-image,
.ts24-skeleton-line {
    position: relative;
    overflow: hidden;
    background: #eef0e7;
}
.ts24-skeleton-image { aspect-ratio: 16/10; }
.ts24-skeleton-line { height: 12px; margin: 10px 12px; border-radius: 4px; }
.ts24-skeleton-line.ts24-w80 { width: 80%; }
.ts24-skeleton-line.ts24-w60 { width: 60%; }
.ts24-skeleton-line.ts24-w40 { width: 40%; }
.ts24-skeleton-image::after,
.ts24-skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
    animation: ts24-skeleton-shimmer 1.2s infinite;
}
@keyframes ts24-skeleton-shimmer {
    100% { transform: translateX(100%); }
}

/* Eintritt-Animation für Karten */
.ts24-listing-col.is-entering {
    opacity: 0;
    transform: translateY(10px) scale(.995);
}
.ts24-listing-col.is-entering.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity .28s ease, transform .28s ease;
}

/* Pagination */
.pagination .page-item.active .page-link {
    background: var(--ts24-primary);
    border-color: var(--ts24-primary-hover);
    color: var(--ts24-primary-text);
}
.pagination .page-link { color: #222; }

/* Detail-Seite */
.ts24-gallery {
    position: relative;
}
.ts24-gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(0,0,0,.45);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.ts24-gallery-btn:hover { background: rgba(0,0,0,.7); }
.ts24-gallery-btn.prev { left: .5rem; }
.ts24-gallery-btn.next { right: .5rem; }
.ts24-main-image {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 6px;
}
.ts24-thumbnail-strip {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: .25rem 0 .5rem;
    scroll-snap-type: x mandatory;
}
.ts24-thumbnail-strip::-webkit-scrollbar { display: none; }
.ts24-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 56px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s;
    scroll-snap-align: start;
}
.ts24-thumbnail.active,
.ts24-thumbnail:hover {
    border-color: var(--ts24-primary);
}
.ts24-promo-badge {
    font-size: .9rem;
}

/* Beschreibung: Begrenzung mit Aufklapp-Funktion */
.ts24-description {
    max-height: 300px;
    overflow: hidden;
    position: relative;
    transition: max-height .3s ease;
}
.ts24-description:not(.is-expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}
.ts24-description.is-expanded {
    max-height: none;
}
.ts24-description-toggle {
    cursor: pointer;
    color: var(--ts24-primary-hover);
    font-weight: 600;
    font-size: .9rem;
    border: none;
    background: none;
    padding: .5rem 0;
}
.ts24-description-toggle:hover {
    text-decoration: underline;
}

/* Ansprechpartner-Bild */
.ts24-contact-image img {
    border: 2px solid var(--ts24-border);
}

/* Responsive */
@media (max-width: 991px) {
    .ts24-skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .ts24-skeleton-grid { grid-template-columns: 1fr; }
}
