/* Cambridge Bespoke — cookie consent banner, preferences drawer and reopen control.
   Hand-written and dependency-free (does not rely on the Tailwind CDN runtime),
   using the site's existing colour, type and spacing conventions. */

#cb-consent-banner,
#cb-consent-panel,
#cb-consent-panel-backdrop,
#cb-consent-reopen {
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}
#cb-consent-banner *,
#cb-consent-panel *,
#cb-consent-reopen * {
    box-sizing: border-box;
}

/* ---------- Banner ---------- */
#cb-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: #F8F7F4;
    border-top: 1px solid #E7E5E4;
    box-shadow: 0 -4px 20px -4px rgba(28, 25, 23, 0.08);
    padding: 20px 24px;
}
.cb-consent-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.cb-consent-banner__text {
    flex: 1 1 auto;
    min-width: 0;
}
.cb-consent-banner__title {
    font-family: 'Lora', serif;
    font-size: 15px;
    font-weight: 600;
    color: #1c1917;
    margin: 0 0 4px;
}
.cb-consent-banner__body {
    font-size: 13px;
    line-height: 1.6;
    color: #57534e;
    font-weight: 300;
    margin: 0;
}
.cb-consent-banner__body a {
    color: #292524;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cb-consent-banner__actions {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ---------- Buttons (shared by banner and panel) ---------- */
.cb-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 11px 20px;
    border-radius: 9999px;
    border: 1px solid #292524;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
}
.cb-consent-btn--solid {
    background: #292524;
    color: #ffffff;
}
.cb-consent-btn--solid:hover {
    background: #1c1917;
}
.cb-consent-btn--outline {
    background: transparent;
    color: #292524;
}
.cb-consent-btn--outline:hover {
    background: #292524;
    color: #ffffff;
}
.cb-consent-btn--ghost {
    border-color: transparent;
    background: transparent;
    color: #57534e;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 11px 8px;
}
.cb-consent-btn--ghost:hover {
    color: #1c1917;
}
.cb-consent-btn--block {
    width: 100%;
}
.cb-consent-btn:focus-visible {
    outline: 2px solid #292524;
    outline-offset: 2px;
}

/* ---------- Preferences panel (right-hand drawer, matches the site's nav/basket drawers) ---------- */
#cb-consent-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.4);
    z-index: 2998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
#cb-consent-panel-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}
#cb-consent-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    z-index: 2999;
    box-shadow: -8px 0 30px -8px rgba(28, 25, 23, 0.25);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}
#cb-consent-panel.is-open {
    transform: translateX(0);
}
.cb-consent-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #F0EEEA;
    flex: 0 0 auto;
}
.cb-consent-panel__title {
    font-family: 'Lora', serif;
    font-size: 20px;
    color: #1c1917;
    margin: 0;
}
.cb-consent-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    color: #78716c;
    font-size: 22px;
    line-height: 1;
    padding: 6px;
}
.cb-consent-panel__close:hover {
    color: #1c1917;
}
.cb-consent-panel__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.cb-consent-panel__intro {
    font-size: 13px;
    line-height: 1.6;
    color: #57534e;
    font-weight: 300;
    margin: 0 0 24px;
}
.cb-consent-row {
    padding: 16px 0;
    border-top: 1px solid #F0EEEA;
}
.cb-consent-row:first-of-type {
    border-top: none;
}
.cb-consent-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.cb-consent-row__name {
    font-family: 'Lora', serif;
    font-size: 15px;
    color: #1c1917;
    margin: 0;
}
.cb-consent-row__status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #78716c;
}
.cb-consent-row__desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: #78716c;
    font-weight: 300;
    margin: 0;
    padding-right: 54px;
}

/* ---------- Toggle switch ---------- */
.cb-consent-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: 0 0 auto;
    cursor: pointer;
}
.cb-consent-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.cb-consent-toggle__track {
    position: absolute;
    inset: 0;
    background: #D6D3D1;
    border-radius: 9999px;
    transition: background-color 0.2s ease;
}
.cb-consent-toggle__track::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.cb-consent-toggle input:checked + .cb-consent-toggle__track {
    background: #292524;
}
.cb-consent-toggle input:checked + .cb-consent-toggle__track::before {
    transform: translateX(18px);
}
.cb-consent-toggle input:focus-visible + .cb-consent-toggle__track {
    outline: 2px solid #292524;
    outline-offset: 2px;
}

.cb-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cb-consent-panel__footer {
    padding: 20px 24px 24px;
    border-top: 1px solid #F0EEEA;
    flex: 0 0 auto;
}
.cb-consent-panel__footer-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.cb-consent-panel__footer-row .cb-consent-btn {
    flex: 1 1 0;
}

/* ---------- Discreet reopen control ---------- */
#cb-consent-reopen {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1500;
    background: #F8F7F4;
    border: 1px solid #E7E5E4;
    color: #78716c;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 2px 8px -2px rgba(28, 25, 23, 0.12);
    transition: color 0.2s ease, border-color 0.2s ease;
}
#cb-consent-reopen:hover {
    color: #1c1917;
    border-color: #D6D3D1;
}
#cb-consent-reopen:focus-visible {
    outline: 2px solid #292524;
    outline-offset: 2px;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    #cb-consent-banner {
        padding: 16px;
        max-height: 70vh;
        overflow-y: auto;
    }
    .cb-consent-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .cb-consent-banner__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .cb-consent-banner__actions .cb-consent-btn {
        width: 100%;
        padding-top: 13px;
        padding-bottom: 13px;
    }
    .cb-consent-banner__actions .cb-consent-btn--ghost {
        order: 3;
    }
    #cb-consent-panel {
        max-width: 100%;
    }
    .cb-consent-row__desc {
        padding-right: 0;
    }
    #cb-consent-reopen {
        left: 12px;
        bottom: 12px;
        padding: 7px 12px;
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cb-consent-panel,
    #cb-consent-panel-backdrop,
    .cb-consent-toggle__track,
    .cb-consent-toggle__track::before {
        transition: none !important;
    }
}
