/**
 * Cookie Consent Module Styles
 * OpenCart 3.0.4
 */

/* Base Styles */
.cookie-consent-hidden {
    display: none !important;
}

.cookie-consent-banner {
    position: fixed;
    z-index: 9999;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-header {
    flex-shrink: 0;
}

.cookie-consent-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.cookie-consent-body {
    flex: 1;
    min-width: 200px;
}

.cookie-consent-message {
    margin: 0;
    opacity: 0.9;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Buttons */
.cookie-consent-btn {
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    white-space: nowrap;
}

.cookie-consent-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cookie-consent-btn:active {
    transform: translateY(0);
}

.cookie-consent-btn-primary {
    background-color: #e91e63;
    color: #ffffff;
    border-color: #e91e63;
}

.cookie-consent-btn-primary:hover {
    background-color: #c2185b;
    border-color: #c2185b;
}

.cookie-consent-btn-secondary {
    background-color: transparent;
    color: #e91e63;
    border-color: #e91e63;
}

.cookie-consent-btn-secondary:hover {
    background-color: #e91e63;
    color: #ffffff;
}

.cookie-consent-btn-full {
    width: 100%;
}

/* Themes */
.cookie-consent-theme-light {
    background-color: #ffffff;
    color: #333333;
}

.cookie-consent-theme-dark {
    background-color: #2c2c2c;
    color: #ffffff;
}

.cookie-consent-theme-dark .cookie-consent-message {
    opacity: 0.8;
}

/* Positioning */
.cookie-consent-position-top,
.cookie-consent-position-bottom {
    left: 0;
    right: 0;
}

.cookie-consent-position-top {
    top: 0;
}

.cookie-consent-position-bottom {
    bottom: 0;
}

.cookie-consent-position-popup {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: 90%;
    border-radius: 12px;
}

.cookie-consent-position-top-left,
.cookie-consent-position-top-right,
.cookie-consent-position-bottom-left,
.cookie-consent-position-bottom-right {
    max-width: 400px;
    width: 90%;
    border-radius: 12px;
}

.cookie-consent-position-top-left {
    top: 20px;
    left: 20px;
}

.cookie-consent-position-top-right {
    top: 20px;
    right: 20px;
}

.cookie-consent-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.cookie-consent-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* Animations */
.cookie-consent-animate-slide {
    animation: cookieConsentSlide 0.5s ease-out;
}

.cookie-consent-animate-fade {
    animation: cookieConsentFade 0.5s ease-out;
}

.cookie-consent-animate-bounce {
    animation: cookieConsentBounce 0.6s ease-out;
}

@keyframes cookieConsentSlide {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes cookieConsentFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cookieConsentBounce {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal */
.cookie-consent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-consent-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cookie-consent-modal-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cookieConsentModalShow 0.3s ease-out;
}

@keyframes cookieConsentModalShow {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cookie-consent-modal-header {
    padding: 20px 20px 0;
    /* border-bottom: 1px solid #f0f0f0; */
}

/* Accordion expand icon - исправленная версия */
.cookie-consent-expand-icon {
    margin-right: 12px;
    transition: transform 0.3s ease;
    color: #666;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.cookie-consent-expand-icon svg {
    display: block;
    transition: transform 0.3s ease;
}

.cookie-consent-category-header.expanded .cookie-consent-expand-icon svg {
    transform: rotate(180deg);
}

/* Убираем поворот с родительского элемента */
.cookie-consent-category-header.expanded .cookie-consent-expand-icon {
    /* transform: rotate(180deg); - убираем эту строку */
}

.cookie-consent-category-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cookie-consent-category-info {
    flex: 1;
}

.cookie-consent-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    width: 100%;
    text-align: left;
}

.cookie-consent-back-btn:hover {
    color: #333;
}

.cookie-consent-back-text {
    flex: 1;
}

.cookie-consent-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.cookie-consent-settings-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.cookie-consent-settings-description {
    margin: 0 0 24px;
    color: #666;
    line-height: 1.5;
}

.cookie-consent-modal-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

/* Categories */
.cookie-consent-category {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.cookie-consent-category:last-child {
    margin-bottom: 0;
}

.cookie-consent-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cookie-consent-category-header:hover {
    background-color: #f0f1f2;
}

.cookie-consent-category-header.expanded {
    border-bottom: 1px solid #e0e0e0;
}

.cookie-consent-category-info {
    flex: 1;
}

.cookie-consent-category-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.cookie-consent-category-status {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cookie-consent-category-status.enabled {
    color: #4caf50;
}

.cookie-consent-category-status.disabled {
    color: #f44336;
}

.cookie-consent-category-description {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    color: #666;
    line-height: 1.5;
    transition: all 0.3s ease;
    max-height: 200px;
    overflow: hidden;
}

.cookie-consent-category-description.cookie-consent-collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

.cookie-consent-category-description p {
    margin: 0;
}

/* Toggle Switch */
.cookie-consent-toggle {
    position: relative;
    margin-left: 16px;
}

/* Скрыть стандартный чекбокс */
.cookie-consent-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
}

/* Скрыть wrapper если он остался */
.cookie-consent-toggle .checkbox-wrapper {
    display: none !important;
}

.cookie-consent-toggle-label {
    display: block;
    width: 48px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.cookie-consent-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-consent-toggle input[type="checkbox"]:checked + .cookie-consent-toggle-label {
    background-color: #e91e63;
}

.cookie-consent-toggle input[type="checkbox"]:checked + .cookie-consent-toggle-label .cookie-consent-toggle-slider {
    transform: translateX(24px);
}

.cookie-consent-toggle input[type="checkbox"]:disabled + .cookie-consent-toggle-label {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-consent-toggle input[type="checkbox"]:disabled:checked + .cookie-consent-toggle-label {
    background-color: #4caf50;
}

/* Body class when modal is open */
.cookie-consent-modal-open {
    overflow: hidden;
}

/* Always active status */
.cookie-consent-always-on {
    display: flex;
    align-items: center;
    margin-left: 16px;
}

.cookie-consent-status-text {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4caf50;
    padding: 4px 8px;
    background-color: #e8f5e8;
    border-radius: 4px;
}

.cookie-consent-category-status.always-active {
    color: #4caf50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .cookie-consent-actions {
        justify-content: center;
        margin-top: 16px;
    }
    
    .cookie-consent-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .cookie-consent-position-top-left,
    .cookie-consent-position-top-right,
    .cookie-consent-position-bottom-left,
    .cookie-consent-position-bottom-right {
        max-width: none;
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
    
    .cookie-consent-position-top-right {
        left: 20px;
    }
    
    .cookie-consent-position-bottom-right {
        left: 20px;
    }
    
    .cookie-consent-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .cookie-consent-category-header {
        padding: 12px 16px;
    }
    
    .cookie-consent-category-description {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: 16px;
    }
    
    .cookie-consent-content {
        gap: 16px;
    }
    
    .cookie-consent-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .cookie-consent-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .cookie-consent-modal {
        padding: 10px;
    }
    
    .cookie-consent-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .cookie-consent-modal-header,
    .cookie-consent-modal-body,
    .cookie-consent-modal-footer {
        padding: 16px;
    }
}

/* Focus styles for accessibility */
.cookie-consent-btn:focus,
.cookie-consent-toggle-label:focus {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
}

.cookie-consent-toggle input[type="checkbox"]:focus + .cookie-consent-toggle-label {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border: 2px solid;
    }
    
    .cookie-consent-category {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-consent-modal-content,
    .cookie-consent-category-description,
    .cookie-consent-toggle-label,
    .cookie-consent-toggle-slider,
    .cookie-consent-btn {
        transition: none;
        animation: none;
    }
}

/* Print styles */
@media print {
    .cookie-consent-banner,
    .cookie-consent-modal {
        display: none !important;
    }
}

/* Стили для кастомных классов */
.cookie-consent-toggle-label.checked {
    background-color: #e91e63 !important;
}

.cookie-consent-toggle-label.checked .cookie-consent-toggle-slider {
    transform: translateX(24px) !important;
}

/* Альтернативно - через класс active на wrapper */
.checkbox-wrapper.active + .cookie-consent-toggle-label {
    background-color: #e91e63 !important;
}

.checkbox-wrapper.active + .cookie-consent-toggle-label .cookie-consent-toggle-slider {
    transform: translateX(24px) !important;
}

/* Убеждаемся что базовые стили тоже работают */
.cookie-consent-toggle-label {
    display: block !important;
    width: 48px !important;
    height: 24px !important;
    background-color: #ccc !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    position: relative !important;
}

.cookie-consent-toggle-slider {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: white !important;
    border-radius: 50% !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}
