/* Subastas de Vehículos - Estilos */
:root {
    --primary: #005eb5;
    --primary-dark: #004080;
    --secondary: #ffd700;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-light: #666;
    --border: #e0e0e0;
    --success: #28a745;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 16px;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.search-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.search-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-form input,
.search-form select {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    background: white;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form input { flex: 2; min-width: 200px; }
.search-form select { flex: 1; min-width: 150px; }

.btn-primary {
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.stats {
    text-align: center;
    margin-top: 15px;
    font-size: 1.1em;
    color: var(--text-light);
}

.stats span {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary);
}

.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 1.1em;
}

.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.vehicle-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.vehicle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vehicle-type {
    background: #e8f0fe;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.vehicle-price {
    font-size: 1.3em;
    font-weight: 700;
    color: #2e7d32;
}

.vehicle-photo {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f0f0f0;
}

.vehicle-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vehicle-photo img:hover {
    transform: scale(1.05);
}

.photo-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 0 0 8px 8px;
    margin-top: -4px;
}

.photo-count {
    font-size: 0.8em;
    color: var(--text-light);
}

.btn-gallery {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-gallery:hover {
    background: var(--primary-dark);
}

.vehicle-title {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.4;
}

.vehicle-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vehicle-title-link:hover .vehicle-title {
    color: var(--primary);
}

.vehicle-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75em;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.95em;
    font-weight: 500;
}

.valoracion {
    color: #2e7d32;
    font-weight: 700;
}

/* Market value section */
.market-section {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid #c8e6c9;
}

.market-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}

.market-label {
    font-size: 0.8em;
    color: #555;
}

.market-value {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text);
}

.market-bid {
    font-size: 1.1em;
    font-weight: 800;
    color: var(--primary);
}

.ahorro-alto {
    color: #2e7d32;
    font-weight: 700;
}

.ahorro-medio {
    color: #f57f17;
    font-weight: 700;
}

.ahorro-bajo {
    color: #c62828;
    font-weight: 700;
}

.vehicle-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.btn-subasta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-subasta:hover {
    background: #1557b0;
    color: white;
}

.btn-detail:hover {
    background: #059669;
    color: white;
}

.valor-gobierno {
    color: #1a73e8;
    font-weight: 700;
}

.valor-gobierno::before {
    content: "\01F3DB\FE0F ";
}

.bastidor {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.gallery-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.gallery-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    background: rgba(0,0,0,0.5);
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

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

.gallery-prev { left: -60px; }
.gallery-next { right: -60px; }

.gallery-counter {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
}

.gallery-main {
    cursor: pointer;
}

.no-photo {
    padding: 40px;
    text-align: center;
    color: var(--text-light);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5em;
    color: var(--text);
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .header h1 { font-size: 1.5em; }
    .vehicles-grid { grid-template-columns: 1fr; }
    .vehicle-details { grid-template-columns: 1fr; }
    .search-form input, 
    .search-form select { min-width: 100%; }
    .gallery-prev { left: 10px; }
    .gallery-next { right: 10px; }
}
