/* CSS Variables for Light and Dark Mode */
:root {
    --bg-color: #ffffff; /* Colori per il tema chiaro */
    --text-color: #1a1a1a;
    /* Use relative path (no leading slash) and separate image var */
    --hero-bg-image: url('../img/backgroundpic.jpg'); /* Corretto il percorso relativo */
    /* no overlay: keep transparent so only the image shows */
    --hero-overlay: transparent;
    --card-bg: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --accent-color: #FF4A0A; /* Aggiornato da C0 M70 Y96 K0 */
    --footer-bg: #2b2b2b;
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #f0f0f0;
        --hero-bg-image: url('assets/img/backgroundpic.jpg');
        /* no overlay even in dark mode */
        --hero-overlay: transparent;
        --card-bg: #1e1e1e;
        --card-shadow: 0 10px 30px rgba(0,0,0,0.3);
        --accent-color: #ff8c42;
        --footer-bg: #1a1a1a;
        --input-bg: #2a2a2a;
        --input-border: #444;
    }
}
/* Add local font file for Komu */
@font-face {
  font-family: 'Komu';
  src: url('../../fonts/komu_a.eot');
  src: url('../../fonts/komu_a.eot?#iefix') format('embedded-opentype'),
       url('../../fonts/komu_a.woff') format('woff'),
       url('../../fonts/komu_a-webfont.svg#komua') format('svg');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Add local font files */
@font-face {
    font-family: 'Erbaum Black';
    src: url('../../fonts/erbaum-black.woff2') format('woff2'),
         url('../../fonts/erbaum-black.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Add local font files for Winner Sans Comp (regular + bold) */
@font-face {
    font-family: 'Winner Sans Comp';
    src: url('../../fonts/winner-sans-comp.woff2') format('woff2'),
         url('../../fonts/winner-sans-comp.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Winner Sans Comp';
    src: url('../../fonts/winner-sans-comp-bold.woff2') format('woff2'),
         url('../../fonts/winner-sans-comp-bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Komu', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Aggiungi un font di fallback per i paragrafi per una migliore leggibilità */
p {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    transition: background 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.logo i {
    margin-right: 10px;
    color: var(--accent-color);
}

.logo img {
    height: 40px;
    margin-right: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-color);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-menu li:last-child {
    margin-left: 2rem;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu li a:hover {
    color: var(--accent-color);
}

.nav-instagram {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.nav-instagram:hover {
    color: var(--accent-color);
}

/* Language Select */
#language-select {
    /*margin-left: 1rem;*/
    background: var(--accent-color);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path d="M6 8L2 4h8z" fill="white"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
    transition: background 0.3s ease;
    min-width: 60px;
    text-align: right;
    padding-left: 15px; /* Aggiunto per bilanciare */
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    height: 2.2em; /* Aumenta l'altezza in modo proporzionale al font */
    position: relative;
    bottom: 3px; /* Sposta leggermente il testo verso il basso per un centraggio visivo */
}

#language-select:hover {
    background-color: #e55a2b;
}

#language-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.5);
}

/* Hero Section */
.hero {
    height: 100vh;
    /* force only the image, remove any color/gradient fallback */
    background: var(--hero-bg-image) center/cover no-repeat !important;
    background-color: transparent !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
    padding: 2rem 20px;
}

/* Ensure the home hero uses the background image as base (overrides any inline/previous black background) */
#home.hero {
    /* background image as base for the home section */
    background-image: url('../img/backgroundpic.jpg') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    /* optional parallax feel; remove if undesired */
    background-attachment: fixed !important;
    background-color: transparent !important;
    position: relative; /* needed for overlay positioning */
    overflow: hidden;
}

/* add a subtle dark overlay so white text is readable on the photo
   override global `.hero::before` disable with higher specificity + !important */
#home.hero::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35); /* tweak opacity to taste */
    z-index: 0 !important;
    pointer-events: none !important;
}

/* ensure the hero content sits above the overlay */
#home.hero .hero-content {
    position: relative;
    z-index: 1 !important;
}

/* completely disable any overlay pseudo-elements that may add gradients */
.hero::before,
.hero::after {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.5rem; /* aggiunto gap per maggiore distanza tra logo e frasi */
}

#hero-image {
    display: block;
    width: 60%;
    max-width: 900px;
    height: auto;
    margin: 0 auto 3.5rem; /* aumentato lo spazio sotto il logo */
}

/* Imposta dimensione leggibile: 1.4rem e ripristina spazio tra titolo e sottotitolo */
.hero h1 {
    font-size: 1.4rem !important;       /* nuovo valore */
    margin-bottom: 0.2rem;                /* ripristinata la distanza tra le frasi */
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
    text-align: center;
    font-family: 'Komu', sans-serif !important;
}

.hero-subtitle {
    color: var(--accent-color) !important;
    font-weight: 500;
    font-size: 1.4rem !important;       /* nuovo valore */
    white-space: nowrap;
    text-align: center;
}

/* Forza le stesse dimensioni anche nelle breakpoint che prima aumentavano il font */
@media (max-width: 768px) {
    .hero h1,
    .hero-subtitle {
        font-size: 1.4rem !important;
    }

    /* mantiene la responsività del logo */
    #hero-image {
        width: 100%;
    }
}

/* Fix: prevent mobile browsers from stretching the background image */
@media (max-width: 992px) {
    #home.hero {
        /* disable fixed attachment (mobile bug) */
        background-attachment: scroll !important;
        /* ensure the image keeps its aspect ratio while covering the area */
        background-size: cover !important;
        -webkit-background-size: cover !important; /* safari/android fallback */
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}

/* Very small devices: use same safe settings */
@media (max-width: 420px) {
    #home.hero {
        background-attachment: scroll !important;
        background-size: cover !important;
        -webkit-background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
    }
}

/* CTA button: ripristino stile completo e hover */
.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
    border: none;
    cursor: pointer;
}

.cta-button:hover,
.cta-button:focus {
    background: #e55a2b;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    outline: none;
}

/* Move CTA further down under the subtitle (DESKTOP) */
.hero-texts .cta-button {
    margin-top: 8rem;     /* increased gap on desktop (was 1.6rem) */
    transform: translateY(0); /* base transform */
    transition: transform 0.25s ease, margin 0.25s ease;
}

/* Slightly larger gap on tablet / mobile so the button doesn't feel cramped */
@media (max-width: 992px) {
    .hero-texts .cta-button {
        margin-top: 1.8rem;
    }
}

@media (max-width: 768px) {
    .hero-texts .cta-button {
        margin-top: 2rem;
    }
}

/* Very small phones: keep comfortable spacing but avoid pushing off-screen */
@media (max-width: 420px) {
    .hero-texts .cta-button {
        margin-top: 2.2rem;
    }
}

/* Optional: subtle lift on hover/focus to keep affordance */
.hero-texts .cta-button:hover,
.hero-texts .cta-button:focus {
    transform: translateY(-4px);
}

/* Slightly larger gap on mobile so the button doesn't feel cramped */
@media (max-width: 768px) {
    .hero-texts .cta-button {
        margin-top: 1rem;
    }
}

/* Sections */
section {
    padding: 60px 0; /* Ridotto da 80px per diminuire spazio tra sezioni */
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto;
    border-radius: 2px;
}

h3 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.service-card h3 {
    margin: 2rem 0 0.5rem; /* Riduci margin-bottom per bilanciare con h4 */
}

.service-card h4 {
    margin-bottom: 1rem; /* Mantieni per simmetria con h3 */
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.about-text h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.about-text p {
    font-size: 1.1rem; /* Aumentato da 1rem a 1.1rem */
    margin-bottom: 1.5rem;
    color: var(--text-color);
    opacity: 0.9;
    text-align: center;
    max-width: 800px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
    line-height: 1.5; /* Aggiunto per migliorare la leggibilità */
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.service-card i {
    color: var(--accent-color);
    font-size: 3rem; /* Aumentato da 2rem a 4rem per renderle almeno il doppio più grandi */
    margin-bottom: 1rem;
}

.service-card p {
    opacity: 0.8; /* Riduce la luminosità del testo senza renderlo grigio */
}

.service-card.full-width {
    grid-column: 1 / -1;
}

/* Kill-switch: niente bordi/outline/overlay su card (anche se è un <a>) */
.service-card,
a.service-card,
.service-card a {
	-webkit-tap-highlight-color: transparent !important;
	border: 0 !important;
	border-color: transparent !important;
	outline: 0 !important;
	text-decoration: none !important;
}

/* Stati interattivi: niente ring/overlay in Safari */
.service-card:hover,
.service-card:focus,
.service-card:focus-visible,
.service-card:focus-within,
.service-card:active,
a.service-card:hover,
a.service-card:focus,
a.service-card:focus-visible,
a.service-card:active {
	border: 0 !important;
	border-color: transparent !important;
	outline: 0 !important;
	background: inherit !important;
	background-image: none !important;
	box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important; /* Aumentato da var(--card-shadow) per effetto hover più visibile */
}

/* Rimuovi eventuali pseudo-elementi usati come overlay di hover */
.service-card::before,
.service-card::after {
	content: none !important;
	display: none !important;
}

.service-card.main-message h3 {
    font-size: 1.5rem;
}

/* Gallery Section */
#gallery {
    padding-top: 10px; /* Ridotto da 60px */
    padding-bottom: 10px; /* Ridotto da 60px */
}

#gallery h2 {
    margin-bottom: 1.5rem; /* Ridotto da 3rem */
}

.carousel {
    width: min(90vw, 100%);
    position: relative;
    margin: 0 auto;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    position: relative;
    margin-bottom: 2rem;
    border-radius: 0; /* Rimuovi border-radius per evitare effetto tagliato */
    overflow: hidden;
    box-shadow: none; /* Rimuovi ombra */
    background: transparent; /* Rimuovi sfondo */
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-img {
    width: 100%;
    height: 80vh; /* Imposta altezza fissa per mantenere dimensioni costanti */
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    background: transparent; /* Rimuovi background grigio per evitare bande */
}

@media (max-width: 768px) {
    #main-img {
        height: 60vh; /* Altezza fissa anche su mobile */
        object-fit: contain;
    }
}

@media (max-width: 768px) {
    .gallery .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .carousel {
        width: 90vw;
    }

    /* Riduci spazi verticali per la galleria su mobile */
    #gallery {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .main-image {
        margin-bottom: 1rem;
    }
}

.carousel-control {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.carousel-control.prev {
    left: 1.5rem;
}

.carousel-control.next {
    right: 1.5rem;
}

.carousel-control i {
    font-size: 1.25rem;
}

.carousel-control:hover,
.carousel-control:focus-visible {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.carousel-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

@media (max-width: 768px) {
    .carousel-control {
        width: 2.75rem;
        height: 2.75rem;
    }

    .carousel-control i {
        font-size: 1rem;
    }

    .carousel-control.prev {
        left: 0.75rem;
    }

    .carousel-control.next {
        right: 0.75rem;
    }
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 5px;
    flex-shrink: 0;
}

.info-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    margin-left: 0; /* Remove extra indent for better alignment */
}

.info-item p {
    color: var(--text-color);
    opacity: 0.8;
    text-align: left; /* Ensure left alignment */
    margin: 0;
}

.info-item a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.info-item a:hover {
    color: var(--accent-color);
    opacity: 1;
}

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 1rem;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.contact-form button {
    width: 100%;
    padding: 15px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contact-form button:hover {
    background: #e55a2b;
}

.contact-map {
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.contact-map iframe {
    width: 100%;
    height: 450px;
    border: none;
}

@media (max-width: 768px) {
    .info-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0;
    }

    .info-item i {
        display: block;
        margin: 0 auto 0.5rem;
    }

    .info-item h4 {
        margin-left: 0;
        margin-bottom: 0.5rem;
        margin-right:9px
    }

    .info-item p {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .info-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0;
    }

    .info-item i {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

    .info-item h4 {
        margin-left: 0;
        margin-bottom: 0.5rem;

    }

    .info-item p {
        text-align: center;
    }
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: #fff;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section p {
    color: #ccc;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: #ccc;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.4rem; /* aggiornato per evitare override con valore più grande */
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    #hero-image {
        width: 100%;
    }
    
    .hamburger {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0;
        text-align: center;
        padding: 1rem 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .nav-menu li a {
        font-size: 1.2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .hero h1 {
        white-space: normal !important; /* allow wrapping */
        word-break: break-word;        /* break long words */
        hyphens: auto;                 /* hyphenate if supported */
        font-size: 1.2rem !important;  /* slightly smaller for narrow screens */
        line-height: 1.2;              /* tighter line height for better fit */
    }

    /* Mostra l'interruzione di riga solo su mobile */
    .mobile-break {
        display: block;
    }

    #language-select {
        margin-left: -30px;
    }

    /* Ensure contact labels stay aligned on small screens */
    .contact-info .info-item h4 {
        margin-left: 0px;
    }
}

/* MOBILE: show a dedicated IG icon left of hamburger, hide desktop IG in nav-right */
.nav-instagram.mobile-only {
    display: none; /* hidden by default (desktop) */
}

@media (max-width: 768px) {
    /* show mobile IG, hide desktop IG */
    .nav-instagram.mobile-only {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 1.4rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        text-decoration: none;
    }

    /* hide the IG link inside .nav-right (desktop position) when on mobile */
    .nav-right .nav-instagram {
        display: none !important;
    }

    /* push hamburger to the far right so mobile IG stays to its left */
    .hamburger {
        margin-left: auto !important;
        order: 3;
    }

    /* ensure nav layout stays stable */
    nav {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .service-card {
        padding: 2rem;
    }
}

/* Nascondi l'interruzione di riga su desktop */
.mobile-break {
    display: none;
}

/* Modal Styles */
.modal {
    display: none !important;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

#privacy-toggle:checked ~ #privacy-modal {
    display: block !important;
}

.modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 5% auto;
    padding: 50px 20px 20px 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 60%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: var(--card-shadow);
    position: relative;
}

.close {
    color: var(--text-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    float: none;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

#privacy-link {
    cursor: pointer;
    text-decoration: underline;
    color: #ccc;
    transition: color 0.3s ease;
}

#privacy-link:hover {
    color: var(--accent-color);
}

#manage-cookies-link {
    cursor: pointer;
    text-decoration: underline;
    color: #ccc;
    transition: color 0.3s ease;
}

#manage-cookies-link:hover {
    color: var(--accent-color);
}

/* Cookie Consent Banner Styles */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--footer-bg);
    color: #fff;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    display: none; /* Hidden by default, shown via JS */
}

.cookie-consent-content p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.cookie-consent-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-accept {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-accept:hover { background: #e55a2b; }

.btn-reject {
    background: #666;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-reject:hover { background: #555; }

.btn-customize {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-customize:hover {
    background: #fff;
    color: var(--footer-bg);
}

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 15px;
    }
    
    .cookie-consent-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cookie-consent-buttons button {
        width: 100%;
        max-width: 200px;
    }

    /* Ensure contact labels stay aligned on small screens */
    .contact-info .info-item h4 {
        margin-left: 13px;
    }
}

h1, h2, h3, h4, h5, h6, 
.nav-menu li a,
.cta-button {
    font-family: 'Komu', 'Erbaum Black', 'Winner Sans Comp', 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    /* headings should use bold face */
    font-weight: 700;
}

.line-break-text {
    white-space: pre-line !important;
    display: block !important;
    text-align: center !important;
}

/* Global: force Erbaum Black everywhere and convert all visible text to UPPERCASE
   Keep existing font-size rules intact (we do NOT change any font-size). */
html, body,
h1, h2, h3, h4, h5, h6,
p, a, span, li, label, small, strong, em,
input, textarea, button, select, option,
.nav-menu li a, .cta-button, .service-card, .footer-section, .cookie-consent-content,
.hero-subtitle, .info-item, .contact-form, .footer-bottom {
    font-family: 'Komu', 'Erbaum Black', 'Winner Sans Comp', 'Bebas Neue', sans-serif !important;
    text-transform: uppercase !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure form placeholders and select/options are uppercase too */
input::placeholder,
textarea::placeholder {
    text-transform: uppercase !important;
    font-family: 'Komu','Erbaum Black', 'Winner Sans Comp', sans-serif !important;
}

select, option {
    font-family: 'Komu','Erbaum Black', 'Winner Sans Comp', sans-serif !important;
    text-transform: uppercase !important;
}

/* Buttons (including cookie banner buttons) */
button, .cta-button {
    font-family: 'Komu', 'Erbaum Black', 'Winner Sans Comp', 'Bebas Neue', sans-serif !important;
    text-transform: uppercase !important;
}

/* Keep hero content readable: don't change sizes or spacing here (only uppercase) */
#home.hero .hero-content,
.hero h1,
.hero-subtitle {
    /* sizes preserved; only enforce font + uppercase */
    font-family: 'Komu','Erbaum Black', 'Winner Sans Comp', 'Bebas Neue', sans-serif !important;
    text-transform: uppercase !important;
}

/* Make hero texts responsive and allow wrapping (prevent cutting on mobile) */
#home.hero .hero-texts {
    max-width: 92vw;               /* limit width to viewport */
    width: min(900px, 92%);        /* keep reasonable max on large screens */
    overflow: visible !important;  /* avoid being clipped when absolutely positioned */
    white-space: normal !important;/* allow wrapping */
    word-break: break-word;        /* break long words if needed */
    hyphens: auto;                 /* allow hyphenation for better wrap */
    padding: 0 1rem;               /* breathing room on edges */
}

/* Allow headings/subtitle to wrap and scale on small screens */
#home.hero .hero-texts h1,
#home.hero .hero-texts .hero-subtitle,
.hero h1,
.hero-subtitle {
    white-space: normal !important;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.15;
}

/* Responsive font sizing to avoid overflow / clipping */
@media (max-width: 992px) {
    #home.hero .hero-texts h1,
    #home.hero .hero-texts .hero-subtitle {
        font-size: clamp(1rem, 4.5vw, 1.2rem) !important;
    }
}

/* Mobile-specific: ensure the hero container doesn't clip the absolutely positioned texts */
@media (max-width: 768px) {
    #home.hero {
        overflow: visible !important;
    }

    /* bring texts a bit higher if needed and keep wrapping */
    #home.hero .hero-texts {
        top: 72% !important;
        max-width: 94vw;
        padding: 0 1.2rem;
    }

    #home.hero .hero-texts h1,
    #home.hero .hero-texts .hero-subtitle {
        font-size: clamp(0.95rem, 5.5vw, 1.15rem) !important;
        line-height: 1.15;
    }
}

/* Very small phones */
@media (max-width: 420px) {
    #home.hero .hero-texts {
        top: 70% !important;
    }
    #home.hero .hero-texts h1,
    #home.hero .hero-texts .hero-subtitle {
        font-size: clamp(0.9rem, 6.5vw, 1.05rem) !important;
        line-height: 1.1;
    }
}

/* Hide Instagram icon in nav-right (desktop) to remove it completely */
.nav-right .nav-instagram {
    display: none !important;
}

/* Fix H1 text cutting on mobile (e.g., iPhone 16) by allowing wrapping and reducing font-size */
@media (max-width: 768px) {
    .hero h1 {
        white-space: normal !important; /* allow wrapping */
        word-break: break-word;        /* break long words */
        hyphens: auto;                 /* hyphenate if supported */
        font-size: 1.2rem !important;  /* slightly smaller for narrow screens */
        line-height: 1.2;              /* tighter line height for better fit */
    }
}

.service-card.main-message p {
    font-size: 1.3rem; /* Ridotto leggermente per minore prominenza */
}