/* ==========================================================================
   cookie-consent.css — Raviva Dental
   Sitewide cookie-consent banner + "Manage Preferences" modal. Loaded on
   every page from includes/header.php, right alongside base.css, so the
   banner is styled correctly the moment it's shown (no flash of
   unstyled content on first paint).

   Companion script: assets/js/cookie-consent.js (also loaded sitewide,
   from includes/footer.php). See that file's header comment for the
   full consent flow — this stylesheet only concerns itself with how
   the banner/modal look, never with the consent logic itself.
   ========================================================================== */

/* ---------- Bottom banner ---------- */
.cookie-consent-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: var(--z-cookie-consent);
    max-width: 720px;
    margin: 0 auto;
    background: var(--white);
    color: var(--dark);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--line);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: 'Manrope', Arial, Helvetica, sans-serif;

    /* Starts off-screen + invisible; .show slides it in. Kept in the DOM
       at all times (rather than display:none by default) so it can
       transition smoothly instead of just popping into view. */
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cookie-consent-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cookie-consent-banner[hidden] { display: none; }

.cookie-consent-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brown-mid);
    color: var(--white);
    display: grid;
    place-items: center;
    font-size: 17px;
    flex-shrink: 0;
}

.cookie-consent-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cookie-consent-banner h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 6px;
    color: var(--dark);
}

.cookie-consent-banner p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.cookie-consent-banner a {
    color: var(--brown-deep);
    font-weight: 600;
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-consent-actions button {
    font-family: 'Manrope', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 14px;
    border-radius: 30px;
    padding: 11px 22px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: 0.2s ease;
}

.cookie-consent-actions .cc-btn-primary {
    background: var(--brown-mid);
    color: var(--white);
}

.cookie-consent-actions .cc-btn-primary:hover { background: var(--brown-deep); }

.cookie-consent-actions .cc-btn-outline {
    background: transparent;
    border-color: var(--dark);
    color: var(--dark);
}

.cookie-consent-actions .cc-btn-outline:hover { background: var(--dark); color: var(--white); }

.cookie-consent-actions .cc-btn-text {
    background: transparent;
    border-color: transparent;
    color: var(--ink-soft);
    text-decoration: underline;
    padding: 11px 10px;
}

.cookie-consent-actions .cc-btn-text:hover { color: var(--dark); }

/* Small inline text-link style used for "cookie preferences" links
   embedded inside a sentence (the banner's intro paragraph, and the
   footer's persistent "Cookie Preferences" button) rather than as a
   standalone button. */
.cookie-consent-text-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--brown-deep);
    text-decoration: underline;
    cursor: pointer;
}

.cookie-consent-footer-link {
    background: none;
    border: none;
    padding: 0;
    margin-top: 6px;
    display: inline-block;
    font: inherit;
    font-size: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Preferences modal ---------- */
.cookie-consent-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-cookie-consent);
    background: rgba(38, 51, 50, 0.55);
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.cookie-consent-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.cookie-consent-overlay[hidden] { display: none; }

.cookie-consent-modal {
    background: var(--white);
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: var(--shadow-soft);
    font-family: 'Manrope', Arial, Helvetica, sans-serif;
}

.cookie-consent-modal h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 21px;
    font-weight: 500;
    margin: 0 0 8px;
    color: var(--dark);
}

.cookie-consent-modal > p {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
}

.cookie-consent-category {
    border-top: 1px solid var(--line);
    padding: 18px 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.cookie-consent-category:last-of-type { border-bottom: 1px solid var(--line); }

.cookie-consent-category-text h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--dark);
}

.cookie-consent-category-text p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--ink-soft);
}

/* Toggle switch */
.cookie-consent-switch {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
}

.cookie-consent-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cookie-consent-switch input:disabled { cursor: not-allowed; }

.cookie-consent-switch-track {
    position: absolute;
    inset: 0;
    background: var(--sand);
    border-radius: 20px;
    transition: background 0.2s ease;
}

.cookie-consent-switch-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(38,51,50,0.3);
    transition: transform 0.2s ease;
}

.cookie-consent-switch input:checked ~ .cookie-consent-switch-track {
    background: var(--brown-mid);
}

.cookie-consent-switch input:checked ~ .cookie-consent-switch-track::before {
    transform: translateX(20px);
}

.cookie-consent-switch input:disabled ~ .cookie-consent-switch-track {
    opacity: 0.6;
}

.cookie-consent-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 26px;
}

.cookie-consent-modal-actions button {
    font-family: 'Manrope', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 14px;
    border-radius: 30px;
    padding: 11px 22px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: 0.2s ease;
}

.cookie-consent-modal-actions .cc-btn-primary {
    background: var(--brown-mid);
    color: var(--white);
}

.cookie-consent-modal-actions .cc-btn-primary:hover { background: var(--brown-deep); }

.cookie-consent-modal-actions .cc-btn-outline {
    background: transparent;
    border-color: var(--dark);
    color: var(--dark);
}

.cookie-consent-modal-actions .cc-btn-outline:hover { background: var(--dark); color: var(--white); }

/* ---------- Inline "cookies required" notice shown on the booking /
   review forms when someone tries to submit before making a cookie
   choice. Styled to match .form-error already used by both forms
   (assets/css/base.css) so it reads as part of the same system. ---------- */
.cookie-consent-form-notice {
    display: none;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 500;
    background: var(--sand);
    color: var(--dark);
    border: 1px solid var(--brown-mid);
}

.cookie-consent-form-notice.show { display: block; }

.cookie-consent-form-notice button {
    background: none;
    border: none;
    padding: 0;
    margin-left: 4px;
    font: inherit;
    font-weight: 700;
    color: var(--brown-deep);
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .cookie-consent-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: 20px;
    }
    .cookie-consent-actions { justify-content: stretch; }
    .cookie-consent-actions button { flex: 1 1 auto; text-align: center; }
    .cookie-consent-modal { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-consent-overlay { transition: none; }
}
