/* =====================================================
   AGRIFLORA COOKIE MANAGER
   Fișier: agriflora-cookie.css
   ===================================================== */

:root {
    --af-cookie-green: #176b3a;
    --af-cookie-green-dark: #0f4f2a;
    --af-cookie-green-light: #eaf5ee;
    --af-cookie-text: #20242a;
    --af-cookie-muted: #626b73;
    --af-cookie-border: #d9e0dc;
    --af-cookie-white: #ffffff;
    --af-cookie-overlay: rgba(0, 0, 0, 0.48);
}

/* Fundalul ferestrei de preferințe */
#af-cookie-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: none;
    background: var(--af-cookie-overlay);
}

#af-cookie-overlay.af-cookie-visible {
    display: block;
}

/* Bannerul principal */
#af-cookie-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 999999;
    display: none;
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px;
    color: var(--af-cookie-text);
    background: var(--af-cookie-white);
    border: 1px solid var(--af-cookie-border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

#af-cookie-banner.af-cookie-visible {
    display: block;
}

.af-cookie-banner-content {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
}

.af-cookie-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.af-cookie-title {
    margin: 0 0 8px;
    color: var(--af-cookie-green-dark);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
}

.af-cookie-description {
    margin: 0;
    color: var(--af-cookie-muted);
    font-size: 15px;
    line-height: 1.55;
}

.af-cookie-description a {
    color: var(--af-cookie-green);
    font-weight: 600;
    text-decoration: underline;
}

.af-cookie-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    align-items: center;
}

/* Butoane */
.af-cookie-btn {
    min-height: 44px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.af-cookie-btn:focus-visible,
.af-cookie-close:focus-visible,
.af-cookie-switch input:focus-visible + .af-cookie-slider {
    outline: 3px solid rgba(23, 107, 58, 0.25);
    outline-offset: 2px;
}

.af-cookie-btn-primary {
    color: var(--af-cookie-white);
    background: var(--af-cookie-green);
    border-color: var(--af-cookie-green);
}

.af-cookie-btn-primary:hover {
    background: var(--af-cookie-green-dark);
    border-color: var(--af-cookie-green-dark);
}

.af-cookie-btn-secondary {
    color: var(--af-cookie-green-dark);
    background: var(--af-cookie-white);
    border-color: var(--af-cookie-green);
}

.af-cookie-btn-secondary:hover {
    background: var(--af-cookie-green-light);
}

.af-cookie-btn-link {
    color: var(--af-cookie-green-dark);
    background: transparent;
    border-color: transparent;
}

.af-cookie-btn-link:hover {
    text-decoration: underline;
}

/* Fereastra de preferințe */
#af-cookie-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 999999;
    display: none;
    width: calc(100% - 32px);
    max-width: 620px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    color: var(--af-cookie-text);
    background: var(--af-cookie-white);
    border-radius: 14px;
    box-shadow: 0 20px 65px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
}

#af-cookie-modal.af-cookie-visible {
    display: block;
}

.af-cookie-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    background: var(--af-cookie-white);
    border-bottom: 1px solid var(--af-cookie-border);
}

.af-cookie-modal-title {
    margin: 0;
    color: var(--af-cookie-green-dark);
    font-size: 21px;
    font-weight: 700;
}

.af-cookie-close {
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--af-cookie-text);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 26px;
    line-height: 40px;
    cursor: pointer;
}

.af-cookie-close:hover {
    background: var(--af-cookie-green-light);
}

.af-cookie-modal-body {
    padding: 22px;
}

.af-cookie-intro {
    margin: 0 0 18px;
    color: var(--af-cookie-muted);
    font-size: 14px;
    line-height: 1.55;
}

.af-cookie-category {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 17px 0;
    border-top: 1px solid var(--af-cookie-border);
}

.af-cookie-category:first-of-type {
    border-top: 0;
}

.af-cookie-category-text {
    flex: 1 1 auto;
}

.af-cookie-category-title {
    margin: 0 0 5px;
    color: var(--af-cookie-text);
    font-size: 16px;
    font-weight: 700;
}

.af-cookie-category-description {
    margin: 0;
    color: var(--af-cookie-muted);
    font-size: 13px;
    line-height: 1.5;
}

.af-cookie-always-active {
    display: inline-block;
    flex: 0 0 auto;
    padding: 6px 9px;
    color: var(--af-cookie-green-dark);
    background: var(--af-cookie-green-light);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Comutatoare */
.af-cookie-switch {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 50px;
    height: 28px;
}

.af-cookie-switch input {
    width: 0;
    height: 0;
    opacity: 0;
}

.af-cookie-slider {
    position: absolute;
    inset: 0;
    background: #adb5bd;
    border-radius: 28px;
    cursor: pointer;
    transition: 0.2s;
}

.af-cookie-slider::before {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    content: "";
    background: var(--af-cookie-white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    transition: 0.2s;
}

.af-cookie-switch input:checked + .af-cookie-slider {
    background: var(--af-cookie-green);
}

.af-cookie-switch input:checked + .af-cookie-slider::before {
    transform: translateX(22px);
}

.af-cookie-modal-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 18px 22px;
    background: var(--af-cookie-white);
    border-top: 1px solid var(--af-cookie-border);
}

/* Linkul permanent pentru redeschiderea preferințelor */
.af-cookie-settings-link {
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.af-cookie-settings-link:hover {
    color: var(--af-cookie-green);
}

/* Blochează derularea când fereastra este deschisă */
body.af-cookie-modal-open {
    overflow: hidden;
}

/* Telefon și tabletă */
@media (max-width: 820px) {
    #af-cookie-banner {
        right: 12px;
        bottom: 12px;
        left: 12px;
        padding: 18px;
        border-radius: 12px;
    }

    .af-cookie-banner-content {
        display: block;
    }

    .af-cookie-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-top: 17px;
    }

    .af-cookie-btn-link {
        grid-column: 1 / -1;
    }

    .af-cookie-btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    #af-cookie-banner {
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .af-cookie-title {
        font-size: 19px;
    }

    .af-cookie-actions {
        grid-template-columns: 1fr;
    }

    .af-cookie-btn-link {
        grid-column: auto;
    }

    .af-cookie-category {
        gap: 12px;
    }

    .af-cookie-modal-footer {
        flex-direction: column-reverse;
    }

    .af-cookie-modal-footer .af-cookie-btn {
        width: 100%;
    }
}