/* ==========================================================================
   LCE Portal Used Trucks
   ========================================================================== */

#lce-trucks-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
}

/* Loading
   ========================================================================== */

.lce-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    color: #666;
}

.lce-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #e12029;
    border-radius: 50%;
    animation: lce-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error
   ========================================================================== */

.lce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
}

/* Search bar (full width)
   ========================================================================== */

.lce-search-bar {
    margin-bottom: 1.25rem;
}

.lce-search-bar label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.35rem;
}

.lce-search-bar input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: #334155;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.lce-search-bar input:focus {
    outline: none;
    border-color: #e12029;
    box-shadow: 0 0 0 3px rgba(225, 32, 41, 0.15);
}

/* Layout: sidebar + content
   ========================================================================== */

.lce-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Sidebar filters
   ========================================================================== */

.lce-sidebar {
    width: 240px;
    flex-shrink: 0;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 1rem;
}

.lce-sidebar .lce-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.lce-sidebar .lce-filter-group:last-of-type {
    margin-bottom: 1rem;
}

.lce-filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.lce-filter-group select {
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    color: #334155;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.lce-filter-group select:focus {
    outline: none;
    border-color: #e12029;
    box-shadow: 0 0 0 3px rgba(225, 32, 41, 0.15);
}

.lce-btn-reset {
    display: inline-block;
    padding: 0.4rem 0;
    background: none;
    color: #e12029;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
    text-decoration: none;
    text-align: center;
    width: 100%;
}

.lce-btn-reset:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Content area
   ========================================================================== */

.lce-content {
    flex: 1;
    min-width: 0;
}

/* Results count
   ========================================================================== */

.lce-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

/* Card grid — 2 columns
   ========================================================================== */

.lce-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.lce-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.lce-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.lce-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.lce-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.lce-card-image img[data-src] {
    opacity: 0;
}

.lce-card-image img.lce-loaded {
    opacity: 1;
}

.lce-card-image .lce-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 0.85rem;
}

.lce-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.lce-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.lce-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.lce-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: #fef2f2;
    color: #e12029;
    border-radius: 4px;
    font-weight: 500;
}

.lce-tag--type {
    background: #fef2f2;
    color: #e12029;
}

.lce-tag--fuel {
    background: #fefce8;
    color: #a16207;
}

.lce-card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.lce-card-specs span {
    display: flex;
    justify-content: space-between;
}

.lce-card-specs strong {
    color: #334155;
    font-weight: 600;
}

.lce-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e12029;
    margin-top: 0.25rem;
}

/* No results
   ========================================================================== */

.lce-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    font-size: 1rem;
    grid-column: 1 / -1;
}

/* Pagination
   ========================================================================== */

.lce-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.lce-pagination button {
    padding: 0.45rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    min-width: 38px;
}

.lce-pagination button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.lce-pagination button.active {
    background: #e12029;
    color: #fff;
    border-color: #e12029;
}

.lce-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   Single Truck View
   ========================================================================== */

.lce-single {
}

.lce-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 1.5rem;
}

.lce-back-btn:hover {
    background: #e2e8f0;
}

.lce-single-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.lce-single-header-left {
}

.lce-cta-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #e12029;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.lce-cta-btn:hover {
    background: #000;
    color: #fff;
}

.lce-single-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}

/* CTA link (below descriptions)
   ========================================================================== */

.lce-cta-link-wrap {
    margin-bottom: 2rem;
}

.lce-cta-link {
    color: #e12029;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.lce-cta-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Gallery
   ========================================================================== */

.lce-gallery {
    margin-bottom: 2rem;
}

.lce-gallery-main {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    margin-bottom: 0.75rem;
}

.lce-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f1f5f9;
}

.lce-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.lce-gallery-thumb {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.lce-gallery-thumb.active {
    border-color: #e12029;
}

.lce-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Detail table
   ========================================================================== */

.lce-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.lce-detail-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.lce-detail-table tr:last-child {
    border-bottom: none;
}

.lce-detail-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.88rem;
    width: 40%;
    background: #f8fafc;
    vertical-align: top;
}

.lce-detail-table td {
    padding: 0.75rem 1rem;
    color: #1e293b;
    font-size: 0.92rem;
}

.lce-detail-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e12029;
}

/* Description sections
   ========================================================================== */

.lce-description-section {
    margin-bottom: 2rem;
}

.lce-description-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.lce-description-section p {
    color: #475569;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .lce-layout {
        flex-direction: column;
    }

    .lce-sidebar {
        width: 100%;
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
    }

    .lce-sidebar .lce-filter-group {
        margin-bottom: 0;
    }
}

@media (max-width: 640px) {
    .lce-grid {
        grid-template-columns: 1fr;
    }

    .lce-sidebar {
        grid-template-columns: 1fr;
    }

    .lce-single-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .lce-cta-btn {
        align-self: flex-start;
    }

    .lce-single-title {
        font-size: 1.5rem;
    }

    .lce-detail-table th,
    .lce-detail-table td {
        display: block;
        width: 100%;
        padding: 0.5rem 1rem;
    }

    .lce-detail-table th {
        padding-bottom: 0.15rem;
    }

    .lce-detail-table td {
        padding-top: 0.15rem;
    }
}

@media (max-width: 480px) {
    .lce-card-specs {
        grid-template-columns: 1fr;
    }
}
