/* 
* RinnovaCasa Italia - Cookie Consent Styles
* Author: RinnovaCasa Italia
* Version: 1.0
*/

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 1.5rem 0;
    transform: translateY(100%);
    transition: transform 0.4s ease-in-out;
}

.cookie-consent.visible {
    transform: translateY(0);
}

.cookie-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-text h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.cookie-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Cookie Settings Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-modal.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.cookie-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #555555;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333333;
}

.cookie-modal-body {
    padding: 1.5rem;
    flex-grow: 1;
    overflow-y: auto;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 0;
    border-bottom: 1px solid #eeeeee;
}

.cookie-option:last-child {
    border-bottom: none;
}

.cookie-option-text {
    flex: 1;
    padding-right: 1.5rem;
}

.cookie-option-text h4 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.cookie-option-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666666;
}

.cookie-switch {
    flex-shrink: 0;
}

/* Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cccccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: var(--primary-color, #3a7e6b);
}

input:disabled + .slider {
    opacity: 0.7;
    cursor: not-allowed;
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color, #3a7e6b);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #eeeeee;
    text-align: right;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cookie-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .cookie-buttons {
        justify-content: center;
    }
    
    .cookie-option {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-option-text {
        padding-right: 0;
    }
    
    .cookie-switch {
        align-self: flex-start;
    }
}
