/* ==========================================================================
   FENIKS CAR DETAILING - ADVANCED COOKIE CONSENT & RODO PREFERENCES UI
   Fully compliant with EU GDPR / RODO, ePrivacy & Google Consent Mode v2
   ========================================================================== */

/* Main Fixed Cookie Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(15, 20, 31, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(35, 146, 255, 0.28);
    box-shadow: 0 -8px 35px rgba(0, 0, 0, 0.65);
    z-index: 99999;
    transform: translateY(115%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 16px 20px;
}

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

.cookie-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-text-col {
    flex: 1 1 540px;
    min-width: 280px;
}

.cookie-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.cookie-icon-badge {
    font-size: 1.25rem;
    line-height: 1;
}

.cookie-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.cookie-text-col p {
    margin: 0;
    font-size: 0.86rem;
    color: #94a3b8;
    line-height: 1.55;
}

.cookie-text-col a {
    color: #2392ff;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-text-col a:hover {
    color: #60a5fa;
}

.cookie-actions-col {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Button variants */
.btn-cookie {
    background: linear-gradient(135deg, #0073e4 0%, #1873cc 100%);
    color: #ffffff !important;
    padding: 11px 22px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    box-shadow: 0 4px 15px rgba(35, 146, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cookie:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 146, 255, 0.5);
    background: linear-gradient(135deg, #1e87f0 0%, #1c7ad4 100%);
}

.btn-cookie-secondary {
    background: transparent;
    color: #cbd5e1 !important;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cookie-secondary:hover {
    border-color: #cbd5e1;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.btn-cookie-customize {
    background: rgba(35, 146, 255, 0.1);
    color: #2392ff !important;
    border: 1px solid rgba(35, 146, 255, 0.32);
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.btn-cookie-customize:hover {
    background: rgba(35, 146, 255, 0.2);
    border-color: #2392ff;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   COOKIE PREFERENCES MODAL
   ========================================================================== */
.cookie-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.cookie-modal-backdrop.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.cookie-modal-card {
    background: #111622;
    border: 1px solid rgba(35, 146, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    max-width: 620px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-modal-backdrop.show .cookie-modal-card {
    transform: scale(1) translateY(0);
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.cookie-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-modal-title h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.cookie-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.cookie-modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.cookie-modal-desc {
    margin: 0 0 18px 0;
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.55;
}

/* Category Items */
.cookie-category-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cookie-category-item:hover {
    border-color: rgba(35, 146, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.cookie-category-title-wrap h4 {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
}

.cookie-badge-locked {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 2px 8px;
    border-radius: 12px;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Custom iOS-style Switch Toggle */
.cookie-switch-wrap {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}

.cookie-switch-wrap input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2b3548;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cookie-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cookie-switch-wrap input:checked + .cookie-switch-slider {
    background-color: #2392ff;
    border-color: #2392ff;
}

.cookie-switch-wrap input:checked + .cookie-switch-slider:before {
    transform: translateX(22px);
}

.cookie-switch-slider.locked {
    background-color: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    cursor: not-allowed;
}

.cookie-switch-slider.locked:before {
    transform: translateX(22px);
    background-color: #10b981;
}

/* Modal Footer */
.cookie-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 22, 34, 0.98);
    flex-shrink: 0;
}

/* Hide banner when modal is open */
body.cookie-modal-open .cookie-consent {
    transform: translateY(120%) !important;
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   FLOATING COOKIE REOPEN BUTTON (RODO art. 7 ust. 3)
   ========================================================================== */
.cookie-reopen-btn {
    position: fixed;
    bottom: 78px;
    right: 24px;
    z-index: 9980;
    background: rgba(15, 20, 31, 0.9);
    border: 1px solid rgba(35, 146, 255, 0.35);
    border-radius: 50px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cookie-reopen-btn:hover {
    border-color: #2392ff;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(35, 146, 255, 0.35);
    background: rgba(21, 29, 46, 0.95);
}

.cookie-reopen-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cookie-consent {
        padding: 16px 14px;
    }

    .cookie-content {
        gap: 14px;
    }

    .cookie-actions-col {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .cookie-actions-col button {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
    }

    .cookie-modal-card {
        max-height: 94vh;
        border-radius: 16px;
    }

    .cookie-modal-header {
        padding: 16px 18px;
    }

    .cookie-modal-body {
        padding: 16px 18px;
    }

    .cookie-category-item {
        padding: 14px 12px;
        gap: 12px;
    }

    .cookie-modal-footer {
        flex-direction: column-reverse;
        padding: 14px 18px;
        gap: 8px;
    }

    .cookie-modal-footer button {
        width: 100%;
    }

    /* Na urządzeniach mobilnych ukrywamy pływający przycisk, aby nie zasłaniał ekranu ani przycisków kontaktu.
       Użytkownik ma pełny dostęp do zmiany zgód przez link 'Ustawienia cookies' w stopce każdej strony (RODO art. 7 ust. 3) */
    .cookie-reopen-btn {
        display: none !important;
    }
}
