/**
 * e-brei.net - Intestazione CSS
 * Stili per Header, Navigation, Footer e Breadcrumb
 * Questo file NON deve essere modificato per altre pagine
 * 
 * INDICE:
 * 1. Header
 * 2. Navigation & Dropdown
 * 3. Header Scrolled (Mini-header)
 * 4. Breadcrumb
 * 5. Footer
 * 6. RESPONSIVE
 */

/* ==========================================================================
   1. Header
   ========================================================================== */

header {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
}

.header-top {
    background: white;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.header-brand-wrap {
    padding: 10px 0;
    display: flex;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo-link {
    display: flex;
    align-items: center;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
    cursor: pointer;
}

.logo {
    height: 68px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.titolo {
    height: 68px;
    width: auto;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: flex-end;
}

/* Search */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    display: none;
    background: #f5f5f5;
    border: 1px solid #ddd;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: #1e3a5f;
    transition: all 0.3s ease;
}

.search-toggle:hover {
    background: #1e3a5f;
    color: #f5f1e8;
}

.search-box {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 25px;
    color: #2c2c2c;
    width: 300px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: #999;
}

.search-box:focus {
    outline: none;
    border-color: #d4af37;
}

/* Support Button */
.support-btn {
    background: #d4af37;
    color: #1e3a5f;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.support-btn:hover {
    background: #e5c045;
    transform: translateY(-2px);
    color: #1e3a5f;
}

/* Menu Toggle Mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: #1e3a5f;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ==========================================================================
   2. Navigation & Dropdown
   ========================================================================== */

nav {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    flex-wrap: wrap;
}

.nav-menu li {
    position: relative;
}

.nav-menu li a {
    color: #f5f1e8;
    text-decoration: none;
    padding: 20px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.nav-menu li.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: #1e3a5f;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    list-style: none;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-menu li.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    padding: 12px 25px;
    font-size: 14px;
    border-bottom: none;
    display: block;
}

.dropdown-menu li a:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #d4af37;
    border-bottom: none;
}

.dropdown-toggle {
    display: none; 
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #f5f1e8;
}

/* ==========================================================================
   3. Header Scrolled State (Mini-header)
   ========================================================================== */

/* Unico cambiamento: appare il logo */
header.scrolled .logo-link {
    opacity: 1;
    width: auto;
}

/* ==========================================================================
   4. Breadcrumb
   ========================================================================== */

.breadcrumb {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    font-size: 14px;
    color: #888;
}

.breadcrumb a {
    color: #1e3a5f;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #d4af37;
}

.breadcrumb span {
    margin: 0 10px;
}

/* ==========================================================================
   5. Page Hero
   ========================================================================== */

.page-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    padding: 20px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L35 25H55L39 37L44 57L30 45L16 57L21 37L5 25H25L30 5Z' fill='%23d4af37' fill-opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.page-hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.page-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 700;
    color: #f5f1e8;
    margin-bottom: 15px;
}

.page-hero p {
    font-size: clamp(16px, 2vw, 18px);
    color: rgba(245, 241, 232, 0.9);
    line-height: 1.6;
}

.page-hero-content a {
    color: white;
}

.page-hero-content a:hover {
    color: #d4af37;
}

/* ==========================================================================
   6. Footer
   ========================================================================== */

footer {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    color: #f5f1e8;
    padding: 60px 40px 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 60px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5em;
    text-align: center;
    color: #d4af37;
    margin-bottom: 20px;
}

.footer-section h2 {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 2.2;
    color: #f5f1e8;
    padding: 20px 25px 20px 20px;
    border-left: 3px solid #d4af37;
    text-align: left;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.12) 0%, transparent 60%);
    border-radius: 0 8px 8px 0;
}

.footer-section h2 strong {
    font-weight: 300;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #f5f1e8;
    text-decoration: none;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: #d4af37;
    opacity: 1;
}

.footer-section p {
    line-height: 1.8;
    opacity: 0.9;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 25px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
    font-size: 13px;
    line-height: 1.9;
    color: rgba(245, 241, 232, 0.75);
}

.footer-bottom a {
    color: #d4af37;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-bottom a:hover {
    color: #f5f1e8;
}

.footer-bottom img {
    vertical-align: middle;
    margin-left: 5px;
    opacity: 0.85;
}

/* ==========================================================================
   6.1 Pulsante "Torna su"
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #1e3a5f;
    color: #f5f1e8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #d4af37;
    color: #1e3a5f;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

/* --------------------------------------------------------------------------
   6.1 Desktop/Tablet (≤992px)
   -------------------------------------------------------------------------- */

@media (max-width: 992px) {
    /* Header */
    .header-top {
        padding: 0 20px;
    }
    
    header.scrolled .header-top {
        padding: 0 20px;
    }
    
    .header-brand {
        gap: 4rem;
    }
    
    .logo {
        height: 70px;
        width: auto;
    }
    
    .titolo {
        height: 70px;
        width: auto;
    }
    
    .search-box {
        width: 200px;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 25px;
    }
    
    .nav-menu {
        gap: 15px;
    }
    
    .nav-menu li a {
        font-size: 14px;
        padding: 15px 0;
    }
    
    .dropdown-menu {
        min-width: 220px;
        max-width: 280px;
        max-height: 350px;
        overflow-y: auto;
    }
    
    .dropdown-menu li a {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* Footer */
    footer {
        padding: 50px 25px 30px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        padding: 15px 25px;
    }
    
    /* Menu hamburger - appare a 992px */
    .menu-toggle {
        display: flex;
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100;
    }
    
    /* Header actions - lascia spazio per hamburger */
    .header-actions {
        margin-right: 50px;
    }
    
    /* Search mobile - nasconde barra, mostra icona */
    .search-box {
        width: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
        position: absolute;
    }
    
    .search-box.expanded {
        width: 180px;
        padding: 8px 16px;
        opacity: 1;
        pointer-events: auto;
        position: absolute;
        right: 55px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    .search-toggle {
        display: flex;
    }
    
    /* Supporta nascosto su tablet/mobile */
    .support-btn {
        display: none;
    }
    
    /* Navigation mobile */
    nav {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    
    nav.active {
        max-height: 2000px;
    }
    
    .nav-container {
        padding: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu li a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: block;
    }
    
    .nav-menu li a:hover,
    .nav-menu li a.active {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Layout per item con dropdown su mobile */
    .nav-menu li.has-dropdown {
        display: flex;
        flex-wrap: wrap;
    }
    
    .nav-menu li.has-dropdown > a {
        flex: 1;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Dropdown toggle button per mobile */
    .dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        background: rgba(255,255,255,0.1);
        border: none;
        border-left: 1px solid rgba(255,255,255,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        cursor: pointer;
        transition: background 0.2s ease;
    }
    
    .dropdown-toggle:hover {
        background: rgba(255,255,255,0.2);
    }
    
    .dropdown-toggle .dropdown-arrow {
        stroke: #f5f1e8;
        transition: transform 0.3s ease;
    }
    
    .nav-menu li.has-dropdown.open .dropdown-toggle .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    /* Dropdown menu mobile */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0,0,0,0.2);
        box-shadow: none;
        border-radius: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        display: block;
        padding: 0;
    }
    
    .nav-menu li.has-dropdown.open .dropdown-menu {
        max-height: 1000px;
    }
    
    .dropdown-menu li {
        width: 100%;
    }
    
    .dropdown-menu li a {
        padding: 12px 20px 12px 35px;
        font-size: 14px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .dropdown-menu li:last-child a {
        border-bottom: none;
    }
}

/* --------------------------------------------------------------------------
   6.2 Tablet (≤768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    /* Header */
    .header-top {
        padding: 0 20px;
    }
    
    .header-brand {
        gap: 2rem;
    }
    
    .logo {
        height: 50px;
        width: auto;
    }
    
    .titolo {
        height: 50px;
        width: auto;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        padding: 15px 20px;
    }
    
    /* Search */
    .search-box {
        width: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
        position: absolute;
    }
    
    .search-box.expanded {
        width: 180px;
        padding: 8px 16px;
        opacity: 1;
        pointer-events: auto;
        position: absolute;
        right: 55px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    }
    
    .search-toggle {
        display: flex;
    }
}

/* --------------------------------------------------------------------------
   6.3 Mobile (≤576px)
   -------------------------------------------------------------------------- */

@media (max-width: 576px) {
    /* Header */
    .header-top {
        padding: 0 10px;
    }
    
    .header-brand {
        gap: 1.5rem;
    }
    
    .logo {
        height: 40px;
        width: auto;
    }
    
    .titolo {
        height: 40px;
        width: auto;
    }
    
    .search-toggle {
        width: 36px;
        height: 36px;
    }
    
    .search-box.expanded {
        width: 140px;
        right: 50px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .menu-toggle {
        right: 8px;
    }
    
    .menu-toggle span {
        width: 24px;
        height: 2px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        padding: 15px 15px;
    }
    
    /* Footer */
    footer {
        padding: 40px 15px 25px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section h3 {
        font-size: 20px;
    }
    
    .footer-bottom {
        font-size: 11px;
        padding-top: 20px;
    }
    
    /* Back to top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* --------------------------------------------------------------------------
   6.4 Very Small (≤380px)
   -------------------------------------------------------------------------- */

@media (max-width: 380px) {
    /* Header */
    .header-top {
        padding: 0 6px;
    }
    
    .header-brand {
        gap: 1rem;
    }
    
    .logo {
        height: 32px;
        width: auto;
    }
    
    .titolo {
        height: 32px;
        width: auto;
    }
    
    .search-toggle {
        width: 28px;
        height: 28px;
    }
    
    .search-box.expanded {
        width: 90px;
        right: 42px;
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .menu-toggle {
        right: 6px;
    }
    
    .menu-toggle span {
        width: 22px;
        height: 2px;
    }
    
    .nav-menu li a {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        padding: 12px 10px;
    }
}
