/* Variables and Reset */
:root {
    --bg-dark: #0A0A0A;
    --bg-card: #141414;
    --primary-blue: #3B82F6;
    --primary-blue-dim: rgba(59, 130, 246, 0.7);
    --text-main: #F4F4F5;
    --text-muted: #A1A1AA;
    --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.3s ease;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 0;
    transition: background-color var(--transition-fast), padding var(--transition-fast);
}

#navbar.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

.logo img {
    height: 45px;
    filter: brightness(0) invert(1) contrast(1.2);
    transition: transform var(--transition-fast);
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links li a {
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-fast);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--primary-blue);
    transition: width var(--transition-fast);
}

.nav-links li a:hover {
    color: var(--primary-blue);
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links .btn-primary {
    background-color: transparent;
    border: 1px solid var(--primary-blue);
    padding: 10px 24px;
    color: var(--primary-blue);
}

.nav-links .btn-primary::after {
    display: none;
}

.nav-links .btn-primary:hover {
    background-color: var(--primary-blue);
    color: var(--bg-dark);
}

/* Hero Sections (Global) */
.hero, .ut-hero, .topic-header {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 5% 60px;
    overflow: hidden;
    background: linear-gradient(135deg, #0A0A0A 0%, #171717 100%);
}

.ut-hero {
    height: auto !important; /* Override internal style */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.15) 0%, rgba(10, 10, 10, 0) 60%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.03) 0%, rgba(10, 10, 10, 0) 40%);
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #0a0a0ae6 0%, #0a0a0ab3 50%, #0a0a0a4d 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-title {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}

.btn-primary.btn-large {
    display: inline-block;
    background-color: var(--primary-blue);
    color: var(--bg-dark);
    padding: 16px 40px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary.btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.2);
}

/* Featured Models */
.featured-models {
    padding: 120px 0;
    background-color: var(--bg-dark);
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-header h2 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 15px;
}

.separator {
    height: 3px;
    width: 60px;
    background-color: var(--primary-blue);
    margin: 0 auto;
}

.grid-models {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.car-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(59, 130, 246, 0.3);
}

.card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.car-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.car-card:hover .car-img {
    transform: scale(1.08);
}

.price-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(5px);
    color: var(--primary-blue);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--primary-blue-dim);
}

.card-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #fff;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
    flex-grow: 1;
}

.btn-secondary {
    align-self: flex-start;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 5px;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 1px;
    background-color: var(--primary-blue);
    transition: width var(--transition-fast);
}

.car-card:hover .btn-secondary::after {
    width: 100%;
}

/* Footer */
footer {
    background-color: #050505;
    padding: 80px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand img {
    height: 40px;
    filter: brightness(0) invert(1);
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-links h4,
.footer-contact h4 {
    color: #fff;
    margin-bottom: 25px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.footer-contact p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════
   HAMBURGER MENU & NAVIGATION
═══════════════════════════════════════════════ */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

.nav-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════════════════
   RESPONSIVENESS (Desktops, Tablets and Mobile)
═══════════════════════════════════════════════ */

/* Tablets / Medium Screens */
@media (max-width: 1024px) {
    .hero-title { font-size: 3.8rem; }
    .grid-models { grid-template-columns: repeat(2, 1fr); }
    .footer-content { grid-template-columns: 1fr 1.5fr; gap: 40px; }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -110%; /* Hidden by default */
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background-color: #0c0c0c;
        flex-direction: column;
        justify-content: center;
        gap: 35px;
        padding: 40px;
        z-index: 1000;
        transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        border-left: 1px solid rgba(255,255,255,0.05);
    }

    .nav-links.open { right: 0; }
    
    .nav-links li a { font-size: 1.2rem; }

    .hero {
        padding-left: 0;
        text-align: center;
        justify-content: center;
        padding-top: 100px;
    }
    .hero-content { padding: 0 5%; }
    .hero-title { font-size: 2.8rem; }
    .hero-subtitle { font-size: 1.1rem; }

    .section-header h2 { font-size: 2.3rem; }
    .featured-models { padding: 80px 0; }
    .footer-content { grid-template-columns: 1fr; }
}

/* Very Small Mobile (below 320px support) */
@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .section-header h2 { font-size: 1.8rem; }
    .grid-models { grid-template-columns: 1fr; }
    .card-content h3 { font-size: 1.4rem; }
    .logo img { height: 35px; }
}

/* Landscape Mode for Phones (very short viewport) */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding-top: 90px;
        padding-bottom: 50px;
        align-items: flex-start; /* Move up slightly to avoid cutting off buttons */
    }
    .hero-title { font-size: 2rem; margin-bottom: 10px; }
    .hero-subtitle { margin-bottom: 25px; font-size: 1rem; }
    #navbar.scrolled { padding: 8px 0; }
}

/* ═══════════════════════════════════════════════
   UNIT CONTENT & MISC FIXES
═══════════════════════════════════════════════ */
.ut-content-section {
    width: 100% !important;
    padding: 40px 5% !important;
}

@media (max-width: 768px) {
    .ut-content-section h2 { font-size: 2rem !important; }
    .ut-hero::before { font-size: 40vw !important; opacity: 0.03; }
}

@media (max-width: 480px) {
    .ut-content-section h2 { font-size: 1.6rem !important; }
    .ut-content-section p { font-size: 1rem !important; }
    .info-card { padding: 20px !important; margin: 25px 0 !important; }
}

/* Clases Adicionales para el Módulo FP */
.abstract-bg-1 {
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.abstract-bg-2 {
    background: linear-gradient(135deg, #141414 0%, #1f1f1f 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.abstract-bg-3 {
    background: linear-gradient(135deg, #111 0%, #171717 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.abstract-bg-4 {
    background: linear-gradient(135deg, #101010 0%, #151515 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.abstract-bg-5 {
    background: linear-gradient(135deg, #0e0e0e 0%, #171717 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.abstract-bg-6 {
    background: linear-gradient(135deg, #121212 0%, #181818 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ut-overlay {
    font-size: 10rem;
    font-weight: 700;
    color: rgba(59, 130, 246, 0.05);
    font-family: var(--font-heading);
    user-select: none;
    line-height: 1;
}

.badge-blue {
    display: inline-block;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue-dim);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Clases Adicionales para SOM */
.theme-som {
    --primary-blue: #10B981;
    --primary-blue-dim: rgba(16, 185, 129, 0.7);
}

.theme-som .hero::before {
    background: radial-gradient(circle at 70% 30%, rgba(16, 185, 129, 0.15) 0%, rgba(10, 10, 10, 0) 60%),
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.03) 0%, rgba(10, 10, 10, 0) 40%);
}

.theme-som .car-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(16, 185, 129, 0.3);
}

.theme-som .ut-overlay {
    color: rgba(16, 185, 129, 0.05);
}

.theme-som .badge-blue {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-blue);
    border-color: var(--primary-blue-dim);
}

.theme-som .btn-primary.btn-large:hover {
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.2);
}