/* ================================================================
   style.css — Stili comuni a tutte le pagine
   Studio Rosas
================================================================ */

:root {
    --primary: #b90b10;
    --primary-dark: #900a0e;
    --secondary: #272a33;
    --accent: #ff0008;
    --light: #f9f9f9;
    --dark: #272a33;
    --text-gray: #555;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --radius: 5px;
    --font-main: 'Poppins', sans-serif;
    --trust-green: #28a745;
    --trust-green-hover: #218838;
    --total-blue: #25445F;
    --row-bg-odd: #ffffff;
    --row-bg-even: #f2f6fa;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-gray);
    line-height: 1.6;
    background-color: var(--light);
    scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1300px;
    /* Wider container for horizontal form */
    margin: 0 auto;
    padding: 0 20px;
}

.section-separator {
    width: 100%;
    max-width: 400px;
    /* Reduced from 820px */
    margin: 4rem auto;
    opacity: 0.8;
}

/* Header */
header {
    background: var(--secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.2rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
}

nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--white);
}

/* ── Dropdown Servizi ── */
nav li.has-dropdown {
    position: relative;
}

nav li.has-dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

nav li.has-dropdown > a .dropdown-arrow {
    font-size: 0.6rem;
    transition: transform 0.25s ease;
    display: inline-block;
}

nav li.has-dropdown:hover > a .dropdown-arrow,
nav li.has-dropdown.open > a .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    /* Sovrascrive display:flex e gap ereditati da nav ul */
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    /* --- */
    background: var(--secondary);
    min-width: 200px;
    border-top: 2px solid var(--primary);
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    border-radius: 0 0 var(--radius) var(--radius);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1100;
    padding-top: 6px;
    padding-bottom: 6px;
}

/* Ponte invisibile tra link e menu: copre il gap che causerebbe perdita di hover */
nav li.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

nav li.has-dropdown:hover .dropdown-menu,
nav li.has-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 0.7rem 1.2rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.72);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-menu a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.06);
}

.dropdown-menu a.dropdown-active {
    color: var(--primary);
}

/* Separatore visivo nel menu (usato in scuole) */
.nav-separator {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    align-self: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .nav-separator {
        display: none;
    }
}

/* CTA nel nav */
.nav-cta {
    background: var(--primary);
    color: var(--white) !important;
    padding: 0.45rem 1.1rem !important;
    border-radius: var(--radius);
    font-weight: 600 !important;
    transition: background 0.3s !important;
}

.nav-cta:hover {
    background: var(--primary-dark) !important;
    color: var(--white) !important;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--white);
    padding: 0.4rem 0.6rem;
    z-index: 1100;
}

/* ── Mobile nav ── */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary);
        z-index: 1050;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease;
    }

    nav.open {
        max-height: 500px;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
        align-items: stretch;
    }

    nav ul li a {
        display: block;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    nav ul li:last-child a {
        border-bottom: none;
    }

    /* Dropdown su mobile: sempre espanso come lista piana */
    .dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
        background: rgba(0,0,0,0.2);
        min-width: 0;
    }

    .dropdown-menu a {
        padding: 0.6rem 2.5rem;
        font-size: 0.85rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    nav li.has-dropdown > a .dropdown-arrow {
        display: none;
    }

    .nav-cta {
        margin: 0.5rem 1.5rem;
        text-align: center;
        border-radius: var(--radius);
    }
}

/* ── FOOTER COMUNE ── */
footer {
    background-color: var(--secondary);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
    text-align: left;
}

.footer-logo {
    height: 38px;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-wordmark {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    line-height: 1;
}

.footer-about {
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.55);
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.footer-col p,
.footer-col ul li {
    font-size: 0.88rem;
    line-height: 2;
    color: rgba(255,255,255,0.6);
}

.footer-col p i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.footer-col p .fa-whatsapp,
.footer-col p .fa-telegram {
    color: var(--primary);
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.2rem 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
}

.footer-bottom a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
}

/* Scroll indicator for sections - MIGLIORATO */
section {
    scroll-margin-top: 70px;
}

/* Smooth scroll animation class */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 4px 15px rgba(185, 11, 16, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(185, 11, 16, 0.4);
}

/* Footer */
footer {
    background-color: var(--secondary);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    text-align: left;
}

.footer-grid h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
}

.footer-grid a:hover {
    color: var(--primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-option {
    border: 2px solid #eee;
    padding: 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.payment-option.selected {
    border-color: var(--primary);
    background-color: #fff5f5;
    color: var(--primary);
    font-weight: 600;
}

.cc-form {
    display: none;
    margin-top: 1rem;
}

.cc-form.visible {
    display: block;
}
