/* ==========================================================================
   Silktide Enhanced CSS
   Theme: Yellow (#ffce00) & White
   ========================================================================== */

/* 1. TŁO (BACKDROP) - Przyciemnienie strony pod oknem */
#silktide-backdrop-global {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99998;
}

/* 2. GŁÓWNE OKNO (MODAL) - Wyśrodkowanie */
#silktide-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    max-width: 95%;
    max-height: 90vh;
    background-color: #fff;
    box-shadow: 0 32px 68px rgba(0,0,0,0.3);
    border-radius: 4px;
    font-family: sans-serif;
    font-size: 14px;
    color: #333;
    z-index: 99999;
    flex-direction: column;
    overflow: hidden;
}

/* Klasa dodawana przez JS, by pokazać okno */
#silktide-modal.active {
    display: flex !important;
}

/* 3. NAGŁÓWEK */
#silktide-modal header {
    padding: 20px 30px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 4. TREŚĆ */
#silktide-modal section {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.5;
}

#silktide-modal section p {
    margin-bottom: 15px;
}

/* 5. SUWAKI / PREFERENCJE */
#silktide-modal fieldset {
    border: 0;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    margin: 0;
}

#silktide-modal fieldset:last-child {
    border-bottom: 0;
}

#silktide-modal legend {
    font-weight: 700;
    width: 100%;
    margin-bottom: 5px;
    display: block;
}

#silktide-modal .cookie-type-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

#silktide-modal .cookie-type-description {
    font-size: 13px;
    color: #666;
    flex: 1;
}

/* Stylizacja przełącznika (Switch) */
#silktide-modal .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    vertical-align: middle; /* Wyrównanie w pionie */
}

#silktide-modal .switch input {
    opacity: 0;
    width: 100% !important;   /* Rozciągnij na całą szerokość */
    height: 100% !important;  /* Rozciągnij na całą wysokość */
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 10;              /* Upewnij się, że jest NA WIERZCHU */
    cursor: pointer;
}

#silktide-modal .switch__pill {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
    pointer-events: none;     /* Kliknięcia przechodzą przez grafikę do inputa */
    z-index: 1;
}

#silktide-modal .switch__pill:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Stan włączony - ŻÓŁTY */
#silktide-modal .switch input:checked + .switch__pill {
    background-color: #ffce00;
}

#silktide-modal .switch input:checked + .switch__pill:before {
    transform: translateX(20px);
}

/* Stan zablokowany (niezbędne) */
#silktide-modal .switch input:disabled + .switch__pill {
    opacity: 0.5;
    background-color: #ffce00; /* Niezbędne są zawsze włączone */
    cursor: not-allowed;
}
#silktide-modal .switch input:disabled + .switch__pill:before {
    transform: translateX(20px); /* Zablokowane w pozycji włączonej */
}

/* 6. STOPKA (PRZYCISKI) */
#silktide-modal footer {
    padding: 20px 30px;
    background-color: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

#silktide-modal button {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Przycisk: Odmowa */
#silktide-modal .preferences-reject-all {
    background: #fff;
    border: 2px solid #ffce00;
    color: #000;
    order: 1;
}
#silktide-modal .preferences-reject-all:hover {
    background-color: #fff8e1;
}

/* Przycisk: Spersonalizuj / Wybrane */
#silktide-modal .preferences-selection {
    background: #fff;
    border: 2px solid #ffce00;
    color: #000;
    order: 2;
}
#silktide-modal .preferences-selection:hover {
    background-color: #fff8e1;
}

/* Przycisk: Zezwól na wszystkie - ŻÓŁTY */
#silktide-modal .preferences-accept-all {
    background: #ffce00;
    border: 2px solid #ffce00;
    color: #000;
    order: 3;
}
#silktide-modal .preferences-accept-all:hover {
    opacity: 0.9;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
    #silktide-modal {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    #silktide-modal footer {
        flex-direction: column-reverse; /* Przyciski jeden pod drugim */
    }

    #silktide-modal button {
        width: 100%;
        text-align: center;
    }

    /* Kolejność na mobile: Akceptuj na górze */
    #silktide-modal .preferences-accept-all { order: 1; margin-bottom: 10px; }
    #silktide-modal .preferences-selection  { order: 2; margin-bottom: 10px; }
    #silktide-modal .preferences-reject-all { order: 3; }
}

.CookieDeclaration {
    font-family: sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}
.CookieDeclarationType {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #eee;
    background: #fff;
}
.CookieDeclarationTypeHeader {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #000;
}
.CookieDeclarationTypeDescription {
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}
.CookieDeclarationTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.CookieDeclarationTable th {
    text-align: left;
    border-bottom: 2px solid #999;
    padding: 8px;
    background: #f9f9f9;
}
.CookieDeclarationTable td {
    border-bottom: 1px solid #eee;
    padding: 8px;
    vertical-align: top;
}
.CookieDeclarationTable tr:hover {
    background-color: #f1f1f1;
}
@media (max-width: 600px) {
    /* Ukrywanie kolumn na telefonie dla czytelności */
    .CookieDeclarationTable th:nth-child(4), .CookieDeclarationTable td:nth-child(4),
    .CookieDeclarationTable th:nth-child(5), .CookieDeclarationTable td:nth-child(5) {
        display: none;
    }
}