/* ===== VARIABLES CSS ===== */
:root {
    --primary-dark: #0d233c;
    --primary-accent: #0a58ca;
    --secondary-yellow: #ffc107;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --gradient-primary: linear-gradient(135deg, #0d233c 0%, #0a58ca 100%);
    --gradient-warning: linear-gradient(135deg, #a10303ff 0%, #af3838ff 100%);
    --gradient-admin: linear-gradient(135deg, #ffc107d3 0%, #ffc107 100%);
}

/* ===== ESTILOS GENERALES ===== */
body {
    font-family: "Roboto", sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    overflow-x: hidden;
}

/* ===== LAYOUT PÚBLICO ===== */
/* Navbar */
.navbar-dark {
    background: var(--gradient-primary) !important;
}

/* ===== DROPDOWN RESPONSIVE FIXES ===== */
.navbar-user-toggle {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    min-width: 0;
}

.navbar-user-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.navbar-user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

/* Responsive fixes para navbar */
@media (max-width: 991.98px) {
    .navbar-user-toggle {
        width: auto;
        margin: 0.5rem 0;
        justify-content: flex-start;
        background: rgba(255, 255, 255, 0.05);
    }

    .navbar-user-name {
        max-width: 120px;
    }

    .navbar-nav .dropdown-menu {
        position: static !important;
        transform: none !important;
        margin: 0.5rem 0 0 1rem;
        width: calc(100% - 2rem);
        box-shadow: none;
        border-radius: 10px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.95);
    }

    .navbar-collapse {
        padding: 1rem 0;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }

    /* Asegurar que el dropdown se muestre correctamente */
    .navbar-nav .dropdown-menu.show {
        display: block !important;
    }
}

@media (max-width: 575.98px) {
    .navbar-user-name {
        max-width: 100px;
        font-size: 0.9rem;
    }

    .navbar-user-toggle {
        padding: 0.4rem 0.6rem;
    }

    .navbar-nav .dropdown-menu {
        width: calc(100% - 1rem);
        margin: 0.5rem 0 0 0.5rem;
    }

    .btn-responsive-text {
        display: none;
    }
}

/* Mejoras visuales para el dropdown en móviles */
.navbar-nav .dropdown-menu {
    animation: dropdownSlide 0.3s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Asegurar que los botones sean táctiles en móviles */
@media (max-width: 991.98px) {
    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Fix para el contenedor del navbar */
.navbar-collapse {
    overflow: visible;
}

.navbar-nav {
    align-items: center;
}

/* Responsividad para el dropdown */
@media (max-width: 768px) {
    .navbar-user-name {
        max-width: 120px;
    }

    .navbar .dropdown-menu {
        margin-top: 5px;
        min-width: 250px;
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 70px !important;
    }

    .navbar .dropdown-toggle::after {
        margin-left: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-user-name {
        max-width: 100px;
        font-size: 0.9rem;
    }

    .navbar .dropdown-menu {
        min-width: 220px;
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
    }
}

/* Efectos de hover mejorados */
.navbar .dropdown-item:active {
    background: var(--gradient-primary);
    color: white;
}

/* Estilo para el header del dropdown */
.dropdown-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

/* Transiciones suaves */
.navbar .dropdown-menu {
    animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animaciones y efectos */
.floating-element {
    animation: floatElement 4s ease-in-out infinite;
}

@keyframes floatElement {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(3deg);
    }
    66% {
        transform: translateY(5px) rotate(-3deg);
    }
}

.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
}

.btn-glow::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-primary-glow {
    background: var(--gradient-primary);
    color: white;
}

.btn-warning-glow {
    background: var(--gradient-warning);
    color: var(--primary-dark);
}

.btn-warning-admin {
    background: var(--gradient-admin);
    color: var(--primary-dark);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Navegación */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-yellow);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--secondary-yellow) !important;
}

/* Footer */
footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--secondary-yellow) !important;
}

/* ===== HERO SECTIONS ===== */
.hero-section,
.catalog-hero,
.detail-hero {
    background: linear-gradient(rgba(13, 35, 60, 0.85), rgba(13, 35, 60, 0.95)),
        url("https://images.unsplash.com/photo-1494976388531-d1058494cdd8?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80")
            center/cover no-repeat;
    color: white;
    padding: 10rem 0 8rem;
    position: relative;
    overflow: hidden;
}

.catalog-hero {
    background: linear-gradient(rgba(13, 35, 60, 0.85), rgba(13, 35, 60, 0.95)),
        url("https://images.unsplash.com/photo-1486496572940-2bb2341fdbdf?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80")
            center/cover no-repeat;
    padding: 6rem 0 4rem;
}

.detail-hero {
    background: linear-gradient(rgba(13, 35, 60, 0.85), rgba(13, 35, 60, 0.95)),
        url("https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80")
            center/cover no-repeat;
    padding: 4rem 0 2rem;
}

.hero-section::before,
.catalog-hero::before,
.detail-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.1;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Animaciones hero */
.floating-car {
    animation: float 6s ease-in-out infinite;
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotateX(0deg);
    }
    50% {
        transform: translateY(-20px) rotateX(5deg);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

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

/* ===== COMPONENTES REUTILIZABLES ===== */
/* Feature Icons */
.feature-icon {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    transition: all 0.5s ease;
    transform-style: preserve-3d;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Estilos específicos para avatar editing en el perfil */
.profile-avatar label span#edit-avatar-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(13,35,60,0.12);
}
.profile-avatar label span#edit-avatar-btn:focus,
.profile-avatar label span#edit-avatar-btn:active {
    outline: 3px solid rgba(10,88,202,0.15);
}

.feature-icon:hover {
    transform: translateY(-10px) rotateY(10deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Vehicle Cards */
.vehicle-card {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    background: white;
    height: 100%;
}

.vehicle-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.vehicle-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.vehicle-card:hover::before {
    transform: scaleX(1);
}

/* Price Tag */
.price-tag {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-warning);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Badges */
.badge-feature {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
}

/* ===== SECCIONES ESPECÍFICAS ===== */
/* Filter Section */
.filter-section {
    background: white;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.form-select,
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 0.2rem rgba(10, 88, 202, 0.25);
}

.filter-transition {
    transition: all 0.3s ease-in-out;
}

/* Stats Section */
.stats-section {
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 1px,
        transparent 1px
    );
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(-50px, -50px) rotate(360deg);
    }
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.hero-stats {
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Breadcrumb */
.breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1rem 1.5rem;
}

.breadcrumb-item a {
    color: var(--secondary-yellow);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: white;
}

/* Gallery */
.gallery-main {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.gallery-thumb {
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    transform: scale(1.05);
    border-color: var(--primary-accent);
}

/* Info Cards */
.info-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Variantes para tarjetas pequeñas (misión/visión) */
.info-card {
    padding: 1rem;
}
.info-card .feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}
.info-card h4,
.info-card h3 {
    font-weight: 700;
}
.info-card p {
    color: var(--dark-text);
    opacity: 0.9;
}

/* Small variant for centered feature icons inside info-card */
.feature-icon-sm {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.info-card .h3 {
    font-size: 1.5rem;
}
.info-card.text-center .feature-icon {
    margin: 0 auto 10px;
}
.info-card.text-center p {
    font-size: 1rem;
}

@media (max-width: 576px) {
    .feature-icon-sm {
        width: 64px;
        height: 64px;
    }
    .info-card .h3 {
        font-size: 1.25rem;
    }
}

/* Utility: justificar texto */
.text-justify {
    text-align: justify;
    text-justify: inter-word;
}

.card-header {
    background: var(--gradient-primary);
    border: none;
    padding: 1.5rem;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Contact Card */
.contact-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
}

/* Specs */
.spec-item {
    padding: 1rem;
    border-radius: 10px;
    background: var(--light-bg);
    transition: all 0.3s ease;
}

.spec-item:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
}

.spec-item:hover i,
.spec-item:hover small {
    color: white !important;
}

/* Pagination */
.pagination .page-link {
    border-radius: 10px;
    margin: 0 2px;
    border: none;
    color: var(--primary-dark);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary-accent);
}

/* Empty State */
.empty-state {
    padding: 4rem 0;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

/* ===== RESPONSIVIDAD ===== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.5rem;
    }

    .btn-responsive {
        width: 100%;
        margin-top: 10px;
    }

    .footer-content {
        text-align: center;
    }

    .footer-content .col-md-4 {
        margin-bottom: 2rem;
    }

    .social-links {
        justify-content: center;
        display: flex;
        margin-top: 1rem;
    }

    .catalog-hero {
        padding: 4rem 0 2rem;
    }

    .filter-section {
        margin-top: -30px;
    }

    .filter-section .col-md-2 {
        margin-bottom: 1rem;
    }

    .vehicle-card {
        margin-bottom: 2rem;
    }

    .vehicle-card .position-relative,
    .gallery-main-container {
        position: relative;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .detail-hero {
        padding: 3rem 0 1rem;
    }

    .contact-card {
        position: relative;
        top: 0;
        margin-top: 2rem;
    }

    .price-tag {
        font-size: 2rem;
    }

    .gallery-thumbs {
        justify-content: center;
    }

    .hero-stats .stat-number {
        font-size: 2rem !important;
    }

    .hero-stats .col-4 {
        padding: 0 5px;
    }
}

@media (max-width: 576px) {
    .filter-section .col-md-2 {
        width: 50%;
    }

    .vehicle-specs .col-4 {
        margin-bottom: 0.5rem;
    }

    .spec-item {
        margin-bottom: 0.5rem;
    }

    .btn-responsive {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ===== PÁGINAS DE AUTENTICACIÓN ===== */
.auth-hero {
    background: linear-gradient(rgba(13, 35, 60, 0.85), rgba(13, 35, 60, 0.95)),
        url("https://images.unsplash.com/photo-1486496572940-2bb2341fdbdf?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80")
            center/cover no-repeat;
    color: white;
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.auth-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.1;
    z-index: 1;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.auth-header {
    background: var(--gradient-primary);
    padding: 2rem;
    text-align: center;
    color: white;
}

.auth-body {
    padding: 2.5rem;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

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

.form-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 0.2rem rgba(10, 88, 202, 0.25);
    outline: none;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-check-input {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.form-check-label {
    color: var(--dark-text);
    font-size: 0.9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: #6c757d;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.9rem;
}

.social-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-social:hover {
    border-color: var(--primary-accent);
    transform: translateY(-2px);
}

.btn-social i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.btn-google {
    color: #db4437;
}

.btn-facebook {
    color: #4267b2;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.auth-footer a {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

/* Animaciones específicas para auth */
.auth-fade-in {
    animation: authFadeIn 0.8s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.floating-form {
    animation: floatingForm 6s ease-in-out infinite;
}

@keyframes floatingForm {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsividad para auth */
@media (max-width: 768px) {
    .auth-hero {
        padding: 4rem 0 2rem;
    }

    .auth-card {
        margin-top: -30px;
    }

    .auth-body {
        padding: 2rem 1.5rem;
    }

    .social-auth {
        grid-template-columns: 1fr;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .auth-body {
        padding: 1.5rem 1rem;
    }

    .auth-header {
        padding: 1.5rem;
    }

    .auth-icon {
        width: 60px;
        height: 60px;
    }

    .auth-icon i {
        font-size: 1.5rem;
    }
}

/* ===== GALERÍA MODERNA ===== */

.gallery-modern .gallery-main-container {
    border-radius: 15px;
    overflow: hidden;
}

.gallery-main-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.gallery-main-image:hover {
    transform: scale(1.02);
}

.gallery-overlay {
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-in;
}

.gallery-main-container:hover .gallery-overlay {
    opacity: 1;
}

.gallery-thumbs-scroll::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbs-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.gallery-thumbs-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-accent);
    border-radius: 10px;
}

.gallery-thumb {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    transform: scale(1.1);
    border-color: var(--primary-accent);
}

.modal-thumb {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.modal-thumb:hover,
.modal-thumb.active {
    border-color: #fff;
    transform: scale(1.1);
}

/* Estilos para el sistema de reseñas */
.rating-input {
    display: flex;
    gap: 5px;
}

/* ===== ESTILOS DE PERFIL (Dashboard / Settings) ===== */
.profile-hero {
    background: linear-gradient(rgba(13, 35, 60, 0.85), rgba(13, 35, 60, 0.95)),
        url('https://images.unsplash.com/photo-1568605117036-5fe5e7bab0b7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    color: white;
    padding: 6rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.profile-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.1;
    z-index: 1;
}

.profile-sidebar {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: sticky;
    top: 100px;
}

.profile-menu-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--dark-text);
    display: block;
}

.profile-menu-item:hover,
.profile-menu-item.active {
    background: var(--gradient-primary);
    color: white;
}

.profile-menu-item i {
    width: 20px;
    margin-right: 10px;
}

.profile-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.profile-header {
    background: var(--gradient-primary);
    padding: 2rem;
    color: white;
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border: 4px solid white;
}

.stats-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 15px;
    background: var(--light-bg);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.activity-item {
    padding: 1rem;
    border-left: 4px solid var(--primary-accent);
    background: var(--light-bg);
    margin-bottom: 1rem;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
}

.activity-item:hover {
    transform: translateX(5px);
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .profile-sidebar {
        margin-bottom: 2rem;
        position: relative;
        top: 0;
    }

    .stats-card {
        margin-bottom: 1rem;
    }
}

/* ===== ESTILOS PARA PÁGINA DE AJUSTES (Preferencias / Cambiar Contraseña / Tarjetas) ===== */
.profile-settings .card {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(12, 35, 64, 0.08);
    margin-bottom: 1.5rem;
}

.profile-settings .card-header {
    background: linear-gradient(90deg, rgba(10,88,202,0.95), rgba(7,125,204,0.95));
    color: #fff;
    font-weight: 700;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.profile-settings .card-header i {
    background: rgba(255,255,255,0.12);
    padding: 0.5rem;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-settings .card-body {
    background: #ffffff;
    padding: 1.25rem;
}

.profile-settings label,
.profile-settings .form-check-label,
.profile-settings .form-label {
    font-weight: 600;
    color: var(--dark-text);
}

.profile-settings .form-control {
    border-radius: 10px;
    border: 1px solid rgba(25, 40, 60, 0.08);
    padding: 0.6rem 0.75rem;
    box-shadow: none;
}

.profile-settings .form-control:focus {
    border-color: rgba(10,88,202,0.9);
    box-shadow: 0 6px 18px rgba(10,88,202,0.08);
}

.profile-settings .btn-primary {
    background: linear-gradient(90deg, #0a58ca, #077dcc);
    border: none;
    box-shadow: 0 8px 22px rgba(7,125,204,0.12);
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-weight: 700;
}

.profile-settings .btn-success {
    background: linear-gradient(90deg, #0bb35a, #07a657);
    border: none;
    border-radius: 10px;
}

.profile-settings .small.text-muted {
    color: #6c757d !important;
}

/* Ajustes para el formulario de cambio de contraseña (partial) */
.profile-settings section > header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--dark-text);
}

.profile-settings section > header p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.profile-settings .x-input-error,
.profile-settings .text-danger {
    color: #dc3545;
}

@media (max-width: 768px) {
    .profile-settings .card-header { font-size: 1rem; }
}


.rating-input input[type="radio"] {
    display: none;
}

.rating-input .star-label {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-input input[type="radio"]:checked ~ .star-label,
.rating-input .star-label:hover,
.rating-input .star-label:hover ~ .star-label {
    color: #ffc107;
}

.rating-input input[type="radio"]:checked + .star-label {
    color: #ffc107;
}

.review-item {
    transition: background-color 0.3s;
}

.review-item:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

/* Overlay para vehículos vendidos - CORREGIDO */
.sold-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(220, 53, 69, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: 12px;
    pointer-events: none; /* Permite hacer clic en la imagen debajo */
}

.sold-text {
    color: white;
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    transform: rotate(-45deg);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    border: 5px solid white;
    padding: 20px 40px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.3);
    animation: pulse-sold 2s infinite;
}

@keyframes pulse-sold {
    0% {
        transform: rotate(-45deg) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: rotate(-45deg) scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% {
        transform: rotate(-45deg) scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Asegurar que el contenedor de la imagen tenga posición relativa */
.gallery-main-container .position-relative {
    position: relative !important;
}

/* Para las tarjetas en home y catálogo */
.vehicle-card .position-relative {
    position: relative !important;
}

.vehicle-card .sold-overlay {
    border-radius: 8px;
}

.vehicle-card .sold-text {
    font-size: 2rem;
    padding: 15px 25px;
    border-width: 3px;
}

/* Responsive para overlay */
@media (max-width: 768px) {
    .sold-text {
        font-size: 1.5rem;
        padding: 10px 20px;
        letter-spacing: 2px;
    }

    .vehicle-card .sold-text {
        font-size: 1.2rem;
        padding: 8px 15px;
    }
}

/* ===== TESTIMONIOS / SLIDER ===== */
.testimonial-slider {
    position: relative;
}
.testimonial-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.45s cubic-bezier(0.22, 0.9, 0.35, 1);
}
.testimonial-slide {
    flex: 0 0 calc((100% - 2rem) / 3);
    max-width: calc((100% - 2rem) / 3);
    opacity: 1;
    transform: none;
}
.testimonial-slide .card {
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(13, 35, 60, 0.06);
    border: 1px solid rgba(13, 35, 60, 0.04);
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fff);
}
.testimonial-slide .avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.testimonial-meta h5 {
    margin-bottom: 0.25rem;
    font-weight: 700;
}
.testimonial-meta .stars {
    color: var(--secondary-yellow);
}
.testimonial-slide p {
    color: var(--dark-text);
    opacity: 0.9;
}
.testimonial-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}
.testimonial-wrapper {
    padding: 0.5rem;
}

/* Visual polish: hover and focused state */
.testimonial-slide .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 60px rgba(13, 35, 60, 0.08);
}

@media (max-width: 991.98px) {
    .testimonial-slide {
        flex: 0 0 calc((100% - 1rem) / 2);
        max-width: calc((100% - 1rem) / 2);
    }
}

@media (max-width: 575.98px) {
    .testimonial-track {
        flex-direction: column;
    }
    .testimonial-slide {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .testimonial-slide .card {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .sold-text {
        font-size: 1.2rem;
        padding: 8px 15px;
        letter-spacing: 1px;
    }

    /* ===== DRIVER.JS THEME INTEGRATION ===== */
    /* Estilos para popovers y resaltados de Driver.js, adaptados al tema de la web */
    .driver-popover {
        background: var(--primary-accent);
        color: #fff;
        border-radius: 12px;
        box-shadow: 0 20px 60px rgba(13, 35, 60, 0.35);
        max-width: 340px;
    }
    .driver-popover .driver-title {
        font-weight: 700;
        color: #fff;
        margin-bottom: 0.25rem;
    }
    .driver-popover .driver-description {
        color: rgba(255, 255, 255, 0.95);
        line-height: 1.35;
    }
    .driver-popover .driver-buttons .driver-btn {
        background: linear-gradient(
            90deg,
            rgba(255, 193, 7, 0.95),
            rgba(255, 193, 7, 0.85)
        );
        color: var(--primary-dark);
        border: none;
        padding: 0.45rem 0.85rem;
        border-radius: 8px;
        box-shadow: 0 6px 18px rgba(10, 88, 202, 0.12);
    }
    .driver-overlay,
    .driver-layer {
        background: rgba(13, 35, 60, 0.6) !important;
    }
    .driver-highlight {
        box-shadow: 0 0 0 8px rgba(10, 88, 202, 0.12),
            0 18px 40px rgba(13, 35, 60, 0.18) !important;
        border-radius: 14px !important;
        outline: 3px solid rgba(255, 193, 7, 0.08) !important;
    }

    /* Especial: darle un tratamiento más grande y amable al hero cuando es resaltado */
    .driver-highlight.home-hero-highlight,
    .driver-highlight[data-driver-target="#home-hero"] {
        border-radius: 20px !important;
        box-shadow: 0 30px 80px rgba(13, 35, 60, 0.28) !important;
    }

    /* Asegurar botones y textos legibles en popovers pequeños */
    .driver-popover .driver-buttons {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        margin-top: 0.75rem;
    }

    .vehicle-card .sold-text {
        font-size: 1rem;
        padding: 6px 12px;
    }
}

/* ===== DRIVER.JS GLOBAL OVERRIDES ===== */
/* Colocadas al final del archivo para asegurar mayor prioridad que el CSS CDN de driver.js */
html body .driver-popover,
.driver-popover {
    background: var(--primary-accent) !important;
    color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(13, 35, 60, 0.35) !important;
    max-width: 420px !important;
    border: none !important;
}

html body .driver-popover .driver-title,
.driver-popover .driver-title {
    font-weight: 700 !important;
    color: #fff !important;
}

html body .driver-popover .driver-description,
.driver-popover .driver-description {
    color: rgba(255, 255, 255, 0.95) !important;
    line-height: 1.4 !important;
}

html body .driver-popover .driver-buttons .driver-btn,
.driver-popover .driver-buttons .driver-btn {
    background: linear-gradient(
        90deg,
        rgba(255, 193, 7, 0.95),
        rgba(255, 193, 7, 0.85)
    ) !important;
    color: var(--primary-dark) !important;
    border: none !important;
    padding: 0.45rem 0.85rem !important;
    border-radius: 8px !important;
}

/* Overlay y capa oscura */
html body .driver-overlay,
.driver-overlay,
html body .driver-layer,
.driver-layer {
    background: rgba(13, 35, 60, 0.6) !important;
}

/* Resaltado de elemento */
html body .driver-highlight,
.driver-highlight {
    box-shadow: 0 0 0 10px rgba(10, 88, 202, 0.1) !important;
    border-radius: 14px !important;
    outline: 3px solid rgba(255, 193, 7, 0.06) !important;
}

/* Especial para el hero del catálogo y el home */
.driver-highlight[data-driver-target="#catalog-hero"],
.driver-highlight[data-driver-target="#home-hero"],
.home-hero-highlight {
    border-radius: 18px !important;
    box-shadow: 0 30px 80px rgba(13, 35, 60, 0.28) !important;
    outline: 4px solid rgba(255, 193, 7, 0.06) !important;
}

/* Asegurar legibilidad y disposición de botones */
html body .driver-popover .driver-buttons {
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: flex-end !important;
    margin-top: 0.75rem !important;
}

/* Fallback: última prioridad con selector alto */
html body .driver-popover {
    background: var(--primary-accent) !important;
}
