        :root {
            --color-primario: #ff8c00;
            --color-primario-hover: #e67900;
            --color-secundario: #1a1a2e;
            --color-exito: #00c853;
            --color-peligro: #e74c3c;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: #f8f9fa;
            color: #333;
            line-height: 1.6;
        }

        .header {
            background: #ffffff;
            color: #333;
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            border-bottom: 3px solid var(--color-primario);
        }

        .header h1 {
            font-size: 1.5rem;
            font-weight: 600;
        }

        .header-actions {
            display: flex;
            gap: 1rem;
            align-items: center;
        }

        .btn {
            padding: 0.6rem 1.2rem;
            border-radius: 6px;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            border: none;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--color-primario), var(--color-primario-hover));
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(255,140,0,0.3);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--color-primario);
            color: var(--color-primario);
        }

        .btn-outline:hover {
            background: var(--color-primario);
            color: white;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
        }

        .section-title {
            font-size: 1.8rem;
            font-weight: 600;
            margin-bottom: 2rem;
        }

        /* Filtros */
        .filters-container {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            border: 2px solid var(--color-primario);
        }

        /* Barra de búsqueda */
        #filter-search {
            background: #f8f9fa;
        }
        #filter-search:focus {
            outline: none;
            border-color: var(--color-primario);
            box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
            background: white;
        }
        #filter-search::placeholder {
            color: #999;
        }

        .filters-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .filter-group label {
            display: block;
            font-weight: 500;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
            color: var(--color-primario);
        }

        .filter-group select {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 0.9rem;
        }

        .filter-group select:focus {
            outline: none;
            border-color: var(--color-primario);
            box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
        }

        .filter-actions {
            display: flex;
            gap: 1rem;
            justify-content: flex-end;
            align-items: center;
        }

        .badge-total {
            background: var(--color-secundario);
            color: white;
            padding: 0.5rem 1rem;
        }

        .ws-status {
            display: flex;
            align-items: center;
            font-size: 0.7rem;
            color: #999;
            cursor: help;
        }

        .ws-status.connected { color: var(--color-exito); }
        .ws-status.connecting { color: #f39c12; animation: pulse 1s infinite; }
        .ws-status.disconnected { color: #e74c3c; }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* Toast notifications */
        .toast-container {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: #fff;
            border-radius: 10px;
            padding: 14px 18px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 12px;
            animation: slideIn 0.3s ease;
            max-width: 350px;
            border-left: 4px solid var(--color-primario);
        }

        .toast.bid { border-left-color: var(--color-primario); }
        .toast.win { border-left-color: var(--color-exito); }
        .toast.outbid { border-left-color: var(--color-peligro); }

        .toast-icon {
            font-size: 1.5rem;
        }

        .toast-content {
            flex: 1;
        }

        .toast-title {
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 2px;
        }

        .toast-message {
            font-size: 0.8rem;
            color: #666;
        }

        .toast-close {
            background: none;
            border: none;
            font-size: 1.2rem;
            color: #999;
            cursor: pointer;
            padding: 0;
        }

        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        .filter-group select {
            border-radius: 20px;
            font-weight: 600;
        }

        /* Grid de subastas */
        .auctions-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
            gap: 2rem;
        }

        .auction-card {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            position: relative;
            will-change: transform;
            contain: layout style;
        }

        .auction-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 12px 40px rgba(0,0,0,0.15);
        }

        /* ========== GALERIA EN CARD ========== */
        .card-gallery {
            position: relative;
            height: 260px;
            overflow: hidden;
            background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
        }

        .card-gallery-track {
            display: flex;
            height: 100%;
            transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .card-gallery-slide {
            min-width: 100%;
            height: 100%;
        }

        .card-gallery-slide img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .auction-card:hover .card-gallery-slide img {
            transform: scale(1.02);
        }

        .card-gallery-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255,255,255,0.95);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            transition: all 0.3s ease;
            z-index: 5;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            color: var(--color-secundario);
        }

        .card-gallery:hover .card-gallery-nav {
            opacity: 1;
        }

        .card-gallery-nav:hover {
            background: var(--color-primario);
            color: white;
            transform: translateY(-50%) scale(1.1);
        }

        .card-gallery-nav.prev { left: 10px; }
        .card-gallery-nav.next { right: 10px; }

        .card-gallery-dots {
            position: absolute;
            bottom: 12px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            z-index: 5;
        }

        .card-gallery-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: rgba(255,255,255,0.5);
            border: 2px solid rgba(255,255,255,0.8);
            padding: 0;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .card-gallery-dot.active {
            background: var(--color-primario);
            border-color: white;
            transform: scale(1.3);
        }

        .contador-fotos {
            position: absolute;
            bottom: 12px;
            right: 12px;
            background: rgba(0,0,0,0.75);
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 500;
            z-index: 10;
            display: flex;
            align-items: center;
            gap: 5px;
            backdrop-filter: blur(4px);
        }

        .auction-badges {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 10;
        }

        .badge {
            padding: 0.4rem 0.8rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
        }

        .badge-type {
            background: rgba(0,0,0,0.8);
            color: white;
            backdrop-filter: blur(4px);
        }

        .badge-time {
            background: linear-gradient(135deg, var(--color-primario), var(--color-primario-hover));
            color: white;
            box-shadow: 0 2px 8px rgba(255,140,0,0.4);
            min-width: 90px;
            text-align: center;
            font-variant-numeric: tabular-nums;
        }

        .badge-time.urgent {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
            animation: pulse-urgent 1s infinite;
        }

        .badge-time.ended {
            background: #6c757d;
            box-shadow: none;
        }

        @keyframes pulse-urgent {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        .badge-instant {
            background: linear-gradient(135deg, var(--color-exito), #00a844);
            color: white;
        }

        /* Lazy load */
        .img-lazy {
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        .img-lazy.loaded {
            opacity: 1;
        }

        .sin-imagen {
            height: 260px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
            color: #999;
        }

        .sin-imagen i { font-size: 3rem; margin-bottom: 0.5rem; }

        .auction-info {
            padding: 1.5rem;
        }

        .auction-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 0.3rem;
        }

        .auction-year {
            color: #666;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .vehicle-specs {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 1rem;
        }

        .spec-badge {
            background: #f0f4f8;
            color: #1a1a2e;
            padding: 4px 10px;
            border-radius: 15px;
            font-size: 0.75rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .spec-badge i {
            color: var(--color-primario);
            font-size: 0.85rem;
        }

        .auction-prices {
            background: #f8f9fa;
            padding: 1rem;
            border-radius: 10px;
            margin-bottom: 1rem;
        }

        .price-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.5rem;
        }

        .price-row:last-child {
            margin-bottom: 0;
        }

        .price-label {
            font-size: 0.85rem;
            color: #666;
        }

        .price-value {
            font-weight: 700;
            color: #333;
        }

        .price-current {
            font-size: 1.3rem;
            color: var(--color-primario);
        }

        .auction-stats {
            display: flex;
            justify-content: space-around;
            padding: 0.8rem 0;
            border-top: 1px solid #eee;
            margin-bottom: 1rem;
        }

        .stat-item {
            text-align: center;
        }

        .stat-value {
            font-weight: 700;
            font-size: 1.1rem;
        }

        .stat-label {
            font-size: 0.75rem;
            color: #666;
        }

        .auction-actions {
            display: flex;
            gap: 0.8rem;
        }

        .btn-bid {
            flex: 1;
            background: linear-gradient(135deg, var(--color-secundario), #16213e);
            color: white;
            padding: 1rem;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-bid:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(26,26,46,0.3);
        }

        .btn-instant-buy {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            margin-top: 0.7rem;
            padding: 0.9rem 1rem;
            border: none;
            border-radius: 10px;
            background: linear-gradient(135deg, var(--color-exito), #00a844);
            color: white;
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .btn-instant-buy:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(0, 168, 68, 0.35);
        }

        .btn-gallery {
            background: var(--color-primario);
            width: 50px;
            flex: none;
            padding: 0;
        }

        /* ========== MODAL GALERIA FULLSCREEN ========== */
        .modal-galeria-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.97);
            z-index: 2000;
            justify-content: center;
            align-items: center;
        }

        .modal-galeria-overlay.active {
            display: flex;
        }

        .modal-galeria-content {
            width: 100%;
            height: 100%;
            position: relative;
        }

        .btn-cerrar-galeria {
            position: absolute;
            top: 20px;
            right: 20px;
            z-index: 100;
            background: var(--color-primario);
            border: 3px solid white;
            border-radius: 30px;
            padding: 10px 24px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            transition: all 0.3s ease;
            color: white;
            font-weight: 600;
        }

        .btn-cerrar-galeria:hover {
            background: var(--color-peligro);
            transform: scale(1.05);
        }

        @media(max-width: 576px) {
            .btn-cerrar-galeria {
                padding: 10px 16px;
                right: 10px;
                top: 10px;
            }
            .btn-cerrar-galeria span { display: none; }
        }

        .zoom-container {
            width: 100%;
            height: 75vh;
            overflow: hidden;
            position: relative;
            cursor: grab;
            touch-action: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .zoom-container.grabbing { cursor: grabbing; }

        .zoom-container img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            transition: transform 0.15s ease;
            transform-origin: center;
            user-select: none;
        }

        .zoom-level {
            position: absolute;
            top: 20px;
            left: 20px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 600;
            z-index: 10;
        }

        .zoom-controls {
            position: absolute;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 12px;
            z-index: 10;
        }

        .zoom-controls button {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: none;
            background: rgba(255,255,255,0.95);
            color: var(--color-secundario);
            font-size: 1.3rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .zoom-controls button:hover {
            background: var(--color-primario);
            color: white;
            transform: scale(1.1);
        }

        .galeria-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 55px;
            height: 55px;
            border-radius: 50%;
            background: rgba(255,140,0,0.9);
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
            z-index: 10;
            transition: all 0.3s ease;
        }

        .galeria-nav:hover {
            background: var(--color-primario);
            transform: translateY(-50%) scale(1.1);
        }

        .galeria-nav.prev { left: 20px; }
        .galeria-nav.next { right: 20px; }

        .galeria-indicadores {
            position: absolute;
            bottom: 160px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            z-index: 10;
        }

        .galeria-indicador {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: rgba(255,255,255,0.4);
            border: 2px solid white;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .galeria-indicador.active {
            background: var(--color-primario);
        }

        .swipe-hint {
            position: absolute;
            bottom: 200px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 10px 20px;
            border-radius: 25px;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 10;
            animation: fadeOutHint 4s ease forwards;
        }

        @keyframes fadeOutHint {
            0%, 70% { opacity: 1; }
            100% { opacity: 0; pointer-events: none; }
        }

        .modal-vehicle-info {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(transparent, rgba(0,0,0,0.9));
            padding: 60px 20px 20px;
            color: white;
        }

        .modal-vehicle-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .modal-vehicle-specs {
            display: flex;
            gap: 20px;
            flex-wrap: wrap;
            font-size: 0.9rem;
            opacity: 0.9;
        }

        /* Modal standard */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: white;
            border-radius: 16px;
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid #eee;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h2 {
            font-size: 1.3rem;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #666;
        }

        .modal-body {
            padding: 1.5rem;
        }

        .form-group {
            margin-bottom: 1.2rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 0.8rem;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 1rem;
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--color-primario);
        }

        /* Usuario logueado */
        .user-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #333;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--color-primario);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
        }

        /* Loading */
        .loading {
            text-align: center;
            padding: 4rem;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid var(--color-primario);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 1rem;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .no-results {
            text-align: center;
            padding: 4rem;
            color: #666;
        }

        .no-results i { font-size: 4rem; color: #ddd; margin-bottom: 1rem; }

        /* Responsive */
        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                gap: 1rem;
            }

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

            .auctions-grid {
                grid-template-columns: 1fr;
            }

            .galeria-nav { display: none; }
            .zoom-controls { bottom: 80px; }
            .galeria-indicadores { bottom: 140px; }
        }

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