/* Cookie consent banner — 3 layout variants, themable via --wcr-cookie-* custom properties */

.wcr-cookie-consent {
    position: fixed;
    z-index: 9999;
    color: var(--wcr-cookie-text, #fafaf9);
    background: var(--wcr-cookie-background, #1c1917);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 -10px 40px -8px rgba(0, 0, 0, 0.35), 0 -2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1.55;
    font-size: 0.95rem;
    animation: wcr-cookie-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wcr-cookie-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wcr-cookie-consent--modal {
    animation: wcr-cookie-modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wcr-cookie-modal-in {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.wcr-cookie-consent__inner,
.wcr-cookie-consent__manage {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 80rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .wcr-cookie-consent__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 2.5rem;
    }
}

.wcr-cookie-consent__text {
    flex: 1;
    min-width: 0;
}

.wcr-cookie-consent__text h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.01em;
}

.wcr-cookie-consent__text p {
    margin: 0;
    font-size: 0.92rem;
    opacity: 0.88;
}

.wcr-cookie-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .wcr-cookie-consent__actions { flex-direction: column; }
    .wcr-cookie-consent__actions .wcr-btn { width: 100%; }
}

.wcr-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 0.6rem;
    padding: 0.7rem 1.25rem;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    color: inherit;
    line-height: 1.2;
    transition: filter 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.wcr-btn:hover { filter: brightness(1.1); }
.wcr-btn:active { transform: translateY(1px); }
.wcr-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--wcr-cookie-accent, #10b981);
}

.wcr-btn--accept {
    background: var(--wcr-cookie-accept, #10b981);
    color: #fff;
    box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.2);
}
.wcr-btn--reject {
    background: var(--wcr-cookie-reject, #78716c);
    color: #fff;
}
.wcr-btn--manage {
    background: var(--wcr-cookie-manage, transparent);
    border-color: currentColor;
    color: inherit;
    opacity: 0.85;
}
.wcr-btn--manage:hover { opacity: 1; filter: none; }

/* Manage panel header with Back button */
.wcr-cookie-consent__manage-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
}

.wcr-cookie-consent__manage-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.wcr-cookie-consent__back {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    margin-left: -0.65rem;
    border-radius: 0.45rem;
    font-size: 0.88rem;
    font-weight: 500;
    opacity: 0.75;
    transition: opacity 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.wcr-cookie-consent__back:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.wcr-cookie-consent__back:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--wcr-cookie-accent, #10b981);
}

.wcr-cookie-consent__back svg {
    flex-shrink: 0;
}

/* Categories */
.wcr-cookie-category {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.85rem;
    align-items: start;
    padding: 0.85rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.wcr-cookie-category:hover strong { opacity: 1; }

.wcr-cookie-category strong {
    grid-column: 2;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.95;
}

.wcr-cookie-category small {
    grid-column: 2;
    opacity: 0.72;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.wcr-cookie-category input {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--wcr-cookie-accent, #10b981);
    cursor: pointer;
}

.wcr-cookie-category input:disabled { cursor: not-allowed; opacity: 0.7; }

/* Variant: bottom-bar */
.wcr-cookie-consent--bottom-bar {
    left: 0;
    right: 0;
    bottom: 0;
}

/* Variant: corner */
.wcr-cookie-consent--corner {
    right: 1.25rem;
    bottom: 1.25rem;
    max-width: 24rem;
    border-radius: 0.85rem;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.45), 0 8px 16px -8px rgba(0, 0, 0, 0.25);
}

.wcr-cookie-consent--corner .wcr-cookie-consent__inner,
.wcr-cookie-consent--corner .wcr-cookie-consent__manage {
    padding: 1.35rem 1.5rem;
}

/* Variant: modal */
.wcr-cookie-consent--modal {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(38rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border-radius: 0.85rem;
    box-shadow: 0 25px 80px -12px rgba(0, 0, 0, 0.6);
}

.wcr-cookie-consent--modal::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
