/* ============================================
   CSS Variables - Customization Made Easy
   ============================================ */
:root {
    /* Colors */
    --color-primary: #000000;
    --color-secondary: #1a1a1a;
    --color-accent: #333333;
    --color-text: #2c2c2c;
    --color-text-light: #666666;
    --color-bg: #ffffff;
    --color-bg-light: #f8f8f8;
    --color-border: #e0e0e0;
    --color-overlay: rgba(0, 0, 0, 0.6);

    /* Typography */
    --font-primary: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Container */
    --container-max: 1400px;
    --container-padding: 2rem;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Elastic base font-size - scales proportionally across all mobile devices */
    font-size: calc(16px * (100vw / 430px));
}

/* Viewport-based proportional scaling system */
/* Each breakpoint uses a perfect reference device to maintain proportions */

/* Small tablets (481px-767px) - Smooth transition between mobile and tablet */
@media (min-width: 481px) and (max-width: 767px) {
    html {
        font-size: calc(16px * (100vw / 600px));
    }
}

/* Tablets portrait (768px-1023px) - Reference: iPad 6th gen / iPad mini 4 (768px = 16px) */
@media (min-width: 768px) and (max-width: 1023px) {
    html {
        font-size: calc(16px * (100vw / 768px));
    }
}

/* Tablets landscape (1024px-1279px) - Reference: iPad landscape (1024px = 16px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    html {
        font-size: calc(16px * (100vw / 1024px));
    }
}

/* Desktop (1280px+) - Reference: MacBook 1280x800 (1280px = 16px), capped at 20px for large screens */
@media (min-width: 1280px) {
    html {
        font-size: clamp(16px, calc(16px * (100vw / 1280px)), 20px);
    }
}

body {
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Removed fixed font-size - let it inherit from html scaling */
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    overflow: hidden;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Mobile-friendly viewport height */
}

body.menu-open {
    overflow: hidden;
}

body.modal-open {
    overflow: hidden;
}

body.loaded {
    animation: fadeIn 0.5s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-base);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ============================================
   Page Loader
   ============================================ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 50%, #f8f8f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.loader-logo {
    margin: 0 auto 3rem;
    text-align: center;
    width: 100%;
}

.loader-name {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: clamp(2.55rem, 5.4vw, 3rem);
    font-weight: 400;
    color: var(--color-primary);
    letter-spacing: 0;
    margin-bottom: 0.1rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: luxuryFadeIn 1.6s cubic-bezier(0.23, 1, 0.32, 1) 0.2s forwards;
    transform-origin: center center;
    white-space: nowrap;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

.loader-tagline {
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    font-weight: 300;
    color: var(--color-text-light);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: luxuryFadeIn 1.6s cubic-bezier(0.23, 1, 0.32, 1) 0.6s forwards;
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

.loader-bar {
    width: 18.75rem;
    height: 2px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.5s ease 1.2s forwards;
}

.loader-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.loader-progress {
    height: 100%;
    background: linear-gradient(90deg,
        var(--color-primary),
        var(--color-secondary),
        var(--color-primary)
    );
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    animation: loadProgress 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards,
               gradientShift 3s ease infinite;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

@keyframes elegantFadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes luxuryFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Animated Background - Page Loader Intro
   ============================================ */

/* Page Loader Intro Animation - Flowing golden waves */
.page-loader.bg-intro {
    /* BACKGROUND COLOR INTRO
       #1a1d2e, #0a0c15 blu
       #2b1d0e, #0d0604 marrone
       #1a1a1a, #000000 grigio scuro*/
    background: radial-gradient(ellipse at 20% 30%, #2b1d0e 0%, #0d0604 100%);
    overflow: hidden;
}

.page-loader.bg-intro::before {
    content: '';
    position: absolute;
    top: -75%;
    left: -75%;
    width: 250%;
    height: 250%;
    background:
        repeating-linear-gradient(
            60deg,
            transparent 0px,
            transparent 12px,
            rgba(180, 150, 100, 0.03) 12px,
            rgba(180, 150, 100, 0.03) 14px
        ),
        repeating-linear-gradient(
            120deg,
            transparent 0px,
            transparent 12px,
            rgba(180, 150, 100, 0.03) 12px,
            rgba(180, 150, 100, 0.03) 14px
        );
    animation: flowingWaves 20s linear infinite;
    z-index: 1;
}

.page-loader.bg-intro::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 18.75rem;
    height: 18.75rem;
    background: radial-gradient(circle, rgba(180, 150, 100, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulseGlow 4s ease-in-out infinite;
}

/* Keyframe Animations */
@keyframes flowingWaves {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        transform: translate(50%, 50%) rotate(360deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Text color overrides for dark backgrounds */
.page-loader.bg-intro .loader-name {
    color: #ffffff;
}

.page-loader.bg-intro .loader-tagline {
    color: rgba(255, 255, 255, 0.8);
}

.page-loader.bg-intro .loader-bar {
    background: rgba(255, 255, 255, 0.2);
}

.page-loader.bg-intro .loader-progress {
    background: linear-gradient(90deg, rgba(180, 150, 100, 0.8), rgba(255, 255, 255, 0.9));
}

@keyframes loadProgress {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    pointer-events: none;
}

.navbar {
    position: relative;
}

/* Hamburger Menu (Always Visible) */
.hamburger-menu {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    transition: all var(--transition-base);
}

.hamburger-menu:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
}

.hamburger-menu span {
    display: block;
    width: 1.5rem;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 2px;
    margin-bottom: 0.375rem;
}

.hamburger-menu span:last-child {
    margin-bottom: 0;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

/* Menu Panel - Laterale con maggiore trasparenza */
.menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 25rem;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Mobile-friendly viewport height */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px) saturate(120%);
    -webkit-backdrop-filter: blur(25px) saturate(120%);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1500;
    overflow-y: auto;
    pointer-events: all;
}

.menu-panel.active {
    transform: translateX(0);
}

.menu-panel-content {
    padding: 3rem 2rem;
}

/* Logo inside panel - in alto centrato */
.logo {
    margin-bottom: 3rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease 0.2s;
}

.menu-panel.active .logo {
    opacity: 1;
    transform: translateY(0);
}

.logo-img {
    height: 8.125rem;
    width: auto;
    margin: 0 auto;
}

/* Language Selector inside panel */
.language-selector {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease 0.5s;
    position: relative;
    text-align: center;
}

.menu-panel.active .language-selector {
    opacity: 1;
    transform: translateY(0);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    gap: 0.5rem;
}

.lang-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-name {
    display: none;
}

.flag-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 24px;
    height: 18px;
}

/* Mobile: show emoji flags (they work well on mobile) */
.flag-emoji {
    display: inline-block;
    font-size: 1.5rem;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

.flag-svg {
    display: none;
}

/* Desktop: show SVG flags (emoji flags don't render well on desktop) */
@media (min-width: 769px) {
    .flag-emoji {
        display: none;
    }

    .flag-svg {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .flag-svg svg {
        width: 24px;
        height: 18px;
        border-radius: 2px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
}

.chevron-icon {
    transition: transform var(--transition-base);
}

.language-selector.active .chevron-icon {
    transform: rotate(180deg);
}

/* Language Dropdown Menu - verso l'alto con 3D */
.lang-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    width: 12.5rem;
    max-height: 0;
    overflow: hidden;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
    border-radius: var(--radius-md);
    transition: max-height 0.4s ease, padding 0.4s ease, transform 0.4s ease, opacity 0.3s ease;
    padding: 0;
    box-shadow: none;
    border: none;
    transform-origin: center bottom;
    perspective: 1000px;
    opacity: 0;
}

.language-selector.active .lang-dropdown {
    max-height: 25rem;
    padding: 0.75rem 0;
    transform: translateX(-50%) translateY(-5px);
    opacity: 1;
    box-shadow:
        0 -12px 24px rgba(0, 0, 0, 0.15),
        0 -6px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    color: var(--color-text);
}

.lang-option:hover {
    background: white;
    padding-left: 1.5rem;
}

/* Dropdown flags sizing */
.lang-option .flag-container {
    width: 20px;
    height: 15px;
}

@media (min-width: 769px) {
    .lang-option .flag-svg svg {
        width: 20px;
        height: 15px;
    }
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
}

.nav-item {
    position: relative;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.4s ease;
}

.menu-panel.active .nav-item:nth-child(1) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.3s;
}

.menu-panel.active .nav-item:nth-child(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.35s;
}

.menu-panel.active .nav-item:nth-child(3) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.4s;
}

.menu-panel.active .nav-item:nth-child(4) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.45s;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 0.8rem 0;
    position: relative;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-link:hover {
    color: var(--color-primary);
    padding-left: 0.5rem;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle .chevron-icon {
    transition: transform var(--transition-base);
}

.dropdown.active .chevron-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    max-height: 0;
    overflow: hidden;
    background: transparent;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.dropdown.active .dropdown-menu {
    max-height: 500px;
    padding: 0.3rem 0;
}

.dropdown-content {
    padding: 0;
    text-align: left;
}

.dropdown-submenu-item {
    display: block;
    padding: 0.5rem 0 0.5rem 3rem;
    font-size: 0.9rem;
    color: var(--color-text);
    text-decoration: none;
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    background: transparent;
    position: relative;
}

.dropdown-submenu-item::before {
    content: '›';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    font-weight: 300;
    font-size: 1.2rem;
    transition: all var(--transition-base);
}

.dropdown-submenu-item:last-child {
    margin-bottom: 0;
}

.dropdown-submenu-item:hover {
    background: transparent;
    color: var(--color-primary);
    transform: translateX(5px);
}

.dropdown-submenu-item:hover::before {
    transform: translateY(-50%) translateX(7px);
}

.dropdown-text {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.dropdown-cta {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-cta:hover {
    background: var(--color-secondary);
    transform: translateX(5px);
}

.dropdown-submenu {
    padding: 1rem;
}

.dropdown-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.submenu-list {
    list-style: none;
}

.submenu-link {
    display: block;
    padding: 0.6rem 0 0.6rem 1rem;
    color: var(--color-text);
    font-size: 0.8rem;
    transition: all var(--transition-base);
    position: relative;
    border-left: 2px solid transparent;
}

.submenu-link::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: all var(--transition-base);
}

.submenu-link:hover {
    color: var(--color-primary);
    padding-left: 1.5rem;
    border-left-color: var(--color-primary);
}

.submenu-link:hover::before {
    opacity: 1;
}


.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn-primary:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-white {
    background: white;
    color: var(--color-primary);
    border: 2px solid white;
}

.btn-white:hover {
    background: var(--color-bg-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    align-items: center;
    padding-top: 0;
    overflow: hidden;
    margin-top: -1px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 50rem;
    padding-left: 0;
    text-align: center;
    margin: 0 auto;
    transform: translateY(-4vh);
    animation: fadeInUp 1s ease 0.5s backwards;
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hero-label {
    display: inline-block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1875rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    animation: fadeInScale 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s backwards;
}

.hero-title {
    color: white;
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 2rem;
    line-height: 1.1;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9) !important;
    animation: fadeInUp 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.7s backwards;
}

.hero-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    line-height: 1.8;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9) !important;
    animation: fadeInUp 1.4s cubic-bezier(0.22, 1, 0.36, 1) 1s backwards;
}

.hero-description p {
    margin-bottom: 1.2rem;
}

.hero-description p:last-child {
    margin-bottom: 0;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 600;
    margin-top: 2.2rem;
    margin-bottom: 2rem;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.9) !important;
    transition: all var(--transition-base);
    animation: fadeInScale 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s backwards;
}

.hero-link:hover {
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.hero-btn {
    animation: fadeInScale 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 2s backwards;
}

/* Section Links (used in second page) */
.section-links {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-top: 3rem;
    margin-left: auto;
    margin-right: auto;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    width: 100%;
    text-align: center;
}

.section-link-item {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 0.5rem;
    color: #666666;
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    text-decoration: none;
    margin: 0 2.5rem;
}

.section-link-item svg {
    transition: transform var(--transition-base);
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.section-link-item:hover {
    gap: 0.75rem;
    color: var(--color-primary);
}

.section-link-item:hover svg {
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    transform: translateY(-3px);
}

/* Floating animation for page 2.5 boxes */
@keyframes float1 {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
        opacity: 0.85;
    }
    25% {
        transform: translate(5px, 0px) rotate(1deg);
        opacity: 1;
    }
    50% {
        transform: translate(-3px, 0px) rotate(-0.5deg);
        opacity: 0.9;
    }
    75% {
        transform: translate(4px, 0px) rotate(0.5deg);
        opacity: 1;
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translate(0px, 0px) rotate(0deg);
        opacity: 0.9;
    }
    25% {
        transform: translate(-4px, 0px) rotate(-0.5deg);
        opacity: 0.85;
    }
    50% {
        transform: translate(6px, 0px) rotate(1deg);
        opacity: 1;
    }
    75% {
        transform: translate(-5px, 0px) rotate(-1deg);
        opacity: 0.88;
    }
}

/* New link blocks for page 2.5 */
.section-link-block {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    margin: 1.25rem 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 200px;
    text-decoration: none;
    animation: float1 6s ease-in-out infinite;
}

.section-link-block:nth-child(2) {
    animation-name: float2;
    animation-duration: 7s;
}

.section-link-block:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    animation-play-state: paused;
}

.section-link-main {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-base);
}

@media (max-width: 768px) {
    .section-link-item {
        margin: 0 1.75rem;
    }

    .section-link-block {
        min-width: 160px;
        padding: 1.25rem 1.5rem;
        margin: 0.75rem auto;
    }

    .section-link-main {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .section-link-sub {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .section-links {
        flex-direction: column;
        gap: 1rem;
    }

    .section-link-block {
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInUp 1s ease 1.7s backwards;
}

.mouse {
    width: 1.875rem;
    height: 3.125rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.9375rem;
    position: relative;
}

.wheel {
    width: 0.25rem;
    height: 0.625rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.125rem;
    position: absolute;
    top: 0.625rem;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s ease-in-out infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Scroll indicator scuro per sezioni non-hero */
.fullpage-section:not(.section-hero) .mouse {
    border-color: rgba(0, 0, 0, 0.3);
}

.fullpage-section:not(.section-hero) .wheel {
    background: rgba(0, 0, 0, 0.6);
}

/* ============================================
   About Section
   ============================================ */
.about {
    padding: var(--spacing-xl) 0;
    background: var(--color-bg);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-label {
    display: inline-block;
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.125rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    position: relative;
}

.section-label::after {
    content: '';
    display: block;
    width: 3.75rem;
    height: 2px;
    background: var(--color-primary);
    margin: 0.5rem auto 0;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--color-primary);
}

.about-grid {
    display: grid;
    gap: var(--spacing-md);
}

.about-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text);
    text-align: center;
    max-width: 56.25rem;
    margin: 0 auto var(--spacing-lg);
    opacity: 0;
    transform: translateY(80px) scale(0.9);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-intro.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.services-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    position: relative;
    height: 100%;
    width: 100%;
}

.service-card {
    flex: 1;
    width: 100%;
    min-height: 25rem;
    cursor: default;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(250, 250, 250, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 2px;
    border: 1px solid rgba(180, 150, 100, 0.3);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 0 80px rgba(180, 150, 100, 0.05);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(30px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(180, 150, 100, 0.02) 0%,
        transparent 50%,
        rgba(180, 150, 100, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.service-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg,
        rgba(180, 150, 100, 0.4) 0%,
        rgba(140, 120, 80, 0.2) 50%,
        rgba(180, 150, 100, 0.4) 100%);
    border-radius: 2px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.6s ease;
    filter: blur(8px);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover::after {
    opacity: 0.6;
}

.service-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) {
    transition-delay: 0.2s;
}

.service-card:nth-child(2) {
    transition-delay: 0.35s;
}

.service-card:hover {
    /* Hover effect rimosso per mantenere box statiche */
}

/* Animazione espansione disabilitata */
.service-card.expanded {
    /* Espansione rimossa per mantenere layout statico */
}

.service-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1.5rem 0;
    padding: 0 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(180, 150, 100, 0.25);
    text-align: left;
    letter-spacing: 0.02em;
    line-height: 1.3;
    position: relative;
    z-index: 10;
}

/* Regola .expanded disabilitata */

.service-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2.5rem 2.5rem 2.5rem 2.5rem;
    z-index: 10;
    overflow-y: auto; /* Enable scroll when content is too long */
    overscroll-behavior: contain; /* Prevent scroll chaining on mobile */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.service-content > * {
    display: block;
}

/* Regole .expanded disabilitate */

.service-description {
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text);
    text-align: left;
    position: relative;
    z-index: 10;
    margin-bottom: 1rem;
}

/* Regole .expanded rimosse */

.highlight-box {
    background: linear-gradient(135deg,
        rgba(210, 210, 210, 0.15) 0%,
        rgba(200, 200, 200, 0.10) 100%);
    padding: 1.8rem;
    border-radius: 2px;
    border-left: 3px solid rgba(200, 200, 200, 0.7);
    margin-top: 1rem;
    position: relative;
    z-index: 10;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    overflow: visible; /* CAMBIATO DA AUTO - causa posizionamento sbagliato */
}

/* Regola .expanded rimossa */

.highlight-box p {
    margin: 0 0 1rem 0;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.7;
}

.highlight-box p:last-of-type {
    margin-bottom: 0;
}

.service-card.expanded .highlight-box p {
    font-size: 1.05rem;
    line-height: 1.8;
}

.highlight-box strong {
    color: #1a1a1a;
    font-weight: 600;
}

.ready2cars-btn {
    margin-top: 1.2rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    color: white;
    border: 1px solid rgba(180, 150, 100, 0.3);
    font-weight: 500;
    display: inline-block;
    border-radius: var(--radius-sm);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    float: right;
}

.service-card.expanded .ready2cars-btn {
    font-size: 0.9rem;
    padding: 0.8rem 1.6rem;
}

.ready2cars-btn:hover {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    border-color: rgba(180, 150, 100, 0.6);
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(180, 150, 100, 0.15);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background-image: url('img/bg3.webp');
    background-image: image-set(
        url('img/bg3.webp') 1x,
        url('img/bg3.jpg') 1x
    );
    background-image: -webkit-image-set(
        url('img/bg3.webp') 1x,
        url('img/bg3.jpg') 1x
    );
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    color: white;
    padding: var(--spacing-md) 0;
    position: relative;
}

/* Fallback for browsers that don't support WebP */
@supports not (background-image: url('img/bg3.webp')) {
    .footer {
        background-image: url('img/bg3.jpg');
    }
}

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

.footer-location {
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.footer-copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

.footer-vat {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.125rem;
    height: 3.125rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-secondary);
    transform: translateY(-5px);
}

/* ============================================
   SweetAlert2 Custom Styles
   ============================================ */
.contact-modal {
    border-radius: var(--radius-lg) !important;
    padding: 2rem !important;
}

.contact-close {
    font-size: 2rem !important;
}

.swal2-html-container a {
    transition: all var(--transition-base);
}

.swal2-html-container a:hover {
    color: var(--color-primary) !important;
    text-decoration: underline;
}

/* ============================================
   Responsive Design
   ============================================ */
/* Desktop - Navbar laterale anche su desktop */
@media (min-width: 769px) {
    .menu-panel {
        width: 25rem;
    }

    .dropdown-menu {
        position: relative;
    }
}

@media (max-width: 1024px) {
    :root {
        --container-padding: 1.5rem;
        --spacing-xl: 4rem;
        --spacing-lg: 3rem;
    }

    .hero-content {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
        --spacing-xl: 3rem;
        --spacing-lg: 2rem;
    }

    /* Hamburger smaller on mobile */
    .hamburger-menu {
        top: 1.5rem;
        right: 1.5rem;
        padding: 0.8rem;
    }

    .hamburger-menu span {
        width: 1.25rem;
    }

    /* Menu panel full width on mobile */
    .menu-panel {
        width: 100%;
        max-width: 18.75rem;
    }

    .menu-panel-content {
        padding: 2.5rem 1.5rem;
    }

    /* Language selector - much smaller on mobile */
    .lang-option {
        font-size: 0.55rem !important;
        padding: 0.65rem 0.9rem;
    }

    .lang-option .flag-emoji {
        font-size: 0.95rem !important;
    }

    .logo-img {
        height: 4.6875rem;
    }

    /* Hero */
    .hero {
        min-height: calc(100vh - 80px);
        padding-top: 6.25rem;
    }

    .hero-content {
        transform: translateY(-3.75rem);
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-description {
        font-size: 1rem;
    }

    .scroll-indicator {
        display: block !important;
        bottom: 5.5rem !important;
    }

    /* About - Services mobile */
    .services-grid {
        flex-direction: column;
        gap: 2rem;
        padding: 3rem 1rem 4rem 1rem;
        align-items: center;
    }

    .service-card {
        width: 100%;
        max-width: 25rem;
        min-height: 23.75rem;
    }

    .service-card:hover {
        /* Hover effect rimosso anche su mobile */
    }

    .service-content {
        padding: 1.2rem 1rem 1.4rem 1rem;
    }

    .service-title {
        font-size: 1.6rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.8125rem;
        height: 2.8125rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .service-title {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.65rem 1.5rem;
        font-size: 0.85rem;
    }

    .service-modal .service-title {
        font-size: 1.4rem !important;
    }

    .service-modal .service-description,
    .flip-card-content .content-body p {
        font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .header,
    .back-to-top,
    .scroll-indicator,
    .page-loader {
        display: none !important;
    }

    body {
        background: white;
    }

    .hero {
        page-break-after: always;
    }
}

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

    .hero-img {
        animation: none;
    }

    .wheel {
        animation: none;
    }
}

/* Focus Styles */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #000000;
        --color-secondary: #000000;
        --color-text: #000000;
        --color-bg: #ffffff;
    }
}

/* ============================================
   Fullpage Scroll
   ============================================ */
.fullpage-container {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Mobile-friendly viewport height */
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.fullpage-container::-webkit-scrollbar {
    display: none;
}

.fullpage-section {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Mobile-friendly viewport height */
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero section needs special alignment */
.fullpage-section.section-hero {
    justify-content: center;
}

/* About intro section */
.fullpage-section.section-intro {
    justify-content: center;
    padding: var(--spacing-xl) 0;
}

/* Intermediate section (same style as intro) */
.fullpage-section.section-intermediate {
    justify-content: center;
    padding: var(--spacing-xl) 0;
}

/* Service card sections */
.fullpage-section.section-service {
    justify-content: center;
    padding: 4rem 0;
    background: linear-gradient(180deg,
        rgba(10, 10, 10, 0.03) 0%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(10, 10, 10, 0.03) 100%);
}

/* Scroll indicator for all sections */
.section-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.section-scroll-indicator:hover {
    transform: translateX(-50%) scale(1.1);
}

.section-scroll-indicator:active {
    transform: translateX(-50%) scale(0.95);
}

/* Hide scroll indicator on last section */
.fullpage-section:last-child .section-scroll-indicator {
    display: none;
}

/* Mobile adjustments for fullpage */
@media (max-width: 768px) {
    .fullpage-section.section-intro .about-intro,
    .fullpage-section.section-intermediate .about-intro {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .fullpage-section.section-service .container {
        padding: 0 1rem;
    }

    .section-scroll-indicator {
        bottom: 1.5rem;
    }
}

/* Service Card Modal */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.service-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.service-modal-overlay {
    position: fixed !important; /* Fixed per coprire tutto lo schermo */
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important; /* TUTTA la larghezza dello schermo - nulla può sovrascrivere */
    height: 100vh !important; /* TUTTA l'altezza dello schermo - nulla può sovrascrivere */
    background: rgba(0, 0, 0, 0.00);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.service-modal-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90%;
    max-width: 50rem;
    max-height: calc(var(--vh, 1vh) * 85); /* Mobile-friendly */
    border-radius: 0;
    padding: 0; /* NO padding - va sulle card */
    border: none;
    transition: none !important;
    overflow: visible; /* Permettere alle ombre delle card di essere visibili */
    /* NO background/blur qui - vanno sulle card che ruotano */
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.service-modal .service-card,
.service-modal .service-content {
    background: transparent !important;
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.service-modal-close {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.8s ease-in-out; /* Stessa transizione della flip card */
    z-index: 1000; /* Aumentato per stare sempre sopra le flip cards */
}

.service-modal-close.is-flipped {
    transform: rotateY(180deg); /* Ruota con la flip card */
}

.service-modal-close:hover:not(.is-flipped) {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.service-modal-close svg {
    color: var(--color-text);
}

.service-modal .service-card {
    border: none;
    box-shadow: none;
    background:  rgba(0, 0, 0, 0.0) !important; /* TRANSPARENZA */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 0;
    margin: 0;
    min-height: auto;
    position: relative;
}

.service-modal .service-card::before,
.service-modal .service-card::after {
    display: none !important;
}

.service-modal .service-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none;
    padding: 0 0 1.5rem 0;
    text-align: center;
}

.service-modal .service-description {
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 300;
    font-size: 1.3rem !important;
    line-height: 1.95;
    text-align: justify;
}

/* Icons for modal - usando le SVG originali */
.service-modal.modal-offmarket .service-card::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 9.375rem;
    height: 9.375rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none" stroke="%23b49664" stroke-width="0.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 28l8-8 8 8v18H8V28z"/><rect x="11" y="36" width="2" height="3"/><rect x="19" y="36" width="2" height="3"/><path d="M28 20l6-6 6 6v8h-12v-8z"/><rect x="31" y="23" width="1.5" height="2"/><rect x="35.5" y="23" width="1.5" height="2"/><path d="M42 24h14v22H42V24z"/><rect x="45" y="28" width="2" height="3"/><rect x="49" y="28" width="2" height="3"/><rect x="45" y="34" width="2" height="3"/><rect x="49" y="34" width="2" height="3"/><rect x="45" y="40" width="2" height="3"/><rect x="49" y="40" width="2" height="3"/><path d="M42 24l7-4 7 4"/><line x1="8" y1="46" x2="56" y2="46"/></svg>') center / contain no-repeat;
    opacity: 0.60;
    z-index: 5;
    pointer-events: none;
    display: none !important;
}

.service-modal.modal-altriambiti .service-card::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 9.375rem;
    height: 9.375rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke="%23b49664" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"><g><path d="M5 35c0-1.5 1.5-3 3-3h6l3-4.5c0.8-1.2 2-2.5 4-2.5h20c1.5 0 3 0.8 3.8 2l5 7.5h10c2.5 0 4.5 1.5 5.5 3.5l1.5 4.5c0.4 1.2 0.4 2.5 0 3.8"/><ellipse cx="18" cy="41" rx="5" ry="5"/><ellipse cx="58" cy="41" rx="5" ry="5"/><path d="M5 35h16m26 0h20"/><path d="M23 41h30"/><path d="M37 27l2.5-2.5h8l2.5 2.5"/><rect x="40" y="29" width="6" height="4" rx="0.8"/><path d="M25 33l-2.5-2.5h-6.5l-1.5 2.5"/><ellipse cx="18" cy="41" rx="2.5" ry="2.5" fill="%23b49664" opacity="0.3"/><ellipse cx="58" cy="41" rx="2.5" ry="2.5" fill="%23b49664" opacity="0.3"/></g><g transform="translate(0, 30)"><path d="M8 45c0-2 2-3.5 4-3.5h10l5-7c1-1.5 2.5-2.5 4.5-2.5h18c2 0 3.5 1 4.5 2.5l5 7h10c2.5 0 4.5 1.5 5.5 3.5l1.5 4c0.4 1 0.4 2 0 3"/><ellipse cx="22" cy="50" rx="5" ry="5"/><ellipse cx="62" cy="50" rx="5" ry="5"/><path d="M8 45h14m28 0h18"/><path d="M27 50h30"/><rect x="34" y="37" width="16" height="6" rx="1"/><path d="M50 37l4-3h8l4 3"/><ellipse cx="22" cy="50" rx="2.5" ry="2.5" fill="%23b49664" opacity="0.3"/><ellipse cx="62" cy="50" rx="2.5" ry="2.5" fill="%23b49664" opacity="0.3"/></g></svg>') center / contain no-repeat;
    opacity: 0.60;
    z-index: 5;
    pointer-events: none;
    display: none !important;
}

@media (max-width: 768px) {
    .service-modal-content {
        position: fixed !important;
        top: 10% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 94% !important; /* Non 100% - il modale deve avere margini */
        max-height: 80vh !important;
        padding: 0; /* NO padding - interferisce con posizionamento bottoni */
        border-radius: 0;
        overflow-y: auto;
    }

    /* Ombra a tutto schermo - SOLUZIONE CHE FUNZIONAVA */
    .service-modal-content::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: calc(var(--vh, 1vh) * 100);
        background: rgba(0, 0, 0, 0.00); /* Trasparente - solo blur */
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        pointer-events: none;
        z-index: -1;
    }

    .service-modal .service-title {
        font-size: 1.7rem;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .service-modal .service-description {
        font-size: 1.05rem;
        line-height: 1.65;
    }

    .service-modal .service-content {
        background: rgba(0, 0, 0, 0.0) !important;
    }

    .service-modal-close {
        top: 1rem;
        left: 1rem;
        right: auto;
        width: 2.25rem;
        height: 2.25rem;
    }

    /* Reduce icon size on mobile */
    .service-modal.modal-offmarket .service-card::before,
    .service-modal.modal-altriambiti .service-card::before {
        width: 5rem;
        height: 5rem;
        top: 0.5rem;
        right: 0.5rem;
        opacity: 0.15;
    }

    /* Adjust Ready2cars button */
    .ready2cars-btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-height: 720px) {

    /* Modale: contenitore un po' più compatto */
    .service-modal-content {
        max-height: calc(var(--vh, 1vh) * 78) !important;
    }

    /* Altezza minima della flip card leggermente ridotta */
    .flip-card-inner {
        min-height: 32.5rem !important;
    }

    /* Padding più stretto ma ancora elegante */
    .flip-card-face {
        padding: 1.4rem !important;
        padding-bottom: 3.2rem !important;
    }

    /* Contenuto principale */
    .service-content {
        padding: 1.2rem 1rem !important;
    }

    /* Riduzione testi */
    .service-title {
        font-size: 1.45rem !important;
    }

    .service-description,
    .flip-card-content .content-body p {
        font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }

    .service-modal .service-title {
    font-size: 1.4rem !important;
    }

    .service-modal .service-description,
    .flip-card-content .content-body p {
        font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        font-size: 1.15rem !important;
        line-height: 1.55 !important;
    }
}

@media (max-height: 720px) {

    /* Modale: contenitore un po' più compatto */
    .service-modal-content {
        max-height: calc(var(--vh, 1vh) * 78) !important;
    }

    /* Altezza minima della flip card leggermente ridotta */
    .flip-card-inner {
        min-height: 32.5rem !important;
    }

    /* Padding più stretto ma ancora elegante */
    .flip-card-face {
        padding: 1.4rem !important;
        padding-bottom: 3.2rem !important;
    }

    /* Contenuto principale */
    .service-content {
        padding: 1.2rem 1rem !important;
    }

    /* Riduzione testi */
    .service-title {
        font-size: 1.45rem !important;
    }

    .service-description,
    .flip-card-content .content-body p {
        font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
    }
}

@media (min-width: 401px) and (max-width: 600px) {
    /* Titolo modale più piccolo */
    .service-modal .service-title {
        font-size: 1.5rem !important;
    }

    /* Testo più compatto */
    .service-modal .service-description,
    .service-modal .flip-card-content .content-body p {
        font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* Padding più stretto */
    .flip-card-face {
        padding: 1.2rem 1.2rem 3rem 1.2rem !important;
    }
}

.service-modal.active .service-modal-content {
    transform: translate(-50%, -50%) !important;
}

/* Effetto dietro i box modali */
.service-modal-overlay {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Contenitore modale - SOLO positioning, NO stili visivi (quelli vanno sulle card) */
.service-modal-content {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* trasparenza dei box modali retro *
.service-modal-content {
    background: rgba(15, 15, 15, 0.55) !important;
    backdrop-filter: blur(9px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(9px) saturate(140%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.35),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}
*/

/* Container principale - solo perspective */
/* =========================================================
                   FLIP CARD - MODAL ANIMATIONS
   ========================================================= */

.flip-card-container {
    width: 100%;
    height: auto;
    perspective: 2000px;
    position: relative;
}

/* Inner container che ruota - QUESTO è quello che si anima */
.flip-card-inner {
    position: relative;
    width: 100%;
    min-height: 31.25rem; /* Altezza minima definita per dare dimensioni consistenti */
    transition: transform 0.8s ease-in-out;
    transform-style: preserve-3d;
}

/* Quando flippato, ruota di 180 gradi orizzontalmente */
.flip-card-inner.is-flipped {
    transform: rotateY(180deg);
}

/* Fronte e retro - posizionamento e nascondere il retro */
.flip-card-face {
    position: absolute;
    width: 100%;
    height: 100%; /* Riempi completamente l'inner container */
    top: 0;
    left: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 1.25rem;
    padding: 2.5rem;
    padding-bottom: 5.5rem;
    box-sizing: border-box;
    overflow-y: auto; /* Scroll se il contenuto è troppo lungo */
    overscroll-behavior: contain; /* Previene scroll chaining su mobile */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling su iOS */
    /* Safari fix: use opacity as backup for backface-visibility */
    transition: opacity 0.01s linear 0.4s, visibility 0.01s linear 0.4s;
}

/* Modale Fronte (Qui imposto colore e trasparenza) */
.flip-card-face.front {
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(5px) saturate(100%);
    -webkit-backdrop-filter: blur(5px) saturate(100%);
    mix-blend-mode: screen;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.18),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    z-index: 2;
    transform: rotateY(0deg) translateZ(1px);
    /* Default: front visible */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modale Retro (Qui imposto colore e trasparenza)  */
.flip-card-face.back {
    background: rgba(15, 15, 15, 0.50);
    backdrop-filter: blur(5px) saturate(100%);
    -webkit-backdrop-filter: blur(5px) saturate(100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.35),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
    transform: rotateY(180deg) translateZ(1px);
    /* Default: back hidden */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* When flipped: hide front, show back (at midpoint of rotation) */
.flip-card-inner.is-flipped .flip-card-face.front {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.flip-card-inner.is-flipped .flip-card-face.back {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================
   FALLBACK FOR OLD BROWSERS (no 3D transforms support)
   Uses fade in/out instead of 3D flip animation
   Opacity/visibility already handled above, just disable 3D here
   ========================================================= */
@supports not (transform-style: preserve-3d) {
    /* Disable 3D transforms */
    .flip-card-inner {
        transform-style: flat;
    }

    .flip-card-inner.is-flipped {
        transform: none;
    }

    .flip-card-face {
        backface-visibility: visible;
        -webkit-backface-visibility: visible;
    }

    .flip-card-face.front {
        transform: none !important;
    }

    .flip-card-face.back {
        transform: none !important;
    }

    /* Adjust flip buttons to not rotate */
    #flipToBack.is-flipped,
    #flipToFront.is-flipped {
        transform: none !important;
    }
}

/* testo sul retro BIANCO */
.flip-card-face.back *,
.flip-card-face.back h3,
.flip-card-face.back p,
.flip-card-face.back strong,
.flip-card-face.back span,
.flip-card-face.back div {
    color: #f0f0f0 !important;
}

.flip-card-face.back a {
    color: var(--color-gold) !important;
}

/* Contenuto interno - Titolo in alto, testo centrato verticalmente */
.flip-card-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Titolo rimane in alto */
    align-items: stretch;
    margin: 0;
    padding: 0;
}

.flip-card-content h3 {
    margin: 0 0 1.5rem 0;
    padding: 0;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 2.3rem;
    font-weight: 600;
    color: inherit;
    text-align: center; /* Titoli centrati */
    flex-shrink: 0; /* Il titolo non si riduce mai */
}

.flip-card-face.back h3 {
    color: #ffffff;
}

/* Smaller font size for parentheses in modal titles */
.modal-parentheses {
    font-size: 0.7em;
}

.flip-card-content .content-body {
    margin: 0;
    padding: 0;
    flex: 1; /* Occupa tutto lo spazio rimanente */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centra verticalmente solo il testo */
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 300;
}

.flip-card-content .content-body p {
    margin: 0 0 1rem 0;
    padding: 0;
    font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 300;
    font-size: 1.25rem !important;
    line-height: 1.9;
}

/* Bottone flip */
.flip-trigger-btn {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    width: 3.125rem;
    height: 3.125rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05); /* Stesso sfondo della X */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out, background 0.3s ease; /* Transizione anche su opacity */
    z-index: 100;
}

/* Freccia "avanti" (destra) - visibile di default */
#flipToBack {
    opacity: 1;
    pointer-events: auto;
}

/* Freccia "indietro" (sinistra) - nascosta di default */
#flipToFront {
    opacity: 0;
    pointer-events: none;
}

/* Quando card è flipped: inverti visibilità */
#flipToBack.is-flipped {
    opacity: 0;
    pointer-events: none;
    transform: rotateY(180deg);
}

#flipToFront.is-flipped {
    opacity: 1;
    pointer-events: auto;
    transform: rotateY(180deg);
}

.flip-trigger-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.flip-trigger-btn:hover:not(.is-flipped) {
    transform: scale(1.1);
}

.flip-trigger-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #000000; /* Nero invece di oro */
    transition: transform 0.8s ease-in-out;
}

/* Specchia SVG orizzontalmente quando card è flipped (senza rotazione 2D) */
.flip-card-inner.is-flipped ~ .flip-trigger-btn svg,
#flipToBack.is-flipped svg,
#flipToFront.is-flipped svg {
    transform: scaleX(-1);
}

.flip-trigger-btn:hover:not(.is-flipped) svg {
    transform: scale(1.1);
}

.flip-card-inner.is-flipped ~ .flip-trigger-btn:hover svg,
#flipToBack.is-flipped:hover svg,
#flipToFront.is-flipped:hover svg {
    transform: scaleX(-1) scale(1.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .flip-card-inner {
        min-height: 34.375rem; /* Ridotto per evitare che modale arrivi fino in fondo */
    }

    .flip-card-face {
        padding: 1.8rem;
        padding-bottom: 4.5rem;
    }

    /* Riduci dimensioni testo su mobile */
    .flip-card-content h3 {
        font-size: 1.65rem; /* Ridotto da 2rem */
    }

    .flip-card-content .content-body p {
        font-family: 'Lato', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        font-size: 1rem; /* Ridotto per mobile */
        line-height: 1.65;
    }

    .flip-trigger-btn {
        width: 2.75rem;
        height: 2.75rem;
        bottom: 1rem !important;
        right: 1rem !important;
        position: absolute !important;
    }

    .flip-trigger-btn svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Reduce contact button sizes on all back modals for mobile */
    .service-modal .flip-card-face.back a[href^="mailto"],
    .service-modal .flip-card-face.back a[href^="tel"],
    .service-modal .flip-card-face.back a[href^="http"] {
        width: 2.8rem !important;
        height: 2.8rem !important;
        margin: 0 0.5rem !important;
    }

    .service-modal .flip-card-face.back a svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Reduce spacing in ready2cars blocks (enjoy/rent/import) */
    .service-modal .flip-card-face.back div[style*="gap: 1.5rem"] {
        gap: 0.8rem !important;
        margin-bottom: 1rem !important;
    }

    .service-modal .flip-card-face.back div[style*="gap: 1.5rem"] > div {
        min-width: 150px !important;
    }

    .service-modal .flip-card-face.back h4 {
        font-size: 1rem !important;
        margin-bottom: 0.3rem !important;
    }

    .service-modal .flip-card-face.back p.service-description[style*="margin-bottom: 1.5rem"] {
        margin-bottom: 1rem !important;
    }
}

/* Sfondi sezioni con supporto WebP + fallback JPG */
.fullpage-section.section-intro,
.fullpage-section.section-intermediate,
.fullpage-section#contatti {
    background-image: url('img/bg2.webp');
    background-image: image-set(
        url('img/bg2.webp') 1x,
        url('img/bg2.jpg') 1x
    );
    background-image: -webkit-image-set(
        url('img/bg2.webp') 1x,
        url('img/bg2.jpg') 1x
    );
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Fallback per browsers senza WebP */
@supports not (background-image: url('img/bg2.webp')) {
    .fullpage-section.section-intro,
    .fullpage-section.section-intermediate,
    .fullpage-section#contatti {
        background-image: url('img/bg2.jpg');
    }
}

/* MODALE MOBILE FIX — Ombra a tutto schermo */
.service-modal-overlay {
    position: fixed !important;
    top: 0; 
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.25) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    z-index: 9998 !important;
}

/* La finestra modale vera (contenuto) deve stare sopra */
.service-modal-content {
    z-index: 9999 !important;
}

/* per visualizzare bene l'ombra dietro i modali su mobile */
body.modal-open {
    overflow: hidden !important;
}

/* iPad landscape - centrato come desktop */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .service-modal-content {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    .flip-trigger-btn {
        bottom: 1rem !important;
    }
}

/* FIX MODALE MOBILE: disattivo il vecchio ::before e tolgo il clipping */
@media (max-width: 768px) {
    /* Non vogliamo più l'ombra attaccata al content */
    .service-modal-content::before {
        content: none !important;
    }

    /* Il contenuto del modale non deve ritagliare niente */
    .service-modal-content {
        overflow: visible !important;
    }
}

/* Graduated scaling per schermi piccolo DEVE STARE DOPO LE MEDIA QUERY */

/* iPhone 15 Pro (390px-400px) - Proportional reduction */
@media (max-width: 400px) and (min-width: 390px) {
    .service-modal.active .service-title,
    .service-modal .service-title {
        font-size: 1.6rem !important;
    }

    .service-modal.active .service-description,
    .service-modal .service-description,
    .service-modal.active .flip-card-content .content-body p,
    .flip-card-content .content-body p {
        font-size: 0.90rem !important;
    }
}

/* iPhone 7/8/SE2, 13 mini and similar (370px-389px) - Proportional reduction */
@media (max-width: 389px) and (min-width: 370px) {
    .service-modal.active .service-title,
    .service-modal .service-title {
        font-size: 1.55rem !important;
    }

    .service-modal.active .service-description,
    .service-modal .service-description,
    .service-modal.active .flip-card-content .content-body p,
    .flip-card-content .content-body p {
        font-size: 0.84rem !important;
    }
}

/* Samsung S25, Galaxy S22 and smaller (< 370px) - Proportional reduction */
@media (max-width: 369px) {
    .service-modal.active .service-title,
    .service-modal .service-title {
        font-size: 1.5rem !important;
    }

    .service-modal.active .service-description,
    .service-modal .service-description,
    .service-modal.active .flip-card-content .content-body p,
    .flip-card-content .content-body p {
        font-size: 0.78rem !important;
    }
}

/* Samsung Z Fold 5 and similar tall narrow screens - Extra reduction for modals only */
@media (max-width: 400px) and (min-aspect-ratio: 21/9) {
    .service-modal.active .service-title,
    .service-modal .service-title {
        font-size: 1.35rem !important;
    }

    .service-modal.active .service-description,
    .service-modal .service-description,
    .service-modal.active .flip-card-content .content-body p,
    .flip-card-content .content-body p {
        font-size: 0.72rem !important;
    }

    /* Also reduce h3 inside modals */
    .service-modal .flip-card-content h3 {
        font-size: 2.0rem !important;
    }
}

/* Graduated scaling for hero and about page text - Same percentages as modals */

/* iPhone 15 Pro (390px-400px) - 5% reduction for page text */
@media (max-width: 400px) and (min-width: 390px) {
    .hero-title {
        font-size: 2.375rem !important;
    }

    .hero-description {
        font-size: 0.95rem !important;
    }

    .section-title {
        font-size: 1.9rem !important;
    }

    .about-intro {
        font-size: 0.95rem !important;
    }

    /* Titoli generici */
    h1 {
        font-size: 2.375rem !important;
    }

    h2 {
        font-size: 1.9rem !important;
    }

    h3 {
        font-size: 1.425rem !important;
    }

    /* Collegamenti navigazione e opzioni lingua */
    .nav-link {
        font-size: 0.8075rem !important;
    }

    .lang-option {
        font-size: 0.8075rem !important;
    }
}

/* iPhone 7/8/SE2, 13 mini and similar (370px-389px) - Increased reduction for page text */
@media (max-width: 389px) and (min-width: 370px) {
    .hero-title {
        font-size: 2.2rem !important;
    }

    .hero-description {
        font-size: 0.88rem !important;
    }

    .section-title {
        font-size: 1.76rem !important;
    }

    .about-intro {
        font-size: 0.82rem !important;
    }

    .section-link-item {
        font-size: 0.85rem !important;
    }

    /* Titoli generici */
    h1 {
        font-size: 2.2rem !important;
    }

    h2 {
        font-size: 1.76rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    /* Collegamenti navigazione e opzioni lingua */
    .nav-link {
        font-size: 0.748rem !important;
    }

    .lang-option {
        font-size: 0.748rem !important;
    }
}

/* Samsung S25, Galaxy S22 and smaller (< 370px) - 18% reduction for page text */
@media (max-width: 369px) {
    .hero-title {
        font-size: 2.05rem !important;
    }

    .hero-description {
        font-size: 0.82rem !important;
    }

    .section-title {
        font-size: 1.64rem !important;
    }

    /* Samsung S25: riduzione extra per pagina 2 (25% rispetto a base 1rem) */
    .about-intro {
        font-size: 0.75rem !important;
    }

    /* Titoli generici */
    h1 {
        font-size: 2.05rem !important;
    }

    h2 {
        font-size: 1.64rem !important;
    }

    h3 {
        font-size: 1.23rem !important;
    }

    /* Collegamenti navigazione e opzioni lingua */
    .nav-link {
        font-size: 0.697rem !important;
    }

    .lang-option {
        font-size: 0.697rem !important;
    }
}

/* Compact layout for tall narrow screens to fit content without scroll */
/* Includes iPhone 13/14/15 Pro, Galaxy S22, and Z Flip 3/4/5 */
@media (max-width: 420px) and (min-height: 700px) {
    .flip-card-face {
        padding: 2rem !important;
        padding-bottom: 5rem !important;
    }

    .service-modal .service-description,
    .flip-card-content .content-body p {
        line-height: 1.6 !important;
        margin-bottom: 0.75rem !important;
    }

    .flip-card-content h3 {
        margin-bottom: 1.25rem !important;
    }
}

/* iPhone 12/12 Pro (390px viewport) - Reduce back modal text only */
@media (max-width: 400px) and (min-width: 385px) {
    .service-modal .flip-card-face.back .content-body p {
        font-size: 1.15rem !important;
    }
}

/* iPhone SE (1st gen) and iPhone 5/5s (320px viewport) - Reduce page 2 text */
@media (max-width: 340px) {
    /* Page 2 text outside modals */
    .about-intro {
        font-size: 0.70rem !important;
    }

    .section-link-item {
        font-size: 0.85rem !important;
    }

    /* Page 2 text inside modals (both front and back) */
    .service-modal .flip-card-content .content-body p {
        font-size: 0.95rem !important;
    }

    /* Extra reduction for specific languages in modals */
    body[data-lang="ru"] .service-modal .flip-card-content .content-body p {
        font-size: 0.72rem !important;
    }

    body[data-lang="ja"] .service-modal .flip-card-content .content-body p {
        font-size: 0.90rem !important;
    }

    body[data-lang="es"] .service-modal .flip-card-content .content-body p {
        font-size: 0.83rem !important;
    }

    body[data-lang="de"] .service-modal .flip-card-content .content-body p {
        font-size: 0.83rem !important;
    }
}

/* For the others under 19/9 */
@media (max-width: 400px) and (min-aspect-ratio: 19/9) {
    html {
        font-size: 95%;
    }
}

/* Overlay pieno schermo per il modale (mobile + desktop) */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 1500;
}

/* Quando è attivo, appare come overlay a schermo intero */
.service-modal.active {
    display: block;
}

/* Velo dietro al box: pieno schermo, con blur */
/* COMMENTATO: questa ridefinizione con blur(1px) era troppo debole e sovrascriveva quella originale con blur(8px)
.service-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.0);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}
*/

/* =========================================================
                   CONTROLLO ESTETICA MODALI
                   (FRONTE + RETRO + OVERLAY) 
   ========================================================= */

/* ---------- MODALE – LATO FRONTE ---------- */
.service-modal .flip-card-face.front {
    background: rgba(255, 255, 255, 0.60) !important;
    backdrop-filter: blur(5px) saturate(100%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(100%) !important;
    mix-blend-mode: screen;

    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 1.25rem !important;

    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.8),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* ---------- MODALE – LATO RETRO ---------- */
.service-modal .flip-card-face.back {
    background: rgba(15, 15, 15, 0.50) !important;
    backdrop-filter: blur(5px) saturate(100%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(100%) !important;

    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 1.25rem !important;

    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
}

/* ---------- VELO FULLSCREEN DIETRO LA MODALE ---------- */
/* COMMENTATO: questo override disabilitava il blur su desktop
.service-modal-overlay {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
*/

/* ---------- SICUREZZA: niente azzeramenti ---------- */
.service-modal-content {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: transparent !important;
    isolation: isolate;
}

/* =========================================================
                 CONTROLLO ESTETICA MENU
   ========================================================= */

/* ---------- PULSANTE HAMBURGER ---------- */
.hamburger-menu {
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;

    border: 1px solid rgba(255, 255, 255, 0.2) !important;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

/* ---------- MENU APERTO ---------- */
.menu-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(5px) saturate(100%) !important;
    -webkit-backdrop-filter: blur(5px) saturate(100%) !important;
    /* mix-blend-mode: screen; REMOVED: this was blocking backdrop-filter on desktop */

    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;

    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.25),
        inset -1px 0 1px rgba(255, 255, 255, 0.2) !important;
}

/* ---------– linee e cornici -------- */
.menu-panel hr,
.menu-panel .nav-item,
.menu-panel .nav-item:not(:last-child),
.language-selector,
.lang-btn {
    border-color: rgba(0, 0, 0, 0.22) !important;
}

/* ------ Velo a destra del menu ----- */
.menu-backdrop {
    position: fixed;
    top: 0;
    right: 0;

    width: 100vw;
    height: 100vh;

    background: rgba(0, 0, 0, 0.65);

    transform: translateX(100%);
    transition: transform 0.70s ease;

    pointer-events: none;
    z-index: 998;
}
body.menu-open .menu-backdrop {
    transform: translateX(0);
    pointer-events: auto;
}

/* ------ RIDUCI DIM. TESTO LINGUE LUNGHE  -------- */
body[data-lang="es"] .service-modal .flip-card-face.front .content-body p,
body[data-lang="ja"] .service-modal .flip-card-face.front .content-body p{
    font-size: 0.99em !important;
}
body[data-lang="es"] .service-modal .flip-card-face.back .content-body p {
    font-size: 0.92em !important;
}
body[data-lang="de"] .service-modal .flip-card-face.front .content-body p {
    font-size: 0.95em !important;
}
body[data-lang="de"] .service-modal .flip-card-face.back .content-body p {
    font-size: 0.93em !important;
}
@media (max-width: 768px) {
    /* Spanish text reduction on mobile for modals */
    body[data-lang="es"] .service-modal .flip-card-face.front .content-body p {
        font-size: 0.91em !important;
    }
    body[data-lang="es"] .service-modal .flip-card-face.back .content-body p {
        font-size: 0.88em !important;
    }

    /* German text reduction on mobile for modals */
    body[data-lang="de"] .service-modal .flip-card-face.front .content-body p {
        font-size: 0.88em !important;
    }
    body[data-lang="de"] .service-modal .flip-card-face.back .content-body p {
        font-size: 0.85em !important;
        line-height: 1.65 !important;
    }

    /* German text reduction on page 2 outside modals */
    body[data-lang="de"] .about-intro {
        font-size: 0.92rem !important;
    }

    body[data-lang="de"] .section-link-item {
        font-size: 0.9rem !important;
    }
}
body[data-lang="ru"] .service-modal .flip-card-face.front .content-body p {
    font-size: 0.98em !important;
}
body[data-lang="ru"] .service-modal .flip-card-face.back .content-body p {
    font-size: 0.95em !important;
}
@media (max-width: 768px) {
    body[data-lang="ru"] .service-modal .flip-card-face.front .content-body p {
        font-size: 0.89em !important;
    }
    body[data-lang="ru"] .service-modal .flip-card-face.back .content-body p {
        font-size: 0.78em !important;
        line-height: 1.6 !important;
        margin-bottom: 0.75rem !important;
    }
}
/* iPhone 6/7/8/SE2 (375px viewport) - Extra reduction for Russian */
@media (max-width: 400px) and (min-width: 360px) {
    body[data-lang="ru"] .service-modal .flip-card-face.front .content-body p {
        font-size: 0.82em !important;
    }
    body[data-lang="ru"] .service-modal .flip-card-face.back .content-body p {
        font-size: 0.80em !important;
    }
}
@media (max-width: 420px) and (min-aspect-ratio: 19/9) {
    body[data-lang="ru"] .service-modal .flip-card-face.front .content-body p {
        font-size: 0.85em;
    }
    body[data-lang="ru"] .service-modal .flip-card-face.back .content-body p {
        font-size: 0.89em;
    }
}

/* French text reduction on iPhone 12/12 Pro back modals */
@media (max-width: 400px) and (min-width: 390px) {
    body[data-lang="fr"] .service-modal .flip-card-face.back .content-body p {
        font-size: 0.86em !important;
    }
}

/* iPhone 11 Pro, XS, X (375px viewport) - Increase back modal title size */
@media (max-width: 380px) and (min-width: 360px) {
    .service-modal .flip-card-face.back h3 {
        font-size: 2.15rem !important;
    }
}

/* iPhone SE 1st gen (320px viewport) - Japanese text in modals - MUST BE AFTER general rules */
@media (max-width: 340px) {
    body[data-lang="ja"] .service-modal .flip-card-face.front .content-body p,
    body[data-lang="ja"] .service-modal .flip-card-face.back .content-body p {
        font-size: 1.05rem !important;
    }
}

/* iPhone SE 2/3, X, XS, 11 Pro (375px viewport) - German text outside modals - MUST BE AFTER 768px rule */
@media (max-width: 380px) and (min-width: 360px) {
    body[data-lang="de"] .about-intro {
        font-size: 0.74rem !important;
    }

    body[data-lang="de"] .section-link-item {
        font-size: 0.81rem !important;
    }
}

/* iPhone SE 1st gen (320px viewport) - German text outside modals - MUST BE LAST */
@media (max-width: 340px) {
    body[data-lang="de"] .about-intro {
        font-size: 0.65rem !important;
    }

    body[data-lang="de"] .section-link-item {
        font-size: 0.75rem !important;
    }
}


/* ============================================
   Cookie Banner Styles
   ============================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.30);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.cookie-banner-visible {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.cookie-banner h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
}

.cookie-banner p {
    margin: 0 0 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Lato', sans-serif;
}

.cookie-btn-primary {
    background: #000;
    color: #fff;
}

.cookie-btn-primary:hover {
    background: #333;
}

.cookie-btn-secondary {
    background: #f0f0f0;
    color: #000;
}

.cookie-btn-secondary:hover {
    background: #e0e0e0;
}

.cookie-btn-link {
    background: transparent;
    color: #000;
    text-decoration: underline;
}

.cookie-btn-link:hover {
    opacity: 0.7;
}

.cookie-customize-panel {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-category {
    margin-bottom: 1.5rem;
}

.cookie-category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cookie-category-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .cookie-slider {
    background-color: #000;
}

input:checked + .cookie-slider:before {
    transform: translateX(24px);
}

input:disabled + .cookie-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 1.25rem 1.5rem;
    }

    .cookie-banner h3 {
        font-size: 1.1rem;
    }

    .cookie-banner p {
        font-size: 0.875rem;
    }

    .cookie-banner-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-category-header {
        flex-direction: row;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .cookie-banner-content {
        padding: 1rem 1.25rem;
    }

    .cookie-banner h3 {
        font-size: 1rem;
    }

    .cookie-banner p {
        font-size: 0.8125rem;
    }

    .cookie-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   High-resolution desktop (e.g. iMac 24" 4480x2520 Retina = 2240px CSS viewport)
   Reduce modal text size so it fits within the modal window
   ============================================ */
@media (min-width: 1920px) {
    .service-modal .flip-card-content h3 {
        font-size: 1.8rem !important;
    }

    .service-modal .flip-card-content .content-body p {
        font-size: 1rem !important;
        line-height: 1.75;
    }

    .service-modal .service-title {
        font-size: 2rem !important;
    }

    .service-modal .service-description {
        font-size: 1.05rem !important;
        line-height: 1.75;
    }
}

/* ============================================
   FAQ Pages - Enable Normal Scroll
   ============================================ */

/* Override body overflow:hidden for FAQ pages to enable normal scrolling */
body[data-page-type="faq-article"],
body[data-page-type="faq-index"] {
    overflow: auto !important;
    height: auto !important;
}

