/* YoloCare Cookie Consent — banner styles.
   Colors via CSS custom properties set in admin. WCAG 2.1 AA. */

.ycc-category--locked .ycc-toggle-wrap {
    cursor: not-allowed;
}

.ycc-category--locked .ycc-toggle-input:disabled + .ycc-toggle {
    opacity: 0.55;
}

.ycc-banner {
    --ycc-primary: #3c4b71;
    --ycc-primary-text: #ffffff;
    --ycc-accept-bg: #3c4b71;
    --ycc-accept-text: #ffffff;
    --ycc-accept-hover: #2f3c5c;
    --ycc-reject-bg: #f1f5f9;
    --ycc-reject-text: #0f172a;
    --ycc-reject-hover: #e2e8f0;
    --ycc-background: #ffffff;
    --ycc-text: #0f172a;
    --ycc-link: #3c4b71;
    --ycc-btn-radius: 8px;

    position: fixed;
    inset: auto 0 0 0;
    z-index: 99999;
    background: var(--ycc-background);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
    padding: 1rem clamp(1rem, 4vw, 2rem);
    color: var(--ycc-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    animation: ycc-rise 0.3s ease-out;
}

/* Isolate buttons from theme global styles. */
.ycc-banner button.ycc-btn {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    margin: 0;
}

.ycc-banner[hidden],
.ycc-reopen[hidden],
.ycc-customize[hidden] {
    display: none !important;
}

.ycc-banner--closing {
    animation: ycc-fall 0.3s ease-in forwards;
}

@keyframes ycc-rise {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes ycc-fall {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .ycc-banner { animation: none; }
    .ycc-banner--closing { animation: none; }
    .ycc-reopen { animation: none; }
    .ycc-customize--open { animation: none; }
}

.ycc-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.ycc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.ycc-banner .ycc-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--ycc-text);
    text-transform: none;
    letter-spacing: normal;
    font-family: inherit;
}

.ycc-banner .ycc-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    color: var(--ycc-text);
    max-width: 60ch;
    opacity: 0.85;
    font-family: inherit;
}

.ycc-desc a {
    color: var(--ycc-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ycc-desc a:hover {
    opacity: 0.85;
}

.ycc-desc a:focus-visible {
    outline: 3px solid var(--ycc-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.ycc-banner .ycc-actions-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ycc-banner .ycc-accept {
    order: 1;
}

.ycc-banner .ycc-reject {
    order: 2;
}

.ycc-banner .ycc-customize-btn,
.ycc-banner .ycc-close-btn {
    order: 3;
}

.ycc-actions-bottom {
    margin-top: 1.25rem;
}

.ycc-banner .ycc-btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--ycc-btn-radius, 8px);
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 2.75rem;
    min-width: 2.75rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
    font-family: inherit;
    line-height: 1.3;
}

.ycc-banner .ycc-btn.ycc-btn-primary {
    background-color: var(--ycc-accept-bg) !important;
    color: var(--ycc-accept-text) !important;
    border-color: transparent;
}

.ycc-banner .ycc-btn.ycc-btn-primary:hover {
    background-color: var(--ycc-accept-hover) !important;
    color: var(--ycc-accept-text) !important;
}

.ycc-banner .ycc-btn.ycc-btn-primary:active {
    transform: translateY(1px);
}

.ycc-banner .ycc-btn.ycc-reject {
    background-color: var(--ycc-reject-bg) !important;
    color: var(--ycc-reject-text) !important;
    border-color: #cbd5e1;
}

.ycc-banner .ycc-btn.ycc-reject:hover {
    background-color: var(--ycc-reject-hover) !important;
    color: var(--ycc-reject-text) !important;
    border-color: #94a3b8;
}

.ycc-banner .ycc-btn.ycc-reject:active {
    transform: translateY(1px);
}

.ycc-banner .ycc-btn.ycc-btn-link {
    background-color: transparent;
    color: var(--ycc-link);
    border: none;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0.625rem 0.5rem;
    min-width: auto;
    border-radius: var(--ycc-btn-radius, 8px);
}

.ycc-banner .ycc-btn.ycc-btn-link:hover {
    background-color: transparent;
    color: var(--ycc-link);
    text-decoration-thickness: 2px;
}

.ycc-banner .ycc-btn:focus-visible {
    outline: 3px solid var(--ycc-primary);
    outline-offset: 2px;
}

/* Customize panel */

.ycc-customize {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.ycc-customize--open {
    animation: ycc-slide-down 0.25s ease-out;
}

@keyframes ycc-slide-down {
    from { opacity: 0; transform: translateY(-0.5rem); }
    to   { opacity: 1; transform: translateY(0); }
}

.ycc-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ycc-category {
    padding: 0.25rem 0;
}

.ycc-toggle-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    cursor: pointer;
}

.ycc-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.ycc-toggle {
    flex-shrink: 0;
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    margin-top: 0.125rem;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.ycc-toggle::after {
    content: '';
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.125rem;
    height: 1.125rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.ycc-toggle-input:checked + .ycc-toggle {
    background: var(--ycc-primary);
}

.ycc-toggle-input:checked + .ycc-toggle::after {
    transform: translateX(1.25rem);
}

.ycc-toggle-input:focus-visible + .ycc-toggle {
    outline: 3px solid var(--ycc-primary);
    outline-offset: 2px;
}

.ycc-toggle-input:disabled + .ycc-toggle {
    opacity: 0.6;
    cursor: not-allowed;
}

.ycc-toggle-input:disabled ~ .ycc-category-text {
    cursor: default;
}

.ycc-category-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.ycc-category-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ycc-text);
}

.ycc-category-desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ycc-text);
    opacity: 0.8;
}

.ycc-category-note {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--ycc-text);
    opacity: 0.6;
}

/* Bar layout — compact single row */

.ycc-banner--bar .ycc-header {
    align-items: center;
}

.ycc-banner--bar .ycc-customize {
    margin-top: 1rem;
}

/* Panel layout — expanded header */

.ycc-banner--panel {
    padding: 1.25rem clamp(1rem, 4vw, 2rem) 1.5rem;
}

.ycc-banner--panel .ycc-header {
    align-items: flex-start;
}

button.ycc-reopen {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 99998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 3rem;
    height: 3rem;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--ycc-icon-bg, var(--ycc-primary)) !important;
    color: var(--ycc-icon-color, var(--ycc-primary-text)) !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    opacity: 1;
    animation: ycc-pop 0.25s ease-out;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.ycc-reopen:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.3);
}

button.ycc-reopen:active {
    transform: scale(0.98);
}

button.ycc-reopen:focus-visible {
    outline: 3px solid var(--ycc-primary);
    outline-offset: 2px;
}

@keyframes ycc-pop {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

.ycc-reopen-icon {
    display: block;
    width: 1.375rem;
    height: 1.375rem;
}

.ycc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 640px) {
    .ycc-banner {
        padding: 0.875rem 1rem;
    }

    .ycc-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ycc-actions-top {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Make the primary choices full-width and equal in both layouts. */
    .ycc-accept,
    .ycc-reject {
        flex: 1 1 auto;
    }

    .ycc-actions-top .ycc-btn-link {
        flex: 0 0 auto;
    }

    .ycc-actions-bottom .ycc-save-btn {
        width: 100%;
    }
}
