/* ==========================================================================
   TCM SUCCHI - Stile Principale Moderno, Dinamico & Professionale
   Tipografia Editorial: Playfair Display + Plus Jakarta Sans
   ========================================================================== */

:root {
    --color-primary: #183b24;
    --color-primary-light: #244d31;
    --color-primary-dark: #0e2416;
    --color-accent: #e2711d;
    --color-accent-hover: #cb5704;
    --color-accent-light: #fef4ec;
    --color-accent-glow: rgba(226, 113, 29, 0.25);
    --color-bg: #fcfbf7;
    --color-surface: #ffffff;
    --color-surface-soft: #f4f2e6;
    --color-text: #1d2d20;
    --color-text-muted: #5e6f60;
    --color-border: #dfe4d9;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* MARGINI LATERALI PREDEFINITI ALLINEATI ALL'HEADER */
    --site-gutter: 5%;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    font-size: 16px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

/* Tipografia */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-primary-dark);
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
}

/* Header & Sticky Nav (Margini Laterali di Riferimento) */
.site-header {
    height: 88px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--site-gutter);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.site-header.scrolled {
    height: 74px;
    box-shadow: 0 4px 22px rgba(14, 36, 22, 0.08);
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.site-header.scrolled .logo {
    height: 50px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

/* Selector de Idioma */
.language-switch {
    display: flex;
    align-items: center;
    background: var(--color-surface-soft);
    padding: 4px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    gap: 2px;
}

.language-switch a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-muted);
}

.language-switch a.active {
    background: var(--color-primary-light);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(24, 59, 36, 0.2);
}

/* Navegacion */
.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav a {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text);
    padding: 8px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.main-nav a.active {
    color: var(--color-accent);
}

.nav-contact-btn {
    background: var(--color-primary-light) !important;
    color: #ffffff !important;
    padding: 10px 18px !important;
    border-radius: var(--radius-sm);
    font-size: 12.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(24, 59, 36, 0.15);
}

.nav-contact-btn:hover {
    background: var(--color-accent) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(226, 113, 29, 0.3);
}

.nav-contact-btn::after {
    display: none !important;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--color-primary-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Band / Cinta de productos */
.band {
    display: flex;
    justify-content: space-between;
    padding: 22px var(--site-gutter);
    background: var(--color-primary);
    color: #f7f3e4;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Secciones Generales (Allineate ai margini dell'header) */
.section {
    padding: 85px var(--site-gutter);
    width: 100%;
}

.intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.intro h2 {
    font-size: clamp(34px, 3.8vw, 48px);
    letter-spacing: -0.5px;
}

.intro p, .feature p {
    font-size: 16.5px;
    line-height: 1.85;
    color: var(--color-text-muted);
}

/* Feature Split */
.feature {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--color-surface-soft);
    align-items: center;
    position: relative;
    overflow: hidden;
}

.feature figure {
    margin: 0;
    position: relative;
    overflow: hidden;
}

.feature .photo-button img {
    width: 100%;
    height: 520px;
    object-fit: cover;
}

.feature-copy {
    padding: 70px 8%;
}

.feature-copy h2 {
    font-size: clamp(30px, 3.2vw, 42px);
    margin: 12px 0 20px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-accent);
    padding-bottom: 4px;
    margin-top: 24px;
}

.text-link:hover {
    color: var(--color-accent);
    gap: 12px;
}

/* ==========================================================================
   EFFETTI DINAMICI SULLE SCHEDE (VISIBILI OVUNQUE, NON SOLO HOVER)
   ========================================================================== */

.gallery-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    gap: 30px;
}

.gallery-head h2 {
    font-size: clamp(32px, 3.5vw, 44px);
    max-width: 600px;
}

.gallery-head p {
    color: var(--color-text-muted);
    font-size: 14px;
    max-width: 260px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Scheda con respirazione dinamica ed effetto luce continuo */
.card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 18px rgba(24, 59, 36, 0.05);
    animation: cardBreathe 8s ease-in-out infinite alternate;
    transition: var(--transition);
}

@keyframes cardBreathe {
    0% {
        box-shadow: 0 4px 18px rgba(24, 59, 36, 0.04);
        border-color: #dfe4d9;
    }
    50% {
        box-shadow: 0 8px 25px rgba(226, 113, 29, 0.08);
        border-color: #d2dbcc;
    }
    100% {
        box-shadow: 0 4px 18px rgba(24, 59, 36, 0.04);
        border-color: #dfe4d9;
    }
}

/* Linea luminosa superiore dinamica (visibile sempre, senza bisogno di hover) */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #183b24, #e2711d, #183b24);
    background-size: 200% 100%;
    animation: gradientFlow 5s linear infinite;
    z-index: 4;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(14, 36, 22, 0.12);
}

.photo-button {
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    display: block;
}

/* Effetto shimmer luce periodico sulle fotografie */
.photo-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    animation: photoShimmer 7s infinite;
    pointer-events: none;
}

@keyframes photoShimmer {
    0% { left: -60%; }
    20% { left: 140%; }
    100% { left: 140%; }
}

.photo-button img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.photo-button:hover img {
    transform: scale(1.06);
}

.zoom-label {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(14, 36, 22, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card .number {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.card h3 {
    font-size: 23px;
    margin-bottom: 12px;
}

.card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--color-text-muted);
    margin-bottom: 18px;
    flex: 1;
}

/* Process Section */
.process-section {
    background: var(--color-surface-soft);
}

.process {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    margin-top: 35px;
}

.step {
    border-top: 3px solid var(--color-accent);
    padding-top: 22px;
    position: relative;
    background: #ffffff;
    padding: 22px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 3px 12px rgba(0,0,0,0.03);
    animation: cardBreathe 9s ease-in-out infinite alternate;
}

.step span {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-accent);
}

.step h3 {
    font-size: 18px;
    margin: 8px 0 10px;
}

.step p {
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--color-text-muted);
}

/* Call to action */
.cta {
    background: var(--color-accent);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px var(--site-gutter);
    gap: 40px;
    position: relative;
    overflow: hidden;
}

.cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 60%, rgba(255,255,255,0.12) 100%);
    pointer-events: none;
}

.cta h2 {
    color: #ffffff;
    font-size: clamp(28px, 3.2vw, 40px);
}

.cta-btn {
    border: 2px solid #ffffff;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    transition: var(--transition);
    white-space: nowrap;
}

.cta-btn:hover {
    background: #ffffff;
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* Contact Section & Form (Allineato ai margini) */
.contact-section {
    background: #f4f2e6;
    padding: 80px 0;
    scroll-margin-top: 90px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 65px;
}

.contact-intro h2 {
    font-size: clamp(32px, 3.6vw, 44px);
    margin: 10px 0 18px;
}

.contact-details {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.contact-details address {
    font-style: normal;
    font-size: 14px;
    line-height: 1.8;
    color: var(--color-text-muted);
    margin-bottom: 18px;
}

.contact-direct a {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.contact-direct a:hover {
    color: var(--color-accent);
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-wide {
    grid-column: 1 / -1;
}

.contact-form label {
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-primary-dark);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(226, 113, 29, 0.12);
}

.contact-form textarea {
    resize: vertical;
    min-height: 110px;
}

.required-note {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 18px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
}

.btn-submit {
    background: var(--color-accent);
    color: #ffffff;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.5px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(226, 113, 29, 0.3);
}

.privacy-note {
    font-size: 12px;
    color: var(--color-text-muted);
}

.privacy-note a {
    text-decoration: underline;
    color: var(--color-primary);
}

.form-feedback {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 15px;
}

.form-feedback.success {
    background: #e3f4e8;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer Allineato */
.site-footer {
    background: var(--color-primary-dark);
    color: #e5ede3;
    padding: 65px var(--site-gutter) 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 60px;
    width: 100%;
}

.footer-logo {
    margin-bottom: 20px;
}

.brand-col p {
    font-size: 13.5px;
    line-height: 1.85;
    color: #abbdab;
    max-width: 380px;
}

.group-link {
    display: inline-block;
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 700;
    margin-top: 15px;
}

.footer-col h4 {
    color: #ffd485;
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 22px;
}

.footer-links a, .footer-direct-contacts a {
    display: block;
    color: #cfdcd0;
    font-size: 13.5px;
    margin-bottom: 11px;
}

.footer-links a:hover, .footer-direct-contacts a:hover {
    color: #ffffff;
    padding-left: 4px;
}

.contact-col address {
    font-style: normal;
    font-size: 13.5px;
    line-height: 1.8;
    color: #cfdcd0;
    margin-bottom: 16px;
}

.legal-links {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 18px;
}

.legal-links a {
    font-size: 12.5px;
    color: #9cb09e;
}

.legal-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    width: 100%;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8c9e8e;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-access-link {
    color: #a4bba6;
    font-size: 11.5px;
}

.admin-access-link:hover {
    color: var(--color-accent);
}

/* Lightbox Modal */
dialog {
    border: none;
    background: rgba(14, 36, 22, 0.95);
    color: #ffffff;
    padding: 20px;
    max-width: min(92vw, 1100px);
    max-height: 92vh;
    border-radius: var(--radius-md);
    margin: auto;
}

dialog::backdrop {
    background: rgba(6, 18, 11, 0.85);
    backdrop-filter: blur(8px);
}

.dialog-close {
    display: block;
    margin-left: auto;
    color: #ffffff;
    font-size: 28px;
    padding: 0 8px;
    cursor: pointer;
    line-height: 1;
}

.dialog-content img {
    max-height: 72vh;
    width: auto;
    max-width: 100%;
    margin: 10px auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.dialog-content p {
    text-align: center;
    font-size: 13.5px;
    color: #cfdcd0;
    margin-top: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN COMPACTO (2x2 IN MOBILITA)
   ========================================================================== */

@media (max-width: 1024px) {
    .main-nav { gap: 16px; }
    .main-nav a { font-size: 12.5px; }
    .intro { gap: 40px; }
    .gallery { gap: 20px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 820px) {
    .menu-toggle { display: flex; }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 88px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: 24px var(--site-gutter);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid var(--color-border);
        gap: 14px;
    }

    .site-header.scrolled .main-nav {
        top: 74px;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        font-size: 15px;
        padding: 10px 0;
        border-bottom: 1px solid #f0f2ed;
    }

    .nav-contact-btn {
        text-align: center;
        margin-top: 8px;
    }

    .feature {
        grid-template-columns: 1fr;
    }

    .feature .photo-button img {
        height: 380px;
    }

    .feature-copy {
        padding: 40px var(--site-gutter);
    }

    .intro {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* REQUISITO CLAVE: Rejilla compacta 2x2 en movil para tarjetas, procesos y galerias */
@media (max-width: 768px) {
    :root {
        --site-gutter: 4%;
    }

    .section {
        padding: 50px var(--site-gutter);
    }

    .band {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px var(--site-gutter);
        text-align: center;
        font-size: 10px;
    }

    /* Galeria en formato compacto 2x2 */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card {
        border-radius: var(--radius-sm);
    }

    .photo-button img {
        height: 150px;
    }

    .card-body {
        padding: 12px 10px;
    }

    .card .number {
        font-size: 9.5px;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }

    .card h3 {
        font-size: 16px;
        margin-bottom: 6px;
        line-height: 1.25;
    }

    .card p {
        font-size: 11.5px;
        line-height: 1.5;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .card .text-link {
        font-size: 11px;
        margin-top: 4px;
        padding-bottom: 2px;
    }

    /* Proceso en formato compacto 2x2 */
    .process {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .step {
        padding-top: 14px;
    }

    .step h3 {
        font-size: 14.5px;
        margin: 4px 0 6px;
    }

    .step p {
        font-size: 11.5px;
        line-height: 1.6;
    }

    .gallery-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 24px;
    }

    .cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 35px var(--site-gutter);
        gap: 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
}

@media (max-width: 480px) {
    .contact-form {
        grid-template-columns: 1fr;
    }
    
    .photo-button img {
        height: 130px;
    }

    .gallery {
        gap: 8px;
    }
}
