/* ============================================
   PODIUM - RESPONSIVE DESIGN SYSTEM
   Mobile-First Approach
   ============================================ */

/* ============================================
   VARIABLES Y CONFIGURACIÓN GENERAL
   ============================================ */
:root {
    --primary-color: #1A1A1A;
    --secondary-color: #FFFFFF;
    --dark-bg: #000000;
    --light-bg: #F5F5F5;
    --text-dark: #0A0A0A;
    --text-light: #737373;
    --transition: all 0.3s ease;
    
    /* Spacing System */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Responsive Breakpoints */
    --screen-sm: 640px;
    --screen-md: 768px;
    --screen-lg: 1024px;
    --screen-xl: 1280px;
    --screen-2xl: 1536px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

/* Responsive font scaling */
@media screen and (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

@media screen and (min-width: 1280px) {
    html {
        font-size: 18px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   FLUID TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter Display', 'Inter', sans-serif;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(2rem, 5vw + 1rem, 4rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw + 1rem, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
}

h4 {
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
}

h5 {
    font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.5rem);
}

h6 {
    font-size: clamp(1rem, 1vw + 0.5rem, 1.25rem);
}

p {
    font-size: clamp(1rem, 0.5vw + 0.875rem, 1.125rem);
    margin-bottom: var(--space-sm);
}

/* ============================================
   RESPONSIVE CONTAINERS
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

@media screen and (min-width: 640px) {
    .container {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }
}

@media screen and (min-width: 1024px) {
    .container {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}

/* ============================================
   RESPONSIVE GRID SYSTEM
   ============================================ */
.grid-responsive {
    display: grid;
    gap: var(--space-md);
}

@media screen and (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (min-width: 1280px) {
    .grid-responsive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   LOADING SKELETON - RESPONSIVE
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
}

.dark .skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   GLASS MORPHISM EFFECTS
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   RESPONSIVE BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-size: clamp(0.875rem, 1vw, 1rem);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #FBBF24);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

/* Mobile: Stack buttons vertically */
@media screen and (max-width: 640px) {
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* Desktop: Horizontal layout */
@media screen and (min-width: 641px) {
    .btn-group {
        display: flex;
        flex-direction: row;
        gap: var(--space-md);
    }
}

/* ============================================
   RESPONSIVE FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 16px; /* Prevent zoom on iOS */
    border: 2px solid #E5E7EB;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Responsive form layouts */
@media screen and (min-width: 768px) {
    .form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

/* ============================================
   RESPONSIVE IMAGES
   ============================================ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-responsive {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Aspect ratio containers */
.aspect-ratio-16-9 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
}

.aspect-ratio-4-3 {
    position: relative;
    padding-bottom: 75%; /* 4:3 */
    overflow: hidden;
}

.aspect-ratio-1-1 {
    position: relative;
    padding-bottom: 100%; /* 1:1 */
    overflow: hidden;
}

.aspect-ratio-16-9 img,
.aspect-ratio-4-3 img,
.aspect-ratio-1-1 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   RESPONSIVE NAVIGATION
   ============================================ */
.nav-mobile-only {
    display: block;
}

.nav-desktop-only {
    display: none;
}

@media screen and (min-width: 1024px) {
    .nav-mobile-only {
        display: none;
    }
    
    .nav-desktop-only {
        display: block;
    }
}

/* ============================================
   RESPONSIVE SPACING UTILITIES
   ============================================ */
.section-padding {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

@media screen and (min-width: 768px) {
    .section-padding {
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-2xl);
    }
}

@media screen and (min-width: 1024px) {
    .section-padding {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* ============================================
   RESPONSIVE CARD COMPONENTS
   ============================================ */
.card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

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

.card-body {
    padding: var(--space-md);
}

@media screen and (min-width: 768px) {
    .card-body {
        padding: var(--space-lg);
    }
}

/* ============================================
   RESPONSIVE VIDEO HERO SECTIONS
   ============================================ */
.hero-video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 500px;
    max-height: 900px;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Mobile: Reduce hero height */
@media screen and (max-width: 768px) {
    .hero-video-container {
        height: 70vh;
        min-height: 400px;
    }
}

/* ============================================
   RESPONSIVE TEXT ALIGNMENT
   ============================================ */
.text-center-mobile {
    text-align: center;
}

@media screen and (min-width: 768px) {
    .text-center-mobile {
        text-align: left;
    }
}

/* ============================================
   RESPONSIVE DISPLAY UTILITIES
   ============================================ */
.hidden-mobile {
    display: none;
}

@media screen and (min-width: 640px) {
    .hidden-mobile {
        display: block;
    }
}

.hidden-tablet {
    display: block;
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .hidden-tablet {
        display: none;
    }
}

.hidden-desktop {
    display: block;
}

@media screen and (min-width: 1024px) {
    .hidden-desktop {
        display: none;
    }
}

/* ============================================
   RESPONSIVE OVERFLOW HANDLING
   ============================================ */
.overflow-x-hidden {
    overflow-x: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* ============================================
   RESPONSIVE FLEXBOX UTILITIES
   ============================================ */
.flex-mobile-column {
    display: flex;
    flex-direction: column;
}

@media screen and (min-width: 768px) {
    .flex-mobile-column {
        flex-direction: row;
    }
}

/* ============================================
   TOUCH FRIENDLY ELEMENTS
   ============================================ */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   RESPONSIVE MODAL/DRAWER
   ============================================ */
.drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.drawer.open {
    right: 0;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE TABLES
   ============================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 768px) {
    .table-responsive table {
        display: block;
        width: 100%;
    }
    
    .table-responsive thead {
        display: none;
    }
    
    .table-responsive tbody {
        display: block;
    }
    
    .table-responsive tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #E5E7EB;
        border-radius: 0.5rem;
        padding: 1rem;
    }
    
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid #E5E7EB;
    }
    
    .table-responsive td:last-child {
        border-bottom: none;
    }
    
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
    }
}

/* ============================================
   RESPONSIVE STATS/COUNTERS
   ============================================ */
.stats-container {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: repeat(2, 1fr);
}

@media screen and (min-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-item {
    text-align: center;
    padding: var(--space-md);
}

.stat-number {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1;
    color: var(--primary-color);
}

.stat-label {
    font-size: clamp(0.875rem, 1vw, 1rem);
    color: var(--text-light);
    margin-top: var(--space-xs);
}

/* ============================================
   RESPONSIVE VEHICLE CARDS
   ============================================ */
.vehicle-grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: 1fr;
}

@media screen and (min-width: 640px) {
    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.vehicle-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

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

.vehicle-card-image {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
    overflow: hidden;
}

.vehicle-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vehicle-card:hover .vehicle-card-image img {
    transform: scale(1.1);
}

.vehicle-card-body {
    padding: var(--space-md);
}

@media screen and (min-width: 768px) {
    .vehicle-card-body {
        padding: var(--space-lg);
    }
}

/* ============================================
   RESPONSIVE BREADCRUMBS
   ============================================ */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: var(--space-sm) 0;
    font-size: clamp(0.875rem, 1vw, 1rem);
}

@media screen and (max-width: 640px) {
    .breadcrumb {
        font-size: 0.75rem;
    }
}

/* ============================================
   RESPONSIVE FOOTER
   ============================================ */
.footer-logo {
    display: block;
    height: 8rem;
    width: auto;
    margin-top: -5.5rem;
    margin-bottom: -1rem;
    margin-left: -3rem;
    position: sticky;
    object-fit: contain;
}

.footer-logo + p {
    margin-top: -2.5rem;
}

@media screen and (min-width: 640px) {
    .footer-logo {
        height: 10rem;
        margin-top: -7rem;
        margin-bottom: -1.5rem;
        margin-left: -3.5rem;
    }
    
    .footer-logo + p {
        margin-top: -3.5rem;
    }
}

@media screen and (min-width: 1024px) {
    .footer-logo {
        height: 15rem;
        margin-top: -9.3rem;
        margin-bottom: -2rem;
        margin-left: -4.8rem;
    }
    
    .footer-logo + p {
        margin-top: -5.5rem;
    }
}

.footer-grid {
    display: grid;
    gap: var(--space-xl);
    grid-template-columns: 1fr;
}

@media screen and (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   ACCESSIBILITY - SKIP TO CONTENT
   ============================================ */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: #000;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    img {
        max-width: 100% !important;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #FFD700;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION MOBILE
   ============================================ */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .hero-video-container {
        height: 100vh;
    }
}

/* ============================================
   NAVBAR & MOBILE MENU ENHANCEMENTS
   ============================================ */
#mobileMenuBtn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#mobileMenu {
    /* Smooth scrolling for mobile menu */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.1);
}

#mobileMenu::-webkit-scrollbar {
    width: 4px;
}

#mobileMenu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#mobileMenu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* Mobile menu links */
.mobile-nav-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Navbar improvements for all screen sizes */
#mainNav {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
    will-change: background-color, box-shadow;
}

#mainNav.scrolled {
    background-color: rgba(0, 0, 0, 0.98) !important;
    box-shadow: 0 10px 50px rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(30px);
}

/* Icon transitions */
#menuIcon, #closeIcon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Responsive padding adjustments for navbar */
@media screen and (max-width: 639px) {
    #mainNav .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media screen and (min-width: 640px) and (max-width: 767px) {
    #mainNav .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Better touch targets for mobile */
@media screen and (max-width: 1023px) {
    #mobileMenuBtn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-nav-link {
        min-height: 48px;
    }
}

/* ============================================
   SMALL MOBILE FIXES (320px - 375px)
   ============================================ */
@media screen and (max-width: 375px) {
    /* Prevent horizontal overflow */
    body {
        overflow-x: hidden;
    }
    
    /* Container adjustments */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Text size adjustments */
    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        line-height: 1.2;
    }
    
    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    h3 {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
    }
    
    /* Button adjustments */
    .btn, button, a.btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
    
    /* Stats counters */
    .counter {
        font-size: clamp(2.5rem, 10vw, 3.5rem);
    }
    
    /* Prevent text from breaking layout */
    p, span, a {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Footer adjustments */
    footer {
        padding-top: 2rem;
        padding-bottom: 1.5rem;
    }
    
    footer h3, footer h4 {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
    }
    
    /* Card padding */
    .card, .vehicle-card {
        padding: 0.75rem;
    }
    
    /* Grid gaps */
    .grid {
        gap: 0.75rem;
    }
    
    /* Tracking adjustments */
    .tracking-wider, .tracking-widest {
        letter-spacing: 0.05em;
    }
}

@media screen and (max-width: 320px) {
    /* Extra small devices */
    html {
        font-size: 14px;
    }
    
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    /* Force smaller buttons */
    .btn, button, a.btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

}