/* ==========================================================================
   Portogruaro - Stile Personalizzato
   Senior Frontend & Tech Lead Custom Stylesheet
   ========================================================================== */

/* Font Local Face - Fallback e caricamento locale per le migliori performance */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: local('Inter'), local('Inter-Regular'), system-ui;
}

:root {
    /* Tavolozza Colori Ispirata al Territorio */
    --color-primary: #0f294a;       /* Blu profondo del fiume Lemene */
    --color-primary-dark: #071527;  /* Blu notte profondo */
    --color-secondary: #1d4ed8;     /* Blu reale */
    --color-accent: #c5a880;        /* Oro veneziano (storico) */
    --color-accent-dark: #a98859;   /* Oro veneziano scuro */
    --color-bg-light: #f8fafc;      /* Grigio ardesia chiarissimo */
    --color-text-dark: #1e293b;     /* Testo scuro */
    --color-text-muted: #64748b;    /* Testo attenuato */
    
    /* Transizioni */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Setup */
html {
    scroll-behavior: smooth;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    overflow-x: hidden;
}

/* Evitare auto-zoom nei campi di input su Safari iOS */
input, select, textarea {
    font-size: 16px !important;
}

/* Target touch minimo per Apple e dispositivi touch (> 44px) */
a, button, select, input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Header & Navigazione Glassmorphic */
header.scrolled {
    background-color: rgba(15, 41, 74, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hero Section con Overlay Gradiente */
.hero-overlay {
    background: linear-gradient(
        to bottom,
        rgba(7, 21, 39, 0.85) 0%,
        rgba(15, 41, 74, 0.75) 50%,
        rgba(7, 21, 39, 0.9) 100%
    );
}

/* Card ed Effetti Hover */
.premium-card {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    transition: var(--transition-normal);
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(15, 41, 74, 0.08);
    border-color: var(--color-accent);
}

/* Bottoni Premium */
.btn-gold {
    background-color: var(--color-accent);
    color: var(--color-primary-dark);
    font-weight: 600;
    border-radius: 9999px;
    transition: var(--transition-normal);
    border: 2px solid var(--color-accent);
    box-shadow: 0 4px 12px rgba(197, 168, 128, 0.2);
}

.btn-gold:hover {
    background-color: transparent;
    color: var(--color-accent);
    box-shadow: 0 6px 16px rgba(197, 168, 128, 0.4);
    transform: translateY(-2px);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-outline-gold {
    background-color: transparent;
    color: var(--color-accent);
    font-weight: 600;
    border-radius: 9999px;
    border: 2px solid var(--color-accent);
    transition: var(--transition-normal);
}

.btn-outline-gold:hover {
    background-color: var(--color-accent);
    color: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* Pulsante WhatsApp mobile-only */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #25d366;
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    z-index: 999;
    font-size: 24px;
    transition: var(--transition-normal);
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

/* Media query per nascondere WhatsApp su Desktop (> 767px) */
@media (min-width: 768px) {
    .whatsapp-float {
        display: none !important;
    }
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Email Copy Alert Tooltip */
.copy-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--color-primary-dark);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--color-primary-dark) transparent transparent transparent;
}

.copy-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Cookie Consent Banner */
#cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition-normal);
    transform: translateY(150%);
}

#cookie-banner.show {
    transform: translateY(0);
}

@media (min-width: 768px) {
    #cookie-banner {
        max-width: 520px;
        left: auto;
        right: 24px;
    }
}

/* Gestisci Cookie Pulsante Fisso */
.cookie-manage-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background-color: var(--color-primary);
    color: var(--color-accent);
    border: 1px solid rgba(197, 168, 128, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 998;
    transition: var(--transition-normal);
    cursor: pointer;
}

.cookie-manage-btn:hover {
    transform: rotate(45deg) scale(1.1);
    background-color: var(--color-accent);
    color: var(--color-primary);
}

/* Finestra Modale per la Privacy */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 21, 39, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transform: scale(0.9) translateY(20px);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    background-color: var(--color-primary);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--color-accent);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
}

.modal-body h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-close-btn {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 50%;
}

.modal-close-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dettagli dell'anteprima delle categorie commerciali (Vetrina) */
.category-preview-grid {
    display: grid;
    grid-template-cols: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: var(--transition-normal);
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(15, 41, 74, 0.05);
}

.category-card .icon-container {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(15, 41, 74, 0.03);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    font-size: 24px;
    transition: var(--transition-normal);
}

.category-card:hover .icon-container {
    background-color: var(--color-primary);
    color: var(--color-accent);
}

/* Stili specifici per i dettagli dei filtri preferenze cookie */
.cookie-options {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 16px;
    padding-top: 16px;
}

.cookie-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--color-accent);
}

input:disabled + .slider {
    background-color: #334155;
    cursor: not-allowed;
    opacity: 0.6;
}

input:checked + .slider:before {
    transform: translateX(20px);
}
