/* ============================================================
   Una Avant — cookie-consent.css
   FULL RESPONSIVNOST: Desktop, Tablet, Mobilni
   ============================================================ */

/* ---- Banner overlay ---- */
#ua-cookie-banner {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    pointer-events: none;
}

#ua-cookie-banner.ucb--visible {
    pointer-events: all;
}

/* Backdrop — suptilan */
.ucb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease;
}

#ua-cookie-banner.ucb--visible .ucb__backdrop {
    background: rgba(0, 0, 0, 0.35);
}

/* ---- Kutija — Base styles ---- */
.ucb__box {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,.08),
        0 20px 60px -10px rgba(0,0,0,.22);
    transform: translateY(32px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity   0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: all;
}

/* ---- DESKTOP (1024px+) ---- */
@media (min-width: 1024px) {
    .ucb__box {
        max-width: 560px;
        padding: 2rem;
    }
    
    .ucb__title { font-size: 1.25rem; }
    .ucb__desc { font-size: 0.875rem; margin-bottom: 1.25rem; display: block; }
    .ucb__categories { margin-bottom: 1.5rem; gap: 0.5rem; }
    .ucb__cat { padding: 0.75rem 1rem; }
    .ucb__cat-name { font-size: 0.875rem; }
    .ucb__cat-desc { font-size: 0.75rem; }
    .ucb__always-on { font-size: 0.7rem; padding: 0.2rem 0.55rem; }
    .ucb__btn { font-size: 0.8125rem; padding: 0.6rem 1.1rem; }
}

/* ---- TABLET (600px - 1023px) ---- */
@media (min-width: 600px) and (max-width: 1023px) {
    #ua-cookie-banner {
        padding: 1.25rem;
        align-items: center;
    }
    
    .ucb__box {
        max-width: 480px;
        padding: 1.6rem;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
        border-radius: 16px;
    }
    
    #ua-cookie-banner.ucb--visible .ucb__backdrop {
        background: rgba(0, 0, 0, 0.25);
    }
    
    .ucb__header {
        margin-bottom: 0.7rem;
        flex-shrink: 0;
    }
    
    .ucb__icon { width: 18px; height: 18px; }
    .ucb__title { font-size: 1.1rem; }
    
    .ucb__desc { 
        font-size: 0.8rem;
        margin-bottom: 1rem;
        display: block;
    }
    
    .ucb__categories {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.45rem;
        margin-bottom: 1rem;
        mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    }
    
    .ucb__cat {
        padding: 0.65rem 0.85rem;
        border-radius: 9px;
    }
    
    .ucb__cat-name { font-size: 0.825rem; }
    .ucb__cat-desc { font-size: 0.72rem; }
    .ucb__always-on { font-size: 0.65rem; padding: 0.18rem 0.45rem; }
    
    .ucb__toggle-track { width: 38px; height: 22px; border-radius: 11px; }
    .ucb__toggle-thumb { width: 16px; height: 16px; }
    .ucb__toggle input:checked + .ucb__toggle-track .ucb__toggle-thumb {
        transform: translateX(16px);
    }
    
    .ucb__actions {
        flex-shrink: 0;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .ucb__btn {
        font-size: 0.78rem;
        padding: 0.55rem 0.95rem;
        flex: 1;
    }
    
    .ucb__btn--reject { flex: 0 0 auto; }
    .ucb__btn--save { margin-left: auto; }
}

/* ---- MOBILNI (< 600px) ---- */
@media (max-width: 599px) {
    #ua-cookie-banner {
        padding: 0;
        align-items: flex-end;
    }

    #ua-cookie-banner.ucb--visible .ucb__backdrop {
        background: rgba(0, 0, 0, 0.15);
    }

    .ucb__box {
        border-radius: 16px 16px 0 0;
        padding: 1.1rem 1.1rem 1.3rem;
        max-height: 38vh;
        display: flex;
        flex-direction: column;
    }

    .ucb__header {
        margin-bottom: 0.4rem;
        flex-shrink: 0;
    }

    .ucb__icon { width: 16px; height: 16px; }
    .ucb__title { font-size: 1rem; }

    /* Opis sakrivamo na mobu — oslobodi prostora */
    .ucb__desc { display: none; }

    .ucb__categories {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.35rem;
        margin-bottom: 0.75rem;
        mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
        -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    }

    .ucb__cat {
        padding: 0.5rem 0.7rem;
        border-radius: 8px;
    }

    .ucb__cat-name  { font-size: 0.8rem; }
    .ucb__cat-desc  { font-size: 0.68rem; }
    .ucb__always-on { font-size: 0.62rem; padding: 0.15rem 0.4rem; }

    .ucb__toggle-track { width: 36px; height: 20px; border-radius: 10px; }
    .ucb__toggle-thumb { width: 14px; height: 14px; }
    .ucb__toggle input:checked + .ucb__toggle-track .ucb__toggle-thumb {
        transform: translateX(16px);
    }

    .ucb__actions {
        flex-shrink: 0;
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .ucb__btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        flex: 1;
        text-align: center;
    }

    .ucb__btn--save   { margin-left: 0; order: 1; flex: 1; }
    .ucb__btn--accept { order: 0; }
    .ucb__btn--reject { order: 2; flex: 0 0 auto; padding: 0.5rem 0.6rem; }
}

#ua-cookie-banner.ucb--visible .ucb__box {
    transform: translateY(0);
    opacity: 1;
}

#ua-cookie-banner.ucb--hiding .ucb__box {
    transform: translateY(32px);
    opacity: 0;
}

/* ---- Header ---- */
.ucb__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.ucb__icon {
    color: #1a6b3c;
    flex-shrink: 0;
}

.ucb__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* ---- Opis ---- */
.ucb__desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 1.25rem 0;
}

/* ---- Kategorije ---- */
.ucb__categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ucb__cat {
    background: #f8fafc;
    border: 1px solid #e5e9ef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.ucb__cat:first-child {
    border-color: #d1fae5;
    background: #f0fdf4;
}

.ucb__cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ucb__cat-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.ucb__cat-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.ucb__cat-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.45;
}

.ucb__always-on {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Toggle switch ---- */
.ucb__toggle {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.ucb__toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ucb__toggle-track {
    width: 42px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s ease;
}

.ucb__toggle input:checked + .ucb__toggle-track {
    background: #1a6b3c;
}

.ucb__toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.ucb__toggle input:checked + .ucb__toggle-track .ucb__toggle-thumb {
    transform: translateX(18px);
}

.ucb__toggle input:focus-visible + .ucb__toggle-track {
    outline: 2px solid #1a6b3c;
    outline-offset: 2px;
}

/* ---- Akcijska dugmad ---- */
.ucb__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.ucb__btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    line-height: 1;
}

.ucb__btn:active { transform: scale(0.97); }

.ucb__btn--reject {
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    order: 0;
}
.ucb__btn--reject:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.ucb__btn--save {
    background: #f0fdf4;
    color: #1a6b3c;
    border: 1.5px solid #bbf7d0;
    order: 1;
    margin-left: auto;
}
.ucb__btn--save:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.ucb__btn--accept {
    background: #1a6b3c;
    color: #ffffff;
    order: 2;
    box-shadow: 0 2px 8px rgba(26,107,60,.28);
}
.ucb__btn--accept:hover {
    background: #155e34;
    box-shadow: 0 4px 14px rgba(26,107,60,.36);
}

/* ---- "Upravljaj kolačićima" dugme ---- */
.ucb-manage-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9000;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 1;
}

.ucb-manage-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.ucb-manage-btn:active {
    transform: scale(0.95);
}

.ucb-manage-btn--hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 600px) {
    .ucb-manage-btn {
        bottom: 1.25rem;
        left: 1.25rem;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

#ua-cookie-banner.ucb--visible .ucb__box {
    transform: translateY(0);
    opacity: 1;
}

#ua-cookie-banner.ucb--hiding .ucb__box {
    transform: translateY(32px);
    opacity: 0;
}

/* ---- Header ---- */
.ucb__header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.ucb__icon {
    color: #1a6b3c; /* zelena — boja rijeke */
    flex-shrink: 0;
}

.ucb__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* ---- Opis ---- */
.ucb__desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 1.25rem 0;
}

/* ---- Kategorije ---- */
.ucb__categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ucb__cat {
    background: #f8fafc;
    border: 1px solid #e5e9ef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.ucb__cat:first-child {
    border-color: #d1fae5;
    background: #f0fdf4;
}

.ucb__cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ucb__cat-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ucb__cat-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.ucb__cat-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.45;
}

.ucb__always-on {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Toggle switch ---- */
.ucb__toggle {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    cursor: pointer;
}

.ucb__toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ucb__toggle-track {
    width: 42px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s ease;
}

.ucb__toggle input:checked + .ucb__toggle-track {
    background: #1a6b3c;
}

.ucb__toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.ucb__toggle input:checked + .ucb__toggle-track .ucb__toggle-thumb {
    transform: translateX(18px);
}

.ucb__toggle input:focus-visible + .ucb__toggle-track {
    outline: 2px solid #1a6b3c;
    outline-offset: 2px;
}

/* ---- Akcijska dugmad ---- */
.ucb__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.ucb__btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
    white-space: nowrap;
    line-height: 1;
}

.ucb__btn:active { transform: scale(0.97); }

.ucb__btn--reject {
    background: transparent;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    order: 0;
}
.ucb__btn--reject:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.ucb__btn--save {
    background: #f0fdf4;
    color: #1a6b3c;
    border: 1.5px solid #bbf7d0;
    order: 1;
    margin-left: auto;
}
.ucb__btn--save:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.ucb__btn--accept {
    background: #1a6b3c;
    color: #ffffff;
    order: 2;
    box-shadow: 0 2px 8px rgba(26,107,60,.28);
}
.ucb__btn--accept:hover {
    background: #155e34;
    box-shadow: 0 4px 14px rgba(26,107,60,.36);
}

/* ---- "Upravljaj kolačićima" dugme — mali kolačić u ćošku ---- */
.ucb-manage-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9000;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.92);
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 1;
}

.ucb-manage-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}

.ucb-manage-btn:active {
    transform: scale(0.95);
}

/* Sakriven nakon pristanka */
.ucb-manage-btn--hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 600px) {
    .ucb-manage-btn {
        bottom: 1.25rem;
        left: 1.25rem;
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}