/* ============================================================
   Giadil Vehicles - Frontend Styles
   ============================================================ */

:root {
    --gv-primary: #4a9ece;
    --gv-primary-dark: #3a7ea8;
    --gv-text: #333;
    --gv-text-light: #666;
    --gv-text-muted: #999;
    --gv-bg: #f5f6f8;
    --gv-white: #fff;
    --gv-border: #e0e3e8;
    --gv-radius: 12px;
    --gv-radius-sm: 8px;
    --gv-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --gv-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --gv-transition: 0.25s ease;
}

/* ---- Reset ---- */
.gv-archive-wrap *,
.gv-single-wrap *,
.gv-latest-wrap * {
    box-sizing: border-box;
}

.gv-latest-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gv-text);
}

/* ============================================================
   ARCHIVE LAYOUT
   ============================================================ */
.gv-archive-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gv-text);
}

/* ---- SIDEBAR ---- */
.gv-sidebar {
    position: sticky;
    top: 30px;
    align-self: start;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}

.gv-search-box {
    display: flex;
    align-items: center;
    background: var(--gv-white);
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.gv-search-box input {
    flex: 1;
    border: none;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    background: transparent;
}

.gv-search-box button {
    background: none;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--gv-text-light);
    display: flex;
    align-items: center;
}

.gv-search-box button:hover {
    color: var(--gv-primary);
}

.gv-filter-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gv-primary);
    margin: 0 0 16px;
    letter-spacing: 0.5px;
}

.gv-filter-group {
    border-bottom: 1px solid var(--gv-border);
}

.gv-filter-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--gv-text);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.gv-filter-toggle:hover {
    color: var(--gv-primary);
}

.gv-chevron {
    transition: transform var(--gv-transition);
}

.gv-filter-toggle[aria-expanded="true"] .gv-chevron {
    transform: rotate(180deg);
}

.gv-filter-options {
    padding: 0 0 14px;
}

.gv-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    font-size: 13px;
    color: var(--gv-text);
    background: var(--gv-white);
    cursor: pointer;
    outline: none;
}

.gv-filter-select:focus {
    border-color: var(--gv-primary);
}

.gv-price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gv-price-range input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    font-size: 13px;
    outline: none;
    width: 50%;
}

.gv-price-range input:focus {
    border-color: var(--gv-primary);
}

.gv-range-sep {
    color: var(--gv-text-muted);
    font-size: 16px;
}

.gv-reset-filters {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 10px;
    background: none;
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    color: var(--gv-text-light);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all var(--gv-transition);
}

.gv-reset-filters:hover {
    border-color: var(--gv-primary);
    color: var(--gv-primary);
}

/* ---- MAIN CONTENT ---- */
.gv-main {
    min-width: 0;
}

.gv-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.gv-results-count {
    font-size: 14px;
    color: var(--gv-text-light);
}

.gv-sort-wrap select {
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    font-size: 13px;
    color: var(--gv-text);
    background: var(--gv-white);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* ---- GRID ---- */
.gv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.gv-grid--1 { grid-template-columns: 1fr; }
.gv-grid--2 { grid-template-columns: repeat(2, 1fr); }
.gv-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gv-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---- CARD ---- */
.gv-card {
    background: var(--gv-white);
    border-radius: var(--gv-radius);
    overflow: hidden;
    box-shadow: var(--gv-shadow);
    transition: box-shadow var(--gv-transition), transform var(--gv-transition);
    position: relative;
}

.gv-card:hover {
    box-shadow: var(--gv-shadow-hover);
    transform: translateY(-2px);
}

.gv-card--sold {
    opacity: 0.65;
}

.gv-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gv-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--gv-primary);
    color: var(--gv-white);
    border-radius: var(--gv-radius-sm);
    padding: 6px 12px;
    text-align: center;
    line-height: 1.3;
}

.gv-badge-price {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.gv-badge-label {
    display: block;
    font-size: 10px;
    opacity: 0.9;
}

.gv-sold-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    color: var(--gv-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    z-index: 3;
    text-transform: uppercase;
}

.gv-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}

.gv-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--gv-transition);
}

.gv-card:hover .gv-card-image img {
    transform: scale(1.03);
}

.gv-card-body {
    padding: 16px 16px 8px;
    flex: 1;
}

.gv-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--gv-text);
    text-transform: uppercase;
}

.gv-card-subtitle {
    font-size: 13px;
    color: var(--gv-text-light);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gv-card-footer {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--gv-border);
    margin-top: auto;
}

.gv-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.gv-info-icon {
    color: var(--gv-text-muted);
    margin-bottom: 2px;
}

.gv-info-label {
    font-size: 11px;
    color: var(--gv-text-muted);
}

.gv-info-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--gv-text);
}

/* ---- NO RESULTS ---- */
.gv-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gv-text-light);
    font-size: 16px;
}

/* ---- PAGINATION ---- */
.gv-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 30px;
}

.gv-pagination a,
.gv-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius-sm);
    text-decoration: none;
    color: var(--gv-text);
    font-size: 14px;
    transition: all var(--gv-transition);
}

.gv-pagination a:hover {
    border-color: var(--gv-primary);
    color: var(--gv-primary);
}

.gv-pagination .current {
    background: var(--gv-primary);
    border-color: var(--gv-primary);
    color: var(--gv-white);
}

/* ---- LOADING ---- */
.gv-loading {
    text-align: center;
    padding: 40px;
}

.gv-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gv-border);
    border-top-color: var(--gv-primary);
    border-radius: 50%;
    animation: gv-spin 0.7s linear infinite;
    margin: 0 auto;
}

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

/* ============================================================
   SINGLE VEHICLE
   ============================================================ */
.gv-single-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gv-text);
}

/* ---- Hero ---- */
.gv-single-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    align-items: start;
}

.gv-main-image {
    position: relative;
    border-radius: var(--gv-radius);
    overflow: hidden;
    background: #f0f0f0;
}

.gv-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.gv-sold-overlay--single {
    font-size: 24px;
    border-radius: var(--gv-radius);
}

.gv-thumbs-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gv-thumb {
    flex-shrink: 0;
    width: 70px;
    height: 52px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color var(--gv-transition);
}

.gv-thumb.active,
.gv-thumb:hover {
    border-color: var(--gv-primary);
}

.gv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Info panel ---- */
.gv-single-info {
    padding-top: 10px;
}

.gv-single-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 4px;
    color: var(--gv-text);
    text-transform: uppercase;
}

.gv-single-subtitle {
    font-size: 14px;
    color: var(--gv-text-light);
    margin: 0 0 16px;
}

.gv-single-separator {
    height: 3px;
    width: 80px;
    background: var(--gv-primary);
    border-radius: 2px;
    margin-bottom: 16px;
}

.gv-single-meta-row {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.gv-meta-item {
    font-size: 14px;
    color: var(--gv-primary);
}

.gv-meta-item strong {
    font-weight: 700;
}

/* ---- Price Card ---- */
.gv-price-card {
    background: var(--gv-white);
    border: 1px solid var(--gv-border);
    border-radius: var(--gv-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.gv-price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
}

.gv-price-row:last-of-type {
    margin-bottom: 16px;
}

.gv-price-label {
    color: var(--gv-text-light);
}

.gv-price-amount strong {
    font-size: 20px;
    font-weight: 800;
    color: var(--gv-text);
}

.gv-price-iva-label {
    color: var(--gv-primary);
    font-size: 13px;
    cursor: default;
}

/* ---- IVA Toggle ---- */
.gv-iva-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 0;
    border-top: 1px solid var(--gv-border);
}

.gv-iva-label {
    font-size: 14px;
    color: var(--gv-text-muted);
    font-weight: 500;
    transition: color var(--gv-transition);
}

.gv-iva-label--active {
    color: var(--gv-text);
    font-weight: 700;
}

.gv-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.gv-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.gv-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 26px;
    transition: var(--gv-transition);
}

.gv-toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--gv-white);
    border-radius: 50%;
    transition: var(--gv-transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.gv-toggle-switch input:checked + .gv-toggle-slider {
    background: var(--gv-primary);
}

.gv-toggle-switch input:checked + .gv-toggle-slider::before {
    transform: translateX(22px);
}

.gv-anticipo-note {
    font-size: 12px;
    color: var(--gv-text-muted);
    margin: 12px 0 0;
    text-align: center;
    font-style: italic;
}

/* ---- CTA Button ---- */
.gv-cta-button {
    display: block;
    width: 100%;
    padding: 18px 24px;
    background: var(--gv-primary);
    color: var(--gv-white);
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--gv-radius);
    letter-spacing: 0.5px;
    transition: background var(--gv-transition);
}

.gv-cta-button:hover {
    background: var(--gv-primary-dark);
    color: var(--gv-white);
}

/* ---- Sections ---- */
.gv-section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gv-border);
}

/* Specs Grid */
.gv-single-specs {
    margin-bottom: 40px;
}

.gv-specs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.gv-spec-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gv-border);
    font-size: 14px;
}

.gv-spec-item:nth-child(odd) {
    background: #fafbfc;
}

.gv-spec-label {
    color: var(--gv-text-light);
}

.gv-spec-value {
    font-weight: 600;
    text-align: right;
}

/* Description */
.gv-single-description {
    margin-bottom: 40px;
}

.gv-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gv-text-light);
}

/* Features */
.gv-single-features {
    margin-bottom: 40px;
}

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

.gv-features-list li {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gv-border);
    position: relative;
    padding-left: 30px;
}

.gv-features-list li::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--gv-primary);
    border-radius: 50%;
}

/* Video */
.gv-single-video {
    margin-bottom: 40px;
}

.gv-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--gv-radius);
}

.gv-video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* Contact */
.gv-single-contact {
    background: var(--gv-bg);
    padding: 40px;
    border-radius: var(--gv-radius);
    margin-bottom: 40px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .gv-grid,
    .gv-grid--3,
    .gv-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .gv-single-hero {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

@media (max-width: 768px) {
    .gv-archive-wrap {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 20px;
    }

    .gv-sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--gv-border);
        padding-bottom: 20px;
    }

    .gv-grid,
    .gv-grid--2,
    .gv-grid--3,
    .gv-grid--4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gv-topbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .gv-single-wrap {
        padding: 16px;
    }

    .gv-single-title {
        font-size: 22px;
    }

    .gv-price-card {
        padding: 16px;
    }

    .gv-specs-grid,
    .gv-features-list {
        grid-template-columns: 1fr;
    }

    .gv-single-contact {
        padding: 24px 16px;
    }

    .gv-single-meta-row {
        flex-direction: column;
        gap: 8px;
    }
}
