/* ==========================================================================
   ALH Real Estate - Premium Cookie Consent Banner & Modal
   ========================================================================== */

:root {
    --alh-bg: #0d1724;
    --alh-text: #ffffff;
    --alh-accent: #5bb2e8;
    --alh-btn-accept-bg: #5bb2e8;
    --alh-btn-accept-text: #0d1724;
    --alh-btn-custom-bg: rgba(255, 255, 255, 0.12);
    --alh-btn-custom-text: #ffffff;
    --alh-btn-reject-border: rgba(255, 255, 255, 0.3);
    --alh-btn-reject-text: #ffffff;
    --alh-radius: 12px;
    --alh-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Container & Placement
   -------------------------------------------------------------------------- */
#alh-cookie-wrapper {
    position: fixed;
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

#alh-cookie-wrapper *,
#alh-cookie-modal-backdrop * {
    box-sizing: border-box;
}

#alh-cookie-wrapper.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Position: Bottom Bar */
#alh-cookie-wrapper.alh-pos-bottom_bar {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 0;
}

#alh-cookie-wrapper.alh-pos-bottom_bar.alh-anim-slide_up {
    transform: translateY(100%);
}
#alh-cookie-wrapper.alh-pos-bottom_bar.is-visible {
    transform: translateY(0);
}

/* Position: Floating Right */
#alh-cookie-wrapper.alh-pos-floating_right {
    right: 24px;
    bottom: 24px;
    max-width: 480px;
    width: calc(100% - 48px);
}
#alh-cookie-wrapper.alh-pos-floating_right.alh-anim-slide_up {
    transform: translateY(30px);
}
#alh-cookie-wrapper.alh-pos-floating_right.is-visible {
    transform: translateY(0);
}

/* Position: Floating Left */
#alh-cookie-wrapper.alh-pos-floating_left {
    left: 24px;
    bottom: 24px;
    max-width: 480px;
    width: calc(100% - 48px);
}
#alh-cookie-wrapper.alh-pos-floating_left.alh-anim-slide_up {
    transform: translateY(30px);
}
#alh-cookie-wrapper.alh-pos-floating_left.is-visible {
    transform: translateY(0);
}

/* Position: Floating Center */
#alh-cookie-wrapper.alh-pos-floating_center {
    left: 50%;
    bottom: 24px;
    max-width: 600px;
    width: calc(100% - 48px);
    transform: translateX(-50%) translateY(30px);
}
#alh-cookie-wrapper.alh-pos-floating_center.is-visible {
    transform: translateX(-50%) translateY(0);
}

/* Position: Center Modal */
#alh-cookie-wrapper.alh-pos-center_modal {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
}
#alh-cookie-wrapper.alh-pos-center_modal #alh-cookie-banner {
    max-width: 560px;
    width: 100%;
}

/* Backdrop blur option */
#alh-cookie-wrapper.alh-has-blur #alh-cookie-banner {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* --------------------------------------------------------------------------
   Banner Core Card
   -------------------------------------------------------------------------- */
#alh-cookie-banner {
    background: var(--alh-bg);
    color: var(--alh-text);
    box-shadow: var(--alh-shadow);
    border-radius: var(--alh-radius);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

#alh-cookie-wrapper.alh-pos-bottom_bar #alh-cookie-banner {
    border-radius: var(--alh-radius) var(--alh-radius) 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.alh-cookie-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

#alh-cookie-wrapper:not(.alh-pos-bottom_bar) .alh-cookie-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 26px 28px;
    gap: 20px;
}

/* Content */
.alh-cookie-content {
    flex: 1 1 auto;
}

.alh-cookie-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--alh-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alh-cookie-title-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--alh-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--alh-accent);
}

.alh-cookie-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--alh-text);
    opacity: 0.88;
    margin: 0;
}

.alh-cookie-links {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.alh-cookie-link {
    color: var(--alh-accent);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.alh-cookie-link:hover {
    opacity: 0.8;
}

/* Action Buttons */
.alh-cookie-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

#alh-cookie-wrapper:not(.alh-pos-bottom_bar) .alh-cookie-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#alh-cookie-wrapper .alh-cookie-btn,
#alh-cookie-modal-backdrop .alh-cookie-btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: none !important;
    border-radius: calc(var(--alh-radius) * 0.7) !important;
    padding: 11px 22px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    cursor: pointer !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap !important;
    text-align: center !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    box-shadow: none !important;
    font-family: inherit !important;
}

#alh-cookie-wrapper .alh-cookie-btn-accept,
#alh-cookie-modal-backdrop .alh-cookie-btn-accept {
    background: var(--alh-btn-accept-bg) !important;
    background-color: var(--alh-btn-accept-bg) !important;
    color: var(--alh-btn-accept-text) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(91, 178, 232, 0.35) !important;
}

#alh-cookie-wrapper .alh-cookie-btn-accept:hover,
#alh-cookie-modal-backdrop .alh-cookie-btn-accept:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(91, 178, 232, 0.45) !important;
    filter: brightness(1.08) !important;
    color: var(--alh-btn-accept-text) !important;
}

#alh-cookie-wrapper .alh-cookie-btn-customize,
#alh-cookie-modal-backdrop .alh-cookie-btn-secondary {
    background: var(--alh-btn-custom-bg) !important;
    background-color: var(--alh-btn-custom-bg) !important;
    color: var(--alh-btn-custom-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

#alh-cookie-wrapper .alh-cookie-btn-customize:hover,
#alh-cookie-modal-backdrop .alh-cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    background-color: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

#alh-cookie-wrapper .alh-cookie-btn-reject,
#alh-cookie-modal-backdrop .alh-cookie-btn-reject {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--alh-btn-reject-text) !important;
    border: 1px solid var(--alh-btn-reject-border) !important;
}

#alh-cookie-wrapper .alh-cookie-btn-reject:hover,
#alh-cookie-modal-backdrop .alh-cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   Preferences Modal
   -------------------------------------------------------------------------- */
.alh-cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(4, 9, 16, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.alh-cookie-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.alh-cookie-modal {
    background: var(--alh-bg);
    color: var(--alh-text);
    border-radius: calc(var(--alh-radius) * 1.2);
    max-width: 620px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.alh-cookie-modal-backdrop.is-open .alh-cookie-modal {
    transform: scale(1) translateY(0);
}

.alh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 18px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.alh-modal-header-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alh-modal-shield-icon {
    width: 32px;
    height: 32px;
    background: rgba(91, 178, 232, 0.12);
    border: 1px solid rgba(91, 178, 232, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.alh-modal-shield-icon::after {
    content: "✓";
    color: var(--alh-accent);
    font-weight: 700;
    font-size: 16px;
}

.alh-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--alh-text);
    margin: 0;
}

.alh-modal-close-btn {
    background: transparent !important;
    border: none !important;
    color: var(--alh-text) !important;
    opacity: 0.65 !important;
    font-size: 28px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.alh-modal-close-btn:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.alh-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.alh-modal-intro {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--alh-text);
    opacity: 0.8;
    margin: 0 0 16px 0;
}

.alh-modal-legal-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 0 0 20px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.alh-modal-legal-links .alh-cookie-link {
    font-size: 12.5px;
    color: var(--alh-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.alh-modal-legal-links .alh-cookie-link:hover {
    opacity: 1;
    color: #ffffff;
}

.alh-categories-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.alh-cat-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px 18px;
    transition: background 0.2s ease;
}

.alh-cat-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.alh-cat-item.is-locked {
    border-left: 3px solid var(--alh-accent);
}

.alh-cat-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.alh-cat-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alh-cat-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--alh-text);
    margin: 0;
}

.alh-badge-locked {
    font-size: 11px;
    font-weight: 600;
    background: rgba(91, 178, 232, 0.15);
    color: var(--alh-accent);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

.alh-cat-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--alh-text);
    opacity: 0.72;
    margin: 0;
}

/* Accessible Toggle Switch */
.alh-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.alh-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.alh-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    transition: background-color 0.25s ease;
}

.alh-toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.alh-toggle-switch input:checked + .alh-toggle-slider {
    background-color: var(--alh-accent);
}

.alh-toggle-switch input:checked + .alh-toggle-slider::before {
    transform: translateX(20px);
}

.alh-modal-footer {
    padding: 18px 28px 22px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Floating Badge Trigger (Reopen Preferences)
   -------------------------------------------------------------------------- */
button.alh-cookie-badge {
    position: fixed !important;
    z-index: 999997 !important;
    background: var(--alh-bg) !important;
    background-color: var(--alh-bg) !important;
    color: var(--alh-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: 1.2 !important;
}

button.alh-cookie-badge.alh-badge-bottom_left {
    left: 20px !important;
    bottom: 20px !important;
}

button.alh-cookie-badge.alh-badge-bottom_right {
    right: 20px !important;
    bottom: 20px !important;
}

/* Badge Styles */
button.alh-cookie-badge.alh-badge-style-icon_text {
    padding: 9px 18px !important;
    border-radius: 30px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

button.alh-cookie-badge.alh-badge-style-icon_only {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
}

.alh-cookie-badge.alh-badge-style-minimal_dot {
    width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 50%;
    background: var(--alh-accent);
    border: 2px solid #ffffff;
}
.alh-cookie-badge.alh-badge-style-minimal_dot .alh-badge-icon {
    display: none;
}

button.alh-cookie-badge .alh-badge-text {
    color: var(--alh-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

button.alh-cookie-badge .alh-badge-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--alh-accent) !important;
}

button.alh-cookie-badge:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
    border-color: var(--alh-accent) !important;
}

/* --------------------------------------------------------------------------
   Responsive Mobile Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .alh-cookie-inner {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .alh-cookie-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .alh-cookie-btn {
        width: 100%;
        padding: 12px;
    }

    .alh-modal-footer {
        flex-direction: column-reverse;
        padding: 16px 20px;
    }

    .alh-modal-footer .alh-cookie-btn {
        width: 100%;
    }
}
