/**
 * ============================================================================
 * LOT CAPTAIN - Public Widget Styles
 * ============================================================================
 *
 * WPCode Integration: Global CSS Snippet
 * - Add this as a WPCode snippet (CSS type)
 * - Set to load SITEWIDE in HEADER
 * - All classes are prefixed with .lc- to avoid conflicts
 *
 * This makes the widget styles available on any page.
 * ============================================================================
 */

/* ========================================================================
   CSS VARIABLES
   ======================================================================== */

.lc-widget {
    --lc-primary: #db2d2e;
    --lc-accent: #b02426;
    --lc-success: #10b981;
    --lc-danger: #ef4444;
    --lc-text: #111827;
    --lc-text-light: #6b7280;
    --lc-border: #e5e7eb;
    --lc-bg: #ffffff;
    --lc-bg-light: #f9fafb;
    --lc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --lc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --lc-radius: 8px;
    --lc-spacing: 1rem;
}

/* ========================================================================
   WIDGET CONTAINER
   ======================================================================== */

.lc-widget {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--lc-text);
    line-height: 1.6;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--lc-spacing);
}

.lc-modal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.lc-widget * {
    box-sizing: border-box;
}

/* ========================================================================
   SEARCH BAR
   ======================================================================== */

.lc-search-bar {
    margin-bottom: var(--lc-spacing);
}

.lc-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lc-search-input:focus {
    outline: none;
    border-color: var(--lc-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ========================================================================
   FILTERS
   ======================================================================== */

.lc-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--lc-spacing);
    margin-bottom: calc(var(--lc-spacing) * 1.5);
}

.lc-filter-select {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--lc-border);
    border-radius: var(--lc-radius);
    background: var(--lc-bg);
    cursor: pointer;
    transition: border-color 0.2s;
}

.lc-filter-select:focus {
    outline: none;
    border-color: var(--lc-primary);
}

/* ========================================================================
   VEHICLE GRID
   ======================================================================== */

.lc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: calc(var(--lc-spacing) * 1.5);
}

/* ========================================================================
   VEHICLE LIST
   ======================================================================== */

.lc-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--lc-spacing) * 1.5);
}

.lc-list .lc-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--lc-spacing);
}

.lc-list .lc-card-image {
    aspect-ratio: 1 / 1;
}

/* ========================================================================
   VEHICLE CARD
   ======================================================================== */

.lc-card {
    background: var(--lc-bg);
    border-radius: var(--lc-radius);
    box-shadow: var(--lc-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--lc-shadow-lg);
}

.lc-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--lc-bg-light);
}

.lc-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.lc-card:hover .lc-card-image img {
    transform: scale(1.05);
}

.lc-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lc-badge-featured {
    background: var(--lc-primary);
    color: white;
}

.lc-card-body {
    padding: var(--lc-spacing);
}

.lc-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--lc-text);
}

.lc-card-trim {
    font-size: 0.875rem;
    color: var(--lc-text-light);
    margin: 0 0 0.5rem 0;
}

.lc-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 0.75rem 0;
}

.lc-card-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--lc-text-light);
}

.lc-card-specs li {
    display: flex;
    align-items: center;
}

.lc-card-specs li:not(:last-child)::after {
    content: "•";
    margin-left: 0.5rem;
    color: var(--lc-border);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.lc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--lc-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.lc-btn-primary {
    background: var(--lc-primary);
    color: white;
    width: 100%;
}

.lc-btn-primary:hover {
    background: var(--lc-accent);
}

.lc-btn-secondary {
    background: var(--lc-bg-light);
    color: var(--lc-text);
    border-color: var(--lc-border);
}

.lc-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.lc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================================================
   PAGINATION
   ======================================================================== */

.lc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--lc-spacing);
    margin-top: calc(var(--lc-spacing) * 2);
    padding-top: calc(var(--lc-spacing) * 1.5);
    border-top: 1px solid var(--lc-border);
}

.lc-page-info {
    font-size: 0.875rem;
    color: var(--lc-text-light);
    padding: 0 var(--lc-spacing);
}

/* ========================================================================
   LOADING STATE
   ======================================================================== */

.lc-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.lc-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid var(--lc-border);
    border-top-color: var(--lc-primary);
    border-radius: 50%;
    animation: lc-spin 0.8s linear infinite;
}

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

/* ========================================================================
   EMPTY STATE
   ======================================================================== */

.lc-empty,
.lc-error {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--lc-text-light);
}

.lc-empty p,
.lc-error p {
    font-size: 1.125rem;
}

.lc-error {
    color: var(--lc-danger);
}

/* ========================================================================
   MODAL
   ======================================================================== */

.lc-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    background: #ffffff;
    overflow-y: auto;
}

.lc-modal.lc-modal-show {
    display: block;
}

.lc-modal-overlay {
    display: none;
}

.lc-modal-content {
    position: relative;
    background: #ffffff;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    min-height: 100%;
}

.lc-modal-close {
    position: fixed;
    top: 8%;
    right: 8%;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border: none;
    background: #ffffff;
    color: var(--lc-primary);
    font-size: 1.75rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lc-modal-close:hover {
    background: #f5f5f5;
    color: var(--lc-accent);
}

.lc-modal-body {
    padding: 6rem 0.5rem 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

.lc-modal-grid {
    display: grid;
    grid-template-columns: 1fr 4fr;
    gap: 3rem;
    align-items: start;
}

/* ========================================================================
   MODAL - GALLERY
   ======================================================================== */

.lc-gallery-main-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.lc-gallery-main {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--lc-radius);
    box-shadow: var(--lc-shadow);
}

.lc-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lc-gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lc-gallery-prev {
    left: 0.75rem;
}

.lc-gallery-next {
    right: 0.75rem;
}

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

.lc-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    transition: border-color 0.2s;
}

.lc-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lc-thumbnail:hover {
    border-color: var(--lc-text-light);
}

.lc-thumbnail-active {
    border-color: var(--lc-primary);
}

/* ========================================================================
   MODAL - DETAILS
   ======================================================================== */

.lc-details h2 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0 0 0.25rem 0;
    color: #000000;
    letter-spacing: -0.5px;
}

.lc-trim {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.75rem;
    position: relative;
}

.lc-trim::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80%;
    height: 2px;
    background: #db2d2e;
}

.lc-modal-price {
    font-size: 1.575rem;
    font-weight: 800;
    color: #000000;
    margin: 0 0 1.5rem 0;
}

.lc-specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f5f5f5;
    border-radius: var(--lc-radius);
}

.lc-spec {
    display: flex;
    flex-direction: column;
}

.lc-spec span {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--lc-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lc-spec strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: #000000;
    margin-top: 0.25rem;
}

.lc-description,
.lc-features {
    margin-bottom: 1.5rem;
}

.lc-description h3,
.lc-features h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.75rem 0;
    color: #000000;
}

.lc-description p {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--lc-text-light);
}

.lc-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem 1rem;
}

.lc-features li {
    display: flex;
    align-items: baseline;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--lc-text);
    line-height: 1.3;
}

.lc-features li::before {
    content: "✓";
    flex-shrink: 0;
    margin-right: 0.375rem;
    color: var(--lc-success);
    font-weight: 700;
    font-size: 0.625rem;
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .lc-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .lc-modal-grid {
        grid-template-columns: 1fr;
    }

    .lc-specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .lc-grid {
        grid-template-columns: 1fr;
    }

    .lc-list .lc-card {
        grid-template-columns: 1fr;
    }

    .lc-filters {
        grid-template-columns: 1fr;
    }

    .lc-card-specs {
        flex-direction: column;
        align-items: flex-start;
    }

    .lc-card-specs li:not(:last-child)::after {
        display: none;
    }

    .lc-modal-body {
        padding: 1rem;
        padding-top: 4rem;
    }

    .lc-modal-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lc-features ul {
        grid-template-columns: 1fr;
    }

    .lc-pagination {
        flex-wrap: wrap;
    }

    .lc-gallery-main {
        aspect-ratio: 4 / 3;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .lc-widget {
        padding: 0.5rem;
    }

    .lc-card-price {
        font-size: 1.25rem;
    }

    .lc-modal-price {
        font-size: 1.5rem;
    }

    .lc-details h2 {
        font-size: 1.5rem;
    }
}

/* ========================================================================
   PRINT
   ======================================================================== */

@media print {
    .lc-search-bar,
    .lc-filters,
    .lc-pagination,
    .lc-btn {
        display: none !important;
    }

    .lc-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--lc-border);
    }
}
