/* ========================================
   TATA MOTORS ITALIA — 2026 Premium Theme
   ======================================== */

:root {
    --primary: #ff6a00;
    --primary-hover: #ff8c33;
    --primary-glow: rgba(255, 106, 0, 0.35);
    --secondary: #ff9d4d;
    --bg-dark: #06060a;
    --bg-surface: #0e0e14;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-glass: rgba(14, 14, 20, 0.65);
    --bg-glass-hover: rgba(14, 14, 20, 0.8);
    --text-main: #f0f0f5;
    --text-dim: #8e8ea0;
    --text-muted: #5a5a6e;
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --accent-glow: rgba(255, 106, 0, 0.25);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Glassmorphism ── */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--border-glass);
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.glass:hover {
    border-color: var(--border-hover);
}

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── Header ── */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
    transition: var(--transition-slow);
    border-bottom: 1px solid transparent;
}

header.scrolled {
    height: 64px;
    background: rgba(6, 6, 10, 0.85);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border-bottom: 1px solid var(--border-glass);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    height: 40px;
    filter: brightness(0) invert(1);
    transition: var(--transition-fast);
}

.logo:hover img {
    filter: brightness(0) invert(1) drop-shadow(0 0 10px var(--primary-glow));
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

nav ul li a {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition-fast);
}

nav ul li a:hover,
nav ul li.current-menu-item a,
nav ul li.current_page_item a {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transition: transform var(--transition-fast);
}

nav ul li a:hover::after,
nav ul li.current-menu-item a::after,
nav ul li.current_page_item a::after {
    transform: translateX(-50%) scaleX(1);
}

/* ── Hamburger Menu ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition-fast);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Swiper / Hero ── */
.swiper {
    width: 100%;
    height: 100vh;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.swiper-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(6, 6, 10, 0.3) 0%,
            rgba(6, 6, 10, 0.5) 50%,
            var(--bg-dark) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    text-align: center;
    padding: 0 2rem;
}

.hero-content h1 {
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #d0d0d8 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
    width: 10px;
    height: 10px;
    transition: var(--transition-fast);
}

.swiper-pagination-bullet-active {
    background: var(--primary);
    width: 28px;
    border-radius: 5px;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #e65f00 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--accent-glow);
    transition: var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px var(--accent-glow), var(--shadow-glow);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2.2rem;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    border-radius: var(--radius-sm);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: var(--transition-spring);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 36px var(--accent-glow);
}

/* ── Sections ── */
section {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title h2 {
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #fff, var(--text-dim));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title .divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    margin: 0 auto;
    border-radius: 2px;
    box-shadow: 0 0 16px var(--primary-glow);
}

.section-subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1rem auto 0;
    text-align: center;
}

/* ── Page Banners ── */
.page-banner {
    height: 45vh;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.page-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(6, 6, 10, 0.4) 0%,
            rgba(6, 6, 10, 0.6) 50%,
            var(--bg-dark) 100%);
}

.page-banner h1 {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #fff 0%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Gallery Grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    position: relative;
    transition: var(--transition-spring);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 106, 0, 0.3);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(255, 106, 0, 0.1);
}

.gallery-item:hover img {
    transform: scale(1.12);
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 6, 10, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition-fast);
}

.gallery-item:hover::after {
    opacity: 1;
}

/* ── Services Grid ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-spring);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: var(--transition-slow);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 106, 0, 0.3);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(255, 106, 0, 0.08);
    background: var(--bg-glass-hover);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    display: inline-block;
    filter: drop-shadow(0 4px 12px var(--primary-glow));
}

.service-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.8rem;
}

.service-card p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ── Stats / Counter ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item .number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
}

.stat-item .label {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

/* ── Footer ── */
footer {
    padding: 5rem 0 2rem;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #030306 100%);
    border-top: 1px solid var(--border-glass);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    color: #fff;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-col ul li i {
    margin-right: 8px;
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* ── Animations ── */
.animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays for children */
.stagger>*:nth-child(1) {
    transition-delay: 0s;
}

.stagger>*:nth-child(2) {
    transition-delay: 0.1s;
}

.stagger>*:nth-child(3) {
    transition-delay: 0.2s;
}

.stagger>*:nth-child(4) {
    transition-delay: 0.25s;
}

.stagger>*:nth-child(5) {
    transition-delay: 0.3s;
}

.stagger>*:nth-child(6) {
    transition-delay: 0.35s;
}

/* ── WordPress Entry Content ── */
.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dim);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: var(--text-main);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content a {
    color: var(--primary);
    border-bottom: 1px solid rgba(255, 106, 0, 0.3);
}

.entry-content a:hover {
    border-bottom-color: var(--primary);
}

.entry-content img {
    border-radius: var(--radius-md);
    margin: 2rem 0;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

/* ── Map Section ── */
.map-container {
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-lg);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: invert(90%) hue-rotate(180deg);
}

/* ── Glow accents ── */
.glow-accent {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.3;
    filter: blur(80px);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {

    /* Mobile nav */
    .hamburger {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(6, 6, 10, 0.97);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        padding: 100px 2rem 2rem;
        transition: right var(--transition-slow);
        border-left: 1px solid var(--border-glass);
        z-index: 999;
    }

    nav.open {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0.25rem;
    }

    nav ul li a {
        display: block;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }

    /* Mobile overlay */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-fast);
        z-index: 998;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Content adjustments */
    .container {
        padding: 0 1.25rem;
    }

    section {
        padding: 4rem 0;
    }

    .section-title {
        margin-bottom: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .service-card {
        padding: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-item .number {
        font-size: 2.2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: clamp(2rem, 7vw, 3rem);
    }

    .hero-content p {
        font-size: 1rem;
    }

    .page-banner {
        height: 35vh;
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Form Inputs ── */
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Responsive: Inline grids used in templates ── */
@media (max-width: 768px) {

    /* Contatti two-column grid → stack */
    [style*="grid-template-columns: 1fr 1.5fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Ricambi split grid → stack */
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Form name/email row → stack */
    form [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── Selection ── */
::selection {
    background: var(--primary);
    color: #fff;
}