body.dark-mode {
    --light-bg: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e4e4e4;
    --shadow: rgba(255,255,255,0.1);
}

/* Cookie Banner - MUST BE VISIBLE */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    z-index: 99999 !important;
    border-top: 4px solid #1e3c72;
    display: block;
}

body.dark-mode .cookie-banner {
    background: #16213e;
}

.cookie-banner.hide {
    display: none !important;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text p {
    margin-bottom: 10px;
    font-size: 14px;
}

.cookie-text a {
    color: #1e3c72;
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.cookie-btn-accept {
    background: #1e3c72;
    color: white;
}

.cookie-btn-accept:hover {
    background: #2a5298;
}

.cookie-btn-decline {
    background: #e0e0e0;
    color: #333;
}

.cookie-btn-decline:hover {
    background: #d0d0d0;
}

.cookie-btn-settings {
    background: transparent;
    color: #1e3c72;
    border: 2px solid #1e3c72;
}

.cookie-btn-settings:hover {
    background: #1e3c72;
    color: white;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100000 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-settings-modal.active {
    display: flex !important;
}

.cookie-settings-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

body.dark-mode .cookie-settings-content {
    background: #16213e;
}

.cookie-settings-content h2 {
    margin-bottom: 20px;
    color: #1e3c72;
}

.cookie-option {
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.cookie-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-option h3 {
    font-size: 16px;
    color: #1e3c72;
}

.cookie-toggle {
    position: relative;
    width: 50px;
    height: 25px;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 25px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 17px;
    width: 17px;
    left: 4px;
    bottom: 4px;
    background-color: var(--card-bg);
    transition: .4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #1e3c72;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(25px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-option p {
    font-size: 14px;
    color: #666;
}

.cookie-settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cookie-settings-actions button {
    flex: 1;
}

/* Page sections - show/hide */
.page {
    display: none;
    min-height: 100vh;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
}

.page.active {
    display: block;
}

#landing.active {
    display: flex;
}

#idraulica, #edilizia, #blog {
    background: var(--light-bg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

html {
    scroll-behavior: smooth;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
    z-index: 998;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.whatsapp-float:hover {
    transform: scale(1.15);
}

.whatsapp-float i {
    font-size: 2rem;
    color: white;
}

/* Chatbot Toggle */
.chatbot-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(30, 60, 114, 0.5);
    z-index: 998;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-toggle i {
    font-size: 1.8rem;
    color: white;
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 380px;
    max-height: 600px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow);
    z-index: 997;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

.chatbot-window:hover {
    /* Keep open while hovering */
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

.chatbot-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.faq-item {
    background: var(--light-bg);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.faq-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.faq-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-answer {
    display: none;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.95rem;
}

.faq-item.active .faq-answer {
    display: block;
}

.chatbot-footer {
    padding: 1rem 1.5rem;
    background: var(--light-bg);
    text-align: center;
    font-size: 0.9rem;
}

.chatbot-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Scroll to Top */
.scroll-top {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 5px 20px var(--shadow);
    color: white;
    font-size: 1.5rem;
    border: none;
    transition: all 0.3s ease;
}

.scroll-top.visible {
    display: flex;
}

.scroll-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* Call Badge Mobile */
.call-badge {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, var(--accent-color), #ff8c61);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
    z-index: 998;
    display: none;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: bold;
}

@media (max-width: 768px) {
    .call-badge {
        display: flex;
    }
    
    .chatbot-window {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 150px;
    }
}