/* --- BASE --- */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Montserrat', sans-serif; color: #333; background: #fff; line-height: 1.6; }

.page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER SPLIT --- */
.header-wrapper {
    max-width: 1100px;
    margin: 40px auto 35px auto;
}

.header-split {
    display: flex;
    height: 360px;
    background: #000;
    overflow: hidden;
}

.header-logo-area {
    flex: 0 0 35%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 25px;
    background: #000;
}

.logo-box {
    width: 100%;
    max-width: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* LOGO - Dimensioni e rendering ottimizzati */
.tm-logo {
    max-width: 240px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.header-image-area {
    flex: 0 0 65%;
    background: url('images/hero.jpg') center center / cover no-repeat;
}

/* --- INTRO --- */
.intro-sub-text {
    text-align: center;
    padding: 30px 0;
    font-style: italic;
    color: #666;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

/* --- TITOLO SEZIONE CARDS (AGGIUNTO) --- */
.cards-title-section {
    text-align: center;
    padding: 20px 0 40px 0;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 2.2rem;
    font-weight: 400;
    margin: 0 0 15px 0;
    color: #333;
}

.title-line {
    width: 100px;
    border: 0;
    border-top: 2px solid #333;
    margin: 0 auto;
}

/* --- GRIGLIA FEATURES --- */
.container { max-width: 1100px; margin: 0 auto; }
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 40px; 
    padding: 0 0 40px 0; 
}
.card { 
    text-align: center; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

/* Immagini circolari - dimensioni corrette */
.img-container { 
    width: 290px; 
    height: 290px; 
    margin-bottom: 15px; 
    border-radius: 50%; 
    overflow: hidden; 
    border: 1px solid #eee; 
}
.img-container img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}

/* Titoli cards */
.card-text {
    min-height: 3.2em; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 400;
    color: #333;
    line-height: 1.4;
}

/* PULSANTI */
.btn { 
    display: inline-block; 
    padding: 11px 26px;
    background: #000; 
    color: #d1d1d1;   
    font-weight: bold; 
    text-decoration: none; 
    font-size: 0.75rem;
    letter-spacing: 1.5px; 
    transition: 0.3s;
    border: none;
    text-transform: uppercase;
    border-radius: 6px; 
}
.btn:hover { background: #333; color: #fff; }

/* --- CAROSELLO --- */
.gallery-title { 
    display: flex; 
    align-items: center; 
    margin-bottom: 30px; 
    font-family: 'Playfair Display', serif; 
    font-style: italic; 
    font-size: 1.15rem;
    letter-spacing: 0.4px;
}
.gallery-title hr { 
    flex: 1; 
    border: 0; 
    border-top: 1px solid #ddd; 
    margin: 0 15px; 
}

.carousel-container { 
    position: relative; 
    overflow: hidden; 
    border-radius: 4px; 
    box-shadow: 0 5px 18px rgba(0,0,0,0.06);
}

.carousel-slide { 
    display: flex; 
    transition: transform 0.6s ease-in-out; 
}
.carousel-slide img { 
    width: 100%; 
    height: 520px;
    object-fit: contain; 
    background: #f9f9f9; 
    flex-shrink: 0; 
}

.carousel-prev, 
.carousel-next { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(100, 100, 100, 0.25);
    border: none; 
    width: 40px;
    height: 40px;
    cursor: pointer; 
    z-index: 10; 
    font-size: 0;
    transition: background 0.3s;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-prev::before,
.carousel-next::before {
    content: '';
    width: 12px;
    height: 12px;
    border-left: 2px solid #777;
    border-bottom: 2px solid #777;
    display: inline-block;
}

.carousel-prev::before {
    transform: rotate(45deg);
    margin-left: 4px;
}

.carousel-next::before {
    transform: rotate(-135deg);
    margin-right: 4px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(100, 100, 100, 0.4);
}

.carousel-prev:hover::before,
.carousel-next:hover::before {
    border-color: #555;
}
.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.thumbnail-container { 
    display: flex; 
    gap: 8px; 
    overflow-x: auto; 
    padding: 20px 0; 
    justify-content: center; 
}
.thumbnail-container img { 
    width: 90px !important; 
    height: 65px !important; 
    object-fit: cover; 
    flex-shrink: 0; 
    opacity: 0.4; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: 0.3s; 
}
.thumbnail-container img.active { 
    opacity: 1; 
    border: 2px solid #333; 
}

/* --- CONTATTI --- */
.contact { 
    text-align: center; 
    padding: 80px 0; 
    border-top: 1px solid #eee; 
}

.contact-title { 
    font-family: 'Playfair Display', serif; 
    font-style: italic; 
    font-size: 2.4rem;
    font-weight: 400; 
    margin-bottom: 10px; 
}

.short-line { 
    width: 45px;
    border: 1px solid #000; 
    margin: 0 auto 30px; 
}

.contact-sub { 
    font-size: 1.2rem; 
    margin-bottom: 30px; 
    font-weight: 300; 
}

.discount-text { 
    max-width: 800px; 
    margin: 0 auto 20px; 
    color: #555; 
    line-height: 1.7;
}

.payment-note { 
    font-style: italic; 
    color: #888; 
    margin-bottom: 40px; 
    font-size: 0.95rem; 
}

.address-details { 
    margin-bottom: 50px; 
}

.brand-name-contact { 
    font-size: 1.5rem; 
    font-weight: 400; 
    margin-bottom: 15px; 
}

.address-details p { 
    margin: 5px 0; 
    color: #444; 
}

.address-details a { 
    color: inherit; 
    text-decoration: none; 
    border-bottom: 1px solid #ccc;
    transition: border-color 0.3s;
}

.address-details a:hover {
    border-bottom-color: #333;
}

.map-wrapper { 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
}

footer { 
    text-align: center; 
    padding: 40px; 
    font-size: 0.85rem; 
    color: #999; 
    border-top: 1px solid #eee; 
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    /* Header full-width su mobile */
    .header-wrapper {
        max-width: 100%;
        margin: 0 0 25px 0;
    }
    
    .header-split { 
        flex-direction: column; 
        height: auto; 
    }
    
    .header-logo-area { 
        flex: 0 0 100%; 
        height: 280px;
    }
    
    .header-image-area { 
        flex: 0 0 100%; 
        height: 240px;
    }
    
    .header-logo-area {
        padding: 30px 20px;
    }
    
    .tm-logo,
    .logo-box {
        max-width: 225px;
    }
    
    /* Titolo sezione cards */
    .main-title {
        font-size: 1.8rem;
    }
    
    /* Cards con gap corretto */
    .grid {
        gap: 45px;
        padding: 0 0 30px 0;
    }
    
    /* Immagini circolari - dimensioni mobile ottimizzate con protezione overflow */
    .img-container {
        width: min(340px, 90vw);
        height: min(340px, 90vw);
        margin-bottom: 15px;
    }
    
    /* Carousel mobile - altezza ridotta */
    .carousel-slide img { 
        height: 270px;
    }
    
    /* Frecce carousel più piccole su mobile */
    .carousel-prev,
    .carousel-next {
        width: 35px;
        height: 35px;
    }
    
    .carousel-prev::before,
    .carousel-next::before {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }
    
    /* Titoli contact */
    .contact-title {
        font-size: 2.2rem;
    }
    
    .contact-sub {
        font-size: 1.2rem;
    }
    
    /* Intro text */
    .intro-sub-text {
        font-size: 1rem;
        padding: 30px 15px;
    }
}

/* Ottimizzazione per schermi molto piccoli */
@media (max-width: 480px) {
    .img-container {
        width: min(260px, 88vw);
        height: min(260px, 88vw);
    }
    
    .main-title {
        font-size: 1.6rem;
    }
    
    .carousel-slide img {
        height: 240px;
    }
}

/* --- OTTIMIZZAZIONI PERFORMANCE --- */
html {
    scroll-behavior: smooth;
}

.thumbnail-container {
    -webkit-overflow-scrolling: touch;
}
