/*
Theme Name: CB NEW Custom Theme
Theme URI: https://www.posizionamentoweb.com
Description: Tema WordPress custom e accessibile sviluppato per il restyling di CB NEW.
Version: 1.0.0
Author: PosizionamentoWeb / Saitek
Author URI: https://www.posizionamentoweb.com
Text Domain: cbnew
*/

/* ==========================================================================
   1. VARIABILI E UTILITY BASE
   ========================================================================== */
:root {
    --brand-red: #b91c1c;
    --primary-blue: #0a2f50;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Flex Helper Classes */
.flex-between { display: flex; justify-content: space-between; }
.flex-align-center { display: flex; align-items: center; }

/* ==========================================================================
   2. HEADER & NAVIGAZIONE
   ========================================================================== */
.site-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Top bar rossa */
.top-bar {
    background: var(--brand-red);
    color: var(--white);
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
}
.top-bar a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.2s;
}
.top-bar a:hover { opacity: 0.8; }
.top-bar .separator { margin: 0 10px; opacity: 0.5; }
.top-contacts, .top-social { display: flex; align-items: center; gap: 8px; }

/* Menu Principale & Logo */
.main-nav { 
    padding: 8px 0; /* Ridotto il padding verticale per bilanciare l'altezza totale */
}
.logo-wrapper { display: flex; flex-direction: column; position: relative; }
.site-logo-link { 
    text-decoration: none; 
    color: inherit; 
    display: inline-flex;
    align-items: center;
}

.site-logo-img {
    height: 125px; /* Aumentata l'altezza per renderlo ben visibile */
    max-height: 130px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}
.site-logo-link:hover .site-logo-img {
    transform: scale(1.02);
}

.nav-and-cta { gap: 30px; }
.nav-list { display: flex; list-style: none; gap: 24px; }
.nav-list a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-list a:hover { color: var(--brand-red); }

/* Voce di menu della pagina corrente: testo rosso + sottolineatura */
.nav-list a { position: relative; }
.nav-list .current-menu-item > a,
.nav-list .current_page_item > a,
.nav-list .current-menu-ancestor > a,
.nav-list .current-page-ancestor > a {
    color: var(--brand-red);
}
.nav-list .current-menu-item > a::after,
.nav-list .current_page_item > a::after,
.nav-list .current-menu-ancestor > a::after,
.nav-list .current-page-ancestor > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--brand-red);
    border-radius: 2px;
}

/* Bottone Preventivo Header */
.btn-header-cta {
    background: var(--brand-red);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    transition: background-color 0.2s;
}
.btn-header-cta:hover { background-color: #991b1b; }

/* ==========================================================================
   3. SEZIONE HERO (SFONDO TORINO)
   ========================================================================== */
.hero-section {
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 140px 0;
}
.hero-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}
.hero-title .text-highlight {
    color: #ef4444;
}
.hero-subtitle {
    font-size: 16px;
    max-width: 580px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 35px;
}
.hero-cta-group {
    display: flex;
    gap: 15px;
}
.btn-hero {
    padding: 14px 28px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.2s;
}
.btn-hero:hover {
    transform: translateY(-2px);
}
.btn-red-solid {
    background: var(--brand-red);
    color: var(--white);
}
.btn-red-solid:hover { background-color: #991b1b; }
.btn-outline-white {
    border: 2px solid var(--white);
    color: var(--white);
}
.btn-outline-white:hover {
    background: var(--white);
    color: var(--primary-blue);
}
/* ==========================================================================
   4. BARRA PUNTI DI FORZA (4 VALORI)
   ========================================================================== */
.features-bar-section {
    background: var(--white);
    padding: 40px 0;
    border-bottom: 1px solid #e2e8f0;
}
.grid-4-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}
.feature-item-box {
    text-align: center;
}
.feature-item-icon {
    font-size: 28px;
    color: var(--brand-red);
    margin-bottom: 10px;
}
.feature-item-box h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}
.feature-item-box p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   5. GRIGLIE PRODOTTI E SERVIZI
   ========================================================================== */
.services-section {
    padding: 60px 0;
    background: var(--white);
}
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
    position: relative;
    color: var(--primary-blue);
}
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--brand-red);
    margin: 10px auto 0;
}

/* Griglia a 5 Colonne (Mockup Catalogo) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Griglia a 3 Colonne (Macro-servizi Reali) */
.services-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.services-grid-3 .service-card {
    text-align: left;
}

/* Card Generica */
.service-card {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.service-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #e2e8f0;
    display: block;
}
.card-content {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}
.card-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
    text-transform: uppercase;
}
.card-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}
.read-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-red);
    text-decoration: none;
    text-transform: uppercase;
    margin-top: auto;
}

/* ==========================================================================
   6. BARRA MARCHI SUPPORTATI (SEO)
   ========================================================================== */
.brands-section {
    background: var(--bg-light);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}
.brands-section h3 {
    font-size: 16px;
    color: var(--primary-blue);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.brands-section p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.brands-list {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: 0.05em;
}
.brands-list span {
    color: var(--brand-red);
    margin: 0 10px;
}

/* ==========================================================================
   7. SEZIONE PERCHÉ SCEGLIERE CB NEW
   ========================================================================== */
.why-choose-us-section {
    padding: 80px 0;
    background: var(--bg-light);
}
.grid-split-why {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}
.why-eyebrow {
    color: var(--brand-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 10px;
}
.why-main-text h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.2;
    margin-bottom: 20px;
}
.why-main-text p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}
.btn-why-more {
    background: var(--brand-red);
    color: var(--white);
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    display: inline-block;
    transition: background-color 0.2s;
}
.btn-why-more:hover { background-color: #991b1b; }

.why-check-list {
    list-style: none;
}
.why-check-list li {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.check-icon {
    color: var(--brand-red);
    font-weight: 900;
}

/* ==========================================================================
   8. FORM DI CONTATTO / PREVENTIVO
   ========================================================================== */
.quote-form-section {
    padding: 80px 0;
    background: var(--white);
}
.m-max-600 {
    max-width: 700px;
}
.form-heading {
    text-align: center;
    margin-bottom: 40px;
}
.form-eyebrow {
    color: var(--brand-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 10px;
}
.form-heading h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 15px;
}
.form-heading p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}
.form-wrapper label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}
.form-wrapper input[type="text"],
.form-wrapper input[type="email"],
.form-wrapper input[type="tel"],
.form-wrapper select,
.form-wrapper textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}
.form-wrapper input:focus,
.form-wrapper select:focus,
.form-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(10, 47, 80, 0.1);
    background-color: var(--white);
}
.form-wrapper textarea {
    height: 120px;
    resize: vertical;
}
.btn-submit,
.wpcf7-form input[type="submit"] {
    display: inline-block;
    width: auto;
    background: var(--brand-red);
    color: var(--white);
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.btn-submit:hover,
.wpcf7-form input[type="submit"]:hover { background-color: #991b1b; transform: translateY(-2px); }
.btn-submit:active,
.wpcf7-form input[type="submit"]:active { transform: translateY(0) scale(0.99); }
.wpcf7-form input[type="submit"]:focus-visible { outline: 3px solid rgba(185, 28, 28, 0.35); outline-offset: 2px; }

/* Campo "Allega file" di Contact Form 7: riquadro tratteggiato + pulsante blu coerente con le CTA */
.wpcf7-form input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    background-color: var(--bg-light);
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-muted);
}
.wpcf7-form input[type="file"]::file-selector-button {
    margin-right: 14px;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    background: var(--primary-blue);
    color: var(--white);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s;
}
.wpcf7-form input[type="file"]::file-selector-button:hover { background: #082238; }

@media (max-width: 600px) {
    .wpcf7-form input[type="submit"] { width: 100%; }
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.footer-cta-banner {
    background: var(--brand-red);
    color: var(--white);
    padding: 30px 0;
}
.cta-phone-icon {
    font-size: 42px;
    margin-right: 20px;
    opacity: 0.9;
}
.cta-text-wrapper h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.cta-text-wrapper p {
    font-size: 14px;
    opacity: 0.85;
}
.btn-footer-white {
    background: var(--white);
    color: var(--brand-red);
    padding: 14px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    transition: background-color 0.2s, color 0.2s;
    display: inline-block;
}
.btn-footer-white:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.footer-main-content {
    background: #111827;
    color: #e5e7eb;
    padding: 60px 0;
}
.grid-4-footer {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.9fr 1.1fr;
    gap: 40px;
}
.footer-col h3 {
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 25px;
    position: relative;
}
.footer-col h3::after {
    content: '';
    display: block;
    width: 25px;
    height: 2px;
    background: var(--brand-red);
    margin-top: 8px;
}
.brand-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: #9ca3af;
    margin: 15px 0 20px;
}
.badge-50-footer {
    background: #f59e0b;
    color: #111827;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 5px;
}

.footer-links-list { list-style: none; }
.footer-links-list li { margin-bottom: 12px; }
.footer-links-list a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s, padding-left 0.2s;
}
.footer-links-list a:hover {
    color: var(--white);
    padding-left: 4px;
}

.footer-contacts-list { list-style: none; }
.footer-contacts-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    color: #9ca3af;
    margin-bottom: 15px;
    line-height: 1.4;
}
.footer-contacts-list a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-contacts-list a:hover { color: var(--white); }
.contact-icon {
    color: var(--brand-red);
    font-weight: bold;
}
.footer-social-icons a {
    color: #9ca3af;
    text-decoration: none;
    margin-right: 15px;
    font-weight: bold;
    transition: color 0.2s;
}
.footer-social-icons a:hover { color: var(--white); }

.footer-bottom-bar {
    background: #0f172a;
    color: #6b7280;
    padding: 20px 0;
    font-size: 12px;
    border-top: 1px solid #1e293b;
}
.legal-links a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}
.legal-links a:hover { color: #9ca3af; }
.legal-separator { margin: 0 8px; opacity: 0.3; }

/* ==========================================================================
   10. MEDIA QUERIES (RESPONSIVE GLOBALE)
   ========================================================================== */

/* Tablet Grandi (sotto 1024px) */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-4-footer {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    .nav-list { gap: 16px; }
}

/* Tablet Intermedi (sotto 968px) */
@media (max-width: 968px) {
    .grid-4-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .grid-split-why {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero-title { font-size: 32px; }
}

/* Mobile & Tablet Piccoli (sotto 768px) */
@media (max-width: 768px) {
    .top-bar { display: none; }
    
    .main-nav .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .site-logo-img {
        height: 80px;
        margin: 0 auto;
    }
    .nav-and-cta {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    .nav-list {
        justify-content: center;
        flex-wrap: wrap;
    }
    .services-grid, 
    .services-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-cta-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .cta-message-box {
        flex-direction: column;
    }
    .cta-phone-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    .btn-footer-white {
        width: 100%;
        text-align: center;
    }
}

/* Smartphone (sotto 560px / 520px) */
@media (max-width: 560px) {
    .grid-4-footer {
        grid-template-columns: 1fr;
    }
    .footer-bottom-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .grid-4-features,
    .services-grid, 
    .services-grid-3 {
        grid-template-columns: 1fr;
    }
    .hero-cta-group {
        flex-direction: column;
    }
    .btn-hero,
    .btn-header-cta {
        width: 100%;
        justify-content: center;
        display: block;
        text-align: center;
    }
    .nav-list {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==========================================================================
   STILE PAGINE INTERNE (page.php)
   ========================================================================== */
.internal-page-hero {
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.internal-page-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.breadcrumbs {
    font-size: 13px;
    opacity: 0.8;
}

.breadcrumbs a {
    color: var(--white);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.internal-page-content {
    padding: 60px 0;
    background: var(--white);
}

.page-entry-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
}

.page-entry-body h2 {
    font-size: 26px;
    color: var(--primary-blue);
    margin: 30px 0 15px;
    font-weight: 700;
}

.page-entry-body p {
    margin-bottom: 20px;
}

.page-entry-body ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.page-entry-body li {
    margin-bottom: 8px;
}


/* ==========================================================================
   STILE SINGOLI ARTICOLI (single.php)
   ========================================================================== */
.m-max-800 {
    max-width: 800px;
}

.post-meta-hero {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.single-post-featured-image {
    margin-bottom: 30px;
    border-radius: 4px;
    overflow: hidden;
}

.single-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ==========================================================================
   STILE PAGINA SERVIZI DEDICATA (page-servizi.php)
   ========================================================================== */
.services-detail-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.service-row-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    background: var(--white);
    border-radius: 8px;
    padding: 35px;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-row-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* Inversione alternata per l'immagine a destra */
.service-row-card.reverse-row {
    grid-template-areas: "info media";
}
.service-row-card.reverse-row .service-card-media { grid-area: media; }
.service-row-card.reverse-row .service-card-info { grid-area: info; }

.service-card-media {
    border-radius: 6px;
    overflow: hidden;
    height: 320px;
}

.service-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.service-row-card:hover .service-card-media img {
    transform: scale(1.03);
}

.service-card-info h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 10px 0 15px;
}

.service-card-info p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.service-badge {
    display: inline-block;
    background: rgba(10, 47, 80, 0.08);
    color: var(--primary-blue);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.08em;
}

.service-badge.red-badge {
    background: rgba(185, 28, 28, 0.08);
    color: var(--brand-red);
}

/* Box Normative EN */
.normative-box {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
}

.normative-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-blue);
    display: block;
    margin-bottom: 8px;
}

.normative-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tag-norma {
    background: #f1f5f9;
    color: var(--brand-red);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease, border-color 0.2s ease;
}

a.tag-norma:hover,
a.tag-norma:focus-visible {
    background: #e2e8f0;
    border-color: var(--brand-red);
}

/* Responsive per Tablet e Mobile */
@media (max-width: 868px) {
    .service-row-card,
    .service-row-card.reverse-row {
        grid-template-columns: 1fr;
        grid-template-areas: none;
        gap: 25px;
        padding: 20px;
    }
    .service-row-card.reverse-row .service-card-media { grid-area: auto; }
    .service-row-card.reverse-row .service-card-info { grid-area: auto; }
    
    .service-card-media {
        height: 220px;
    }
}

/* ==========================================================================
   STILE PRODOTTI, REALIZZAZIONI E CONTATTI
   ========================================================================== */
.catalog-intro {
    margin-bottom: 45px;
}
.catalog-intro h2 {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 10px;
}
.catalog-intro p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Griglia Prodotti */
.products-catalog-section {
    padding: 80px 0;
    background: var(--bg-light);
}
.products-grid-catalog {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.product-catalog-card {
    background: var(--white);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.09);
}
.product-card-thumb {
    position: relative;
    height: 200px;
}
.product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--brand-red);
    color: var(--white);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}
.product-card-body {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-card-body h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 10px;
}
.product-card-body p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}
.btn-card-action {
    margin-top: auto;
    font-size: 12px;
    font-weight: 800;
    color: var(--brand-red);
    text-decoration: none;
    letter-spacing: 0.05em;
}

/* Galleria Portfolio */
.gallery-portfolio-section {
    padding: 80px 0;
    background: var(--white);
}
.gallery-grid-portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.gallery-item-card {
    position: relative;
    height: 260px;
    border-radius: 6px;
    overflow: hidden;
}
.gallery-item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 47, 80, 0.9), transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: var(--white);
    opacity: 0.9;
    transition: opacity 0.3s ease;
}
.gallery-overlay h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.gallery-overlay p { font-size: 13px; opacity: 0.85; }
.gallery-item-card:hover img { transform: scale(1.06); }

/* Pagina Contatti */
.contact-boxes-section {
    padding: 60px 0 40px;
    background: var(--bg-light);
}
.grid-3-contact-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.contact-info-card {
    background: var(--white);
    border-radius: 8px;
    padding: 35px 25px;
    text-align: center;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.contact-card-icon {
    font-size: 36px;
    color: var(--primary-blue);
    margin-bottom: 15px;
}
.contact-info-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 10px;
}
.contact-info-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}
.phone-numbers {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
}
.phone-numbers a {
    color: var(--primary-blue);
    text-decoration: none;
}
.btn-card-blue, .btn-card-red, .btn-card-green {
    margin-top: auto;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    color: var(--white);
}
.btn-card-blue { background: var(--primary-blue); }
.btn-card-red { background: var(--brand-red); }
.btn-card-green { background: #16a34a; }

.map-and-details-section {
    padding: 60px 0;
    background: var(--white);
}
.grid-split-map {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    align-items: center;
}
.office-details-box h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 5px;
}
.subtitle-address {
    font-size: 15px;
    color: var(--brand-red);
    font-weight: 600;
    margin-bottom: 25px;
}
.details-list { list-style: none; }
.details-list li {
    font-size: 14.5px;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.6;
}
.details-list a { color: var(--primary-blue); text-decoration: none; font-weight: 600; }

/* Responsive per Prodotti e Contatti */
@media (max-width: 968px) {
    .products-grid-catalog,
    .gallery-grid-portfolio,
    .grid-3-contact-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-split-map {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 580px) {
    .products-grid-catalog,
    .gallery-grid-portfolio,
    .grid-3-contact-cards {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   STILE PAGINA AZIENDA (page-azienda.php)
   ========================================================================== */
.about-company-section {
    padding: 80px 0;
    background: var(--white);
}

.grid-split-about {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
}

.about-text-content h2 {
    font-size: 30px;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 10px 0 20px;
    line-height: 1.25;
}

.lead-text {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 15px;
}

.about-text-content p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.about-media-box {
    position: relative;
}

.about-main-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    display: block;
}

.experience-badge-box {
    position: absolute;
    bottom: -20px;
    left: -20px;
    background: var(--brand-red);
    color: var(--white);
    padding: 20px 25px;
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(185, 28, 28, 0.3);
    text-align: center;
}

.badge-years {
    font-size: 32px;
    font-weight: 900;
    display: block;
    line-height: 1;
}

.badge-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.company-strengths-section {
    padding: 70px 0;
    background: var(--bg-light);
}

.grid-3-strengths {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.strength-card {
    background: var(--white);
    padding: 30px 25px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.strength-icon {
    font-size: 32px;
    color: var(--brand-red);
    margin-bottom: 15px;
}

.strength-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.strength-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 868px) {
    .grid-split-about,
    .grid-3-strengths {
        grid-template-columns: 1fr;
    }
    .experience-badge-box {
        position: static;
        margin-top: 15px;
    }
}

/* ==========================================================================
   AGGIUNTE FINALI ACCESSIBILITÀ (WCAG 2.1 AA)
   ========================================================================== */

/* 1. Focus Visibile per navigazione da tastiera */
:focus-visible {
    outline: 3px solid var(--brand-red) !important;
    outline-offset: 3px !important;
}

/* 2. Skip Link per screen reader */
.skip-link {
    position: absolute;
    top: -100px;
    left: 15px;
    background: var(--brand-red);
    color: var(--white);
    padding: 10px 18px;
    z-index: 99999;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 15px;
}

/* 3. Contrasto elevato sui testi della galleria */
.gallery-overlay {
    background: linear-gradient(to top, rgba(10, 47, 80, 0.95) 0%, rgba(10, 47, 80, 0.4) 60%, transparent 100%) !important;
}
.gallery-overlay h3 {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.gallery-overlay p {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 4. Supporto per utenti con ridotta tolleranza al movimento */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   STILE SCHEDE LAVORI E CANTIERI (page-cancelli-automatici.php)
   ========================================================================== */
.works-grid-section {
    padding: 70px 0;
    background: var(--bg-light);
}

.works-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.work-card {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.1);
}

.work-card-thumb {
    position: relative;
    height: 200px;
}

.work-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.work-location-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--primary-blue);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}

.work-card-body {
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.work-card-body h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.work-card-body p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

.btn-work-details {
    margin-top: auto;
    font-size: 13px;
    font-weight: 800;
    color: var(--brand-red);
    text-decoration: none;
    letter-spacing: 0.03em;
}

.btn-work-details:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .works-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .works-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   SEZIONE 3 STEP COME LAVORIAMO (Home)
   ========================================================================== */
.how-we-work-section {
    padding: 75px 0;
    background: var(--white);
    border-top: 1px solid #e2e8f0;
}

.grid-3-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.step-card {
    background: var(--bg-light);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 35px 25px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
}

.step-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--brand-red);
    line-height: 1;
    margin-bottom: 12px;
}

.step-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.step-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.55;
}

@media (max-width: 868px) {
    .grid-3-steps {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   LIGHTBOX / INGRANDIMENTO IMMAGINI GALLERIA
   ========================================================================== */
.gallery-lightbox-dialog {
    border: none;
    border-radius: 8px;
    background: rgba(10, 47, 80, 0.96);
    color: var(--white);
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.gallery-lightbox-dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 85vw;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.lightbox-caption {
    margin-top: 15px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: #e2e8f0;
}

.lightbox-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: var(--brand-red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

.lightbox-close-btn:hover {
    background-color: var(--brand-red-dark);
    transform: scale(1.1);
}

/* ==========================================================================
   LIGHTBOX PROFESSIONALE & ACCESSIBILE (Con Frecce)
   ========================================================================== */
.cb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.cb-lightbox.active {
    display: flex;
}

.cb-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 47, 80, 0.94);
    backdrop-filter: blur(5px);
}

.cb-lightbox-stage {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cb-lightbox-stage img {
    max-width: 88vw;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
}

.cb-lb-caption {
    margin-top: 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: #f1f5f9;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    pointer-events: auto;
}

/* Pulsanti Navigazione e Chiusura */
.cb-lb-btn {
    position: absolute;
    z-index: 3;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: background-color 0.2s, transform 0.2s;
}

.cb-lb-btn:hover {
    background: var(--brand-red);
    transform: scale(1.1);
}

.cb-lb-close {
    top: 20px;
    right: 25px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    background: var(--brand-red);
}

.cb-lb-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.cb-lb-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

@media (max-width: 768px) {
    .cb-lb-prev { left: 8px; width: 40px; height: 40px; }
    .cb-lb-next { right: 8px; width: 40px; height: 40px; }
    .cb-lb-close { top: 12px; right: 12px; width: 38px; height: 38px; }
}

/* ==========================================================================
   GALLERIE E FOTO MULTIPLE IN REALIZZAZIONI
   ========================================================================== */
.realization-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Griglia nativa galleria WordPress */
.realization-content .wp-block-gallery,
.realization-content .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 25px 0;
}

.realization-content .gallery-item img,
.realization-content .wp-block-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    margin: 0;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.realization-content .gallery-item img:hover,
.realization-content .wp-block-image img:hover {
    transform: scale(1.02);
}
/* ==========================================================================
   FIX PRE-PUBBLICAZIONE — CLASSI MANCANTI (Audit 30/08/2026)
   Aggiunte non distruttive: nessuna regola esistente è stata modificata.
   ========================================================================== */

/* --- Utility mancante, usata in ~10 template (page-*.php gallerie,
   front-page.php, single-realizzazione.php): senza questa regola tutti i
   titoli/intro con class="... text-center" risultano allineati a sinistra. --- */
.text-center {
    text-align: center;
}

/* --- single-realizzazione.php: l'<article> che racchiude il contenuto non
   aveva padding, quindi il testo toccava direttamente hero e footer. --- */
.single-realizzazione-section {
    padding: 60px 0;
    background: var(--white);
}

/* --- single-realizzazione.php: l'immagine in evidenza cliccabile non era
   contenuta, rischiando overflow orizzontale su schermi piccoli. --- */
.work-single-featured-media {
    margin-bottom: 30px;
    border-radius: 4px;
    overflow: hidden;
}
.work-single-featured-media img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* --- single-realizzazione.php: box del pulsante "Torna a tutte le
   realizzazioni", per spaziatura verticale coerente col resto della pagina. --- */
.back-to-gallery-box {
    margin-top: 40px;
}

/* --- page-contatti.php / page-dove-siamo.php: la card centrale
   "Assistenza Tecnica" doveva risaltare rispetto alle altre due, ma la
   classe .highlighted-card non aveva alcuna regola dedicata. --- */
.highlighted-card {
    border-color: var(--brand-red);
    border-width: 2px;
    box-shadow: 0 10px 25px -5px rgba(185, 28, 28, 0.15);
    transform: translateY(-6px);
}

/* --- footer.php: il lockup "CB NEW" + badge "50 ANNI" non aveva stile
   tipografico dedicato e appariva come testo semplice in grassetto. --- */
.footer-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.01em;
    margin-bottom: 15px;
}

/* --- footer.php: rifinitura minima delle colonne del footer (il layout a
   4 colonne era già garantito da .grid-4-footer, queste sono rifiniture). --- */
.brand-col {
    padding-right: 10px;
}
.contacts-col {
    padding-left: 10px;
}

/* --- footer.php: la riga copyright eredita già colore/dimensione dal
   genitore .footer-bottom-bar; qui solo per allineare la spaziatura
   verticale su mobile quando va a capo sopra ai link legali. --- */
.copyright-text {
    line-height: 1.5;
}

/* --- page-contatti.php / page-dove-siamo.php: contenitore della mappa
   Google, per coerenza visiva (ombra/radius) con le altre card della pagina. --- */
.google-map-embed {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --- header.php: piccola spaziatura di sicurezza per le icone testuali
   (telefono, email, social) inline accanto al testo dei link. --- */
.icon,
.icon-social,
.btn-icon {
    margin-right: 4px;
}