:root {
    --smartcare-consent-bg: #ffffff;
    --smartcare-consent-text: #172033;
    --smartcare-consent-muted: #526079;
    --smartcare-consent-border: #d8deea;
    --smartcare-consent-primary: #2563eb;
    --smartcare-consent-primary-hover: #0d4bd3;
    --smartcare-consent-primary-text: #ffffff;
    --smartcare-consent-secondary: #475569;
    --smartcare-consent-secondary-hover: #2f3d51;
    --smartcare-consent-secondary-text: #ffffff;
}

.smartcare-consent-open { overflow: hidden; }

#smartcare-consent-layer {
    align-items: center;
    background: rgba(10, 18, 35, .56);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 22px;
    position: fixed;
    z-index: 2147483646;
}

#smartcare-consent-layer[hidden],
#smartcare-consent-layer section[hidden] { display: none !important; }

.smartcare-consent-dialog {
    background: var(--smartcare-consent-bg);
    border: 1px solid var(--smartcare-consent-border);
    border-radius: 16px;
    box-shadow: 0 22px 70px rgba(10, 18, 35, .28);
    box-sizing: border-box;
    color: var(--smartcare-consent-text);
    max-height: min(680px, calc(100vh - 44px));
    max-width: 620px;
    overflow: auto;
    padding: clamp(20px, 3vw, 28px);
    pointer-events: auto;
    width: 100%;
}

#smartcare-consent-layer.smartcare-consent-size-small .smartcare-consent-dialog {
    max-height: min(620px, calc(100vh - 44px));
    max-width: 460px;
    padding: 20px;
}

.smartcare-consent-dialog h2 {
    color: var(--smartcare-consent-text);
    font-size: clamp(23px, 2.5vw, 28px);
    line-height: 1.15;
    margin: 0 0 14px;
}

.smartcare-consent-dialog p {
    color: var(--smartcare-consent-muted);
    font-size: 15px;
    line-height: 1.48;
}

#smartcare-consent-layer.smartcare-consent-size-small .smartcare-consent-dialog h2 { font-size: 23px; }
#smartcare-consent-layer.smartcare-consent-size-small .smartcare-consent-dialog p { font-size: 14px; }

.smartcare-consent-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.smartcare-consent-actions [data-action="customise"] { grid-column: 1 / -1; }

#smartcare-consent-layer .smartcare-consent-actions button,
.smartcare-consent-placeholder button {
    appearance: none;
    border: 2px solid transparent;
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 44px;
    min-width: 0;
    padding: 8px 14px;
    text-decoration: none;
}

#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--primary,
.smartcare-consent-placeholder button {
    background-color: var(--smartcare-consent-primary) !important;
    border-color: var(--smartcare-consent-primary) !important;
    color: var(--smartcare-consent-primary-text) !important;
}

#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--secondary {
    background-color: var(--smartcare-consent-secondary) !important;
    border-color: var(--smartcare-consent-secondary) !important;
    color: var(--smartcare-consent-secondary-text) !important;
}

#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--outline {
    background-color: #ffffff !important;
    border-color: var(--smartcare-consent-secondary) !important;
    color: var(--smartcare-consent-secondary) !important;
}

#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--primary:hover,
#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--primary:focus-visible,
.smartcare-consent-placeholder button:hover,
.smartcare-consent-placeholder button:focus-visible {
    background-color: var(--smartcare-consent-primary-hover) !important;
    border-color: var(--smartcare-consent-primary-hover) !important;
}

#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--secondary:hover,
#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--secondary:focus-visible {
    background-color: var(--smartcare-consent-secondary-hover) !important;
    border-color: var(--smartcare-consent-secondary-hover) !important;
}

#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--outline:hover,
#smartcare-consent-layer .smartcare-consent-actions .smartcare-consent-button--outline:focus-visible {
    background-color: #f1f5f9 !important;
    border-color: var(--smartcare-consent-secondary-hover) !important;
    color: var(--smartcare-consent-secondary-hover) !important;
}

#smartcare-consent-layer .smartcare-consent-actions button:focus-visible,
.smartcare-consent-placeholder button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.smartcare-consent-category {
    align-items: flex-start;
    border-bottom: 1px solid var(--smartcare-consent-border);
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr auto;
    padding: 17px 0;
}

#smartcare-consent-layer.smartcare-consent-size-small .smartcare-consent-category { padding: 13px 0; }

.smartcare-consent-category input {
    height: 22px;
    margin: 2px 0 0;
    width: 22px;
}

.smartcare-consent-category strong,
.smartcare-consent-category small { display: block; }
.smartcare-consent-category small { color: var(--smartcare-consent-muted); font-size: 14px; line-height: 1.45; margin-top: 4px; }
.smartcare-consent-category em { color: #167242; font-size: 13px; font-style: normal; font-weight: 700; white-space: nowrap; }
.smartcare-consent-copy [data-privacy] { color: var(--smartcare-consent-primary); font-weight: 600; }
.smartcare-consent-current { background: #f5f7fb; border-radius: 8px; margin-top: 18px; padding: 12px 16px; }
.smartcare-consent-current p { font-size: 13px; margin: 4px 0; }
.smartcare-consent-current code { overflow-wrap: anywhere; }
#smartcare-consent-layer .smartcare-consent-current .smartcare-consent-linkbutton {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    color: #991b1b !important;
    cursor: pointer;
    font: inherit;
    min-height: 0;
    padding: 8px 0 0;
    text-decoration: underline;
}

#smartcare-consent-layer .smartcare-consent-current .smartcare-consent-linkbutton:hover,
#smartcare-consent-layer .smartcare-consent-current .smartcare-consent-linkbutton:focus-visible {
    background: transparent !important;
    color: #7f1d1d !important;
    outline: 2px solid #fca5a5;
    outline-offset: 2px;
}

#smartcare-consent-layer.smartcare-consent-layout-bar {
    align-items: flex-end;
    background: transparent;
    padding: 0;
    pointer-events: none;
}

#smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-dialog {
    border-radius: 0;
    border-width: 1px 0 0;
    box-shadow: 0 -12px 42px rgba(10, 18, 35, .2);
    max-height: min(78vh, 720px);
    max-width: none;
    padding: 20px clamp(22px, 4vw, 64px);
    width: 100%;
}

#smartcare-consent-layer.smartcare-consent-layout-bar [data-view="main"] {
    align-items: center;
    display: grid;
    gap: 30px;
    grid-template-columns: minmax(260px, 1fr) minmax(560px, .9fr);
    margin: 0 auto;
    max-width: 1440px;
}

#smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-copy p { margin-bottom: 0; }
#smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-controls .smartcare-consent-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
}
#smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-controls [data-action="customise"] { grid-column: auto; }
#smartcare-consent-layer.smartcare-consent-layout-bar [data-view="details"] { margin: 0 auto; max-width: 1100px; }

#smartcare-consent-trigger {
    align-items: center;
    background: #172033;
    border: 2px solid #fff;
    border-radius: 999px;
    bottom: 18px;
    box-shadow: 0 4px 18px rgba(10, 18, 35, .25);
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 20px;
    height: 48px;
    justify-content: center;
    left: 18px;
    position: fixed;
    width: 48px;
    z-index: 2147483645;
}

#smartcare-consent-trigger:focus-visible { outline: 3px solid #6ea8fe; outline-offset: 3px; }

@media (min-width: 1025px) {
    #smartcare-consent-trigger.smartcare-consent-hide-desktop { display: none; }
}

@media (min-width: 621px) and (max-width: 1024px) {
    #smartcare-consent-trigger.smartcare-consent-hide-tablet { display: none; }
}

.smartcare-consent-placeholder {
    align-items: center;
    background: #eef1f6;
    border: 1px solid #ccd4e2;
    border-radius: 8px;
    color: #172033;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 220px;
    padding: 24px;
    text-align: center;
}

.smartcare-consent-placeholder button { min-height: 42px; }
.smartcare-cookie-declaration-surface {
    background: transparent;
    box-sizing: border-box;
    color: inherit;
    font: inherit;
    width: 100%;
}

.smartcare-cookie-declaration {
    --sc-declaration-border: #dbe2ea;
    --sc-declaration-muted: #64748b;
    --sc-declaration-text: #172033;
    color: var(--sc-declaration-text);
    display: grid;
    gap: 16px;
    margin: 22px 0;
}

body:not(.wp-admin) .smartcare-cookie-declaration {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 1200px;
    padding-bottom: clamp(80px, 7vw, 120px);
    padding-top: 32px;
    width: calc(100% - (24px + 24px));
}

.smartcare-cookie-declaration-intro {
    margin-bottom: 2px;
}

.smartcare-cookie-declaration-intro h2 {
    font-size: clamp(22px, 3vw, 28px);
    margin: 0 0 8px;
}

.smartcare-cookie-declaration-intro p {
    color: var(--sc-declaration-muted);
    line-height: 1.6;
    margin: 0;
    max-width: 850px;
}

.smartcare-cookie-category {
    background: #fff;
    border: 1px solid var(--sc-declaration-border);
    border-left: 4px solid #64748b;
    border-radius: 12px;
    overflow: hidden;
}

.smartcare-cookie-category-necessary { border-left-color: #3157e6; }
.smartcare-cookie-category-preferences { border-left-color: #64748b; }
.smartcare-cookie-category-statistics { border-left-color: #15803d; }
.smartcare-cookie-category-marketing { border-left-color: #a85b08; }

.smartcare-cookie-category-header {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 18px 20px;
}

.smartcare-cookie-category-header h3 {
    color: var(--sc-declaration-text);
    font-size: 18px;
    line-height: 1.35;
    margin: 4px 0 5px;
}

.smartcare-cookie-category-header p {
    color: var(--sc-declaration-muted);
    line-height: 1.55;
    margin: 0;
}

.smartcare-cookie-category-status {
    color: #475569;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.smartcare-cookie-category-count {
    align-items: center;
    background: #f1f5f9;
    border-radius: 50%;
    color: #334155;
    display: inline-flex;
    flex: 0 0 32px;
    font-size: 12px;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.smartcare-cookie-table-wrap {
    border-top: 1px solid var(--sc-declaration-border);
    max-width: 100%;
    overflow-x: auto;
}

.smartcare-cookie-declaration table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    min-width: 720px;
    table-layout: fixed;
    width: 100%;
}

.smartcare-cookie-declaration th,
.smartcare-cookie-declaration td {
    border: 0;
    border-bottom: 1px solid #edf1f5;
    overflow-wrap: anywhere;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.smartcare-cookie-declaration th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.smartcare-cookie-declaration th:nth-child(1) { width: 18%; }
.smartcare-cookie-declaration th:nth-child(2) { width: 25%; }
.smartcare-cookie-declaration th:nth-child(3) { width: 39%; }
.smartcare-cookie-declaration th:nth-child(4) { width: 18%; }

.smartcare-cookie-declaration tbody tr:last-child td {
    border-bottom: 0;
}

.smartcare-cookie-declaration code {
    background: #f1f5f9;
    border-radius: 5px;
    color: #334155;
    font-size: .9em;
    padding: 2px 5px;
}

.smartcare-cookie-empty {
    background: #f8fafc;
    border-top: 1px solid var(--sc-declaration-border);
    color: var(--sc-declaration-muted);
    margin: 0;
    padding: 14px 20px;
}

.smartcare-cookie-declaration-actions {
    margin-top: 2px;
}

@media (max-width: 680px) {
    body:not(.wp-admin) .smartcare-cookie-declaration {
        padding-bottom: 72px;
        padding-top: 24px;
        width: calc(100% - (16px + 16px));
    }

    .smartcare-cookie-declaration { gap: 12px; }
    .smartcare-cookie-category { border-left-width: 3px; border-radius: 10px; }
    .smartcare-cookie-category-header { gap: 12px; padding: 15px 14px; }
    .smartcare-cookie-category-header h3 { font-size: 17px; }
    .smartcare-cookie-category-count { flex-basis: 30px; height: 30px; width: 30px; }
    .smartcare-cookie-table-wrap { overflow: visible; }
    .smartcare-cookie-declaration table,
    .smartcare-cookie-declaration tbody,
    .smartcare-cookie-declaration tr { display: block; min-width: 0; width: 100%; }
    .smartcare-cookie-declaration thead { display: none; }
    .smartcare-cookie-declaration tbody tr + tr { border-top: 1px solid var(--sc-declaration-border); }
    .smartcare-cookie-declaration td {
        align-items: start;
        border-bottom: 1px solid #edf1f5;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(82px, 30%) minmax(0, 1fr);
        padding: 10px 14px;
        width: auto !important;
    }
    .smartcare-cookie-declaration td::before {
        color: #475569;
        content: attr(data-label);
        font-size: 11px;
        font-weight: 750;
        letter-spacing: .025em;
        text-transform: uppercase;
    }
    .smartcare-cookie-declaration tbody tr:last-child td:last-child { border-bottom: 0; }
    .smartcare-cookie-declaration code { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
    .smartcare-cookie-empty { padding: 13px 14px; }
    .smartcare-cookie-declaration-actions .button { box-sizing: border-box; min-height: 44px; width: 100%; }
}

@media (max-width: 1024px) {
    #smartcare-consent-layer.smartcare-consent-layout-bar [data-view="main"] { display: block; }
    #smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-controls .smartcare-consent-actions { margin-top: 18px; }
}

@media (max-width: 620px) {
    #smartcare-consent-layer { align-items: flex-end; padding: 0; }
    .smartcare-consent-dialog,
    #smartcare-consent-layer.smartcare-consent-size-small .smartcare-consent-dialog,
    #smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-dialog {
        border-radius: 16px 16px 0 0;
        border-width: 1px 1px 0;
        max-height: 92vh;
        max-width: none;
        padding: 22px 18px;
    }
    .smartcare-consent-actions,
    #smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-controls .smartcare-consent-actions { grid-template-columns: 1fr; }
    .smartcare-consent-actions [data-action="customise"],
    #smartcare-consent-layer.smartcare-consent-layout-bar .smartcare-consent-controls [data-action="customise"] { grid-column: auto; }
    .smartcare-consent-category { grid-template-columns: auto 1fr; }
    .smartcare-consent-category em { grid-column: 2; }
    #smartcare-consent-trigger.smartcare-consent-hide-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    #smartcare-consent-layer, .smartcare-consent-dialog { scroll-behavior: auto; }
}
