/* Shared public frontend styles */
:root {
    --brand-primary: #262626;
    --brand-primary-dark: #171717;
    --brand-violet: #682CC7;
    --brand-violet-soft: rgba(104, 44, 199, 0.12);
    --navy: #0f1b2d;
    --ink: #1a2332;
    --slate: #4a5568;
    --muted: #718096;
    --border: #e2e8f0;
    --surface: #f7f8fa;
    --white: #ffffff;
    --gold: #c9952a;
    --gold-lt: #f5e6c8;
    --purple: #6b46c1;
    --purple-lt: #ede9fe;
    --green: #276749;
    --green-lt: #c6f6d5;
    --amber: #b45309;
    --amber-lt: #fef3c7;
    --red: #c53030;
    --red-lt: #fed7d7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(15, 27, 45, 0.08);
    box-shadow: 0 10px 30px rgba(15, 27, 45, 0.06);
    backdrop-filter: blur(12px);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-logo .header-logo-image {
    width: 172px;
    max-width: 100%;
    height: auto;
    display: block;
}

.header-logo .logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--brand-primary);
    font-weight: 700;
    letter-spacing: -0.3px;
    display: none;
}

.header-logo .logo-sub {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: block;
}

.header-search-wrap {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.header-mobile-search-btn,
.header-mobile-search-close {
    display: none;
}

.header-search-city {
    display: contents;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    height: 42px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(38, 38, 38, 0.08);
    background: var(--white);
}

.city-picker {
    height: 100%;
    flex-shrink: 0;
}

.city-picker-trigger {
    height: 100%;
    min-width: 130px;
    border: none;
    border-right: 1px solid var(--border);
    background: transparent;
    padding: 0 14px 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
}

.city-picker-trigger:hover,
.city-picker-trigger:focus-visible {
    color: var(--brand-primary-dark);
    background: rgba(38, 38, 38, 0.04);
    outline: none;
}

.city-picker-trigger-label {
    white-space: nowrap;
}

.city-picker-trigger-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.city-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.city-picker-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.city-picker-modal {
    position: relative;
    width: min(640px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    border-radius: 24px;
    border: 1px solid rgba(15, 27, 45, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
    overflow: hidden;
    z-index: 1200;
    display: flex;
    flex-direction: column;
}

.city-picker-modal-head {
    padding: 18px 18px 0;
}

.city-picker-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    border: 1px solid rgba(15, 27, 45, 0.08);
    border-radius: 16px;
    background: #ffffff;
    padding: 0 16px;
}

.city-picker-search-icon {
    width: 24px;
    height: 24px;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.city-picker-search-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
}

.city-picker-search-input:focus {
    outline: none;
}

.city-picker-search-input::placeholder {
    color: #8b93a6;
}

.city-picker-modal-body {
    padding: 16px 18px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.city-picker-popular-title {
    margin-bottom: 14px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #414857;
}

.city-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 12px;
    max-height: min(46vh, 360px);
   /* overflow-y: auto; */
    padding-right: 4px;
}

.city-picker-card {
    border: 1px solid rgba(15, 27, 45, 0.08);
    background: #ffffff;
    border-radius: 18px;
    min-height: 104px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.city-picker-card:hover {
    transform: translateY(-2px);
    border-color: rgba(104, 44, 199, 0.28);
    box-shadow: 0 14px 26px rgba(104, 44, 199, 0.1);
}

.city-picker-card.is-active {
    background: linear-gradient(180deg, #f7efff 0%, #fdf7fb 100%);
    border-color: rgba(38, 38, 38, 0.24);
    box-shadow: 0 16px 32px rgba(38, 38, 38, 0.12);
}

.city-picker-card-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(38, 38, 38, 0.12) 0%, rgba(104, 44, 199, 0.16) 100%);
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.city-picker-card.is-active .city-picker-card-mark {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-violet) 100%);
    color: #ffffff;
}

.city-picker-card-name {
    font-size: 0.94rem;
    line-height: 1.25;
    font-weight: 600;
    color: #4b5363;
    text-align: center;
}

.city-picker-empty {
    padding: 28px 12px 10px;
    text-align: center;
    color: #7b8496;
    font-size: 0.96rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 16px;
    font-size: 14px;
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    height: 100%;
}

.search-input::placeholder {
    color: var(--muted);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    width: 36px;
    height: 36px;
    background: var(--brand-primary);
    border: none;
    border-radius: 50%;
    margin-right: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.search-btn:hover,
.search-btn:focus-visible {
    background: var(--brand-primary-dark);
    transform: scale(1.04);
    box-shadow: 0 8px 18px rgba(38, 38, 38, 0.18);
    outline: none;
}

.search-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: white;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-advisory {
    background: var(--brand-primary);
    color: var(--white);
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
}

.btn-advisory:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}
.supportemail{text-decoration: none; color: var(--brand-violet);}
.supportemail:hover{color:#333;}
.profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.profile-btn:hover {
    border-color: var(--brand-primary);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
}

.site-footer p,
.site-footer a {
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--ink);
}

.site-footer .footer-links {
    display: flex;
    gap: 16px;
}

.compare-bucket {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1004;
}

.compare-bucket-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 0 20px;
    border-radius: 9999px;
    background: var(--brand-primary);
    box-shadow: 0 18px 34px rgba(38, 38, 38, 0.22);
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.compare-bucket-button:hover,
.compare-bucket-button:focus-visible {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 22px 38px rgba(38, 38, 38, 0.28);
    outline: none;
}

.compare-bucket-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.compare-toast {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 1005;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 18px 34px rgba(15, 27, 45, 0.14);
    background: #111827;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.45;
}

.compare-toast[data-tone="success"] {
    background: linear-gradient(135deg, #118a53 0%, #0b9d68 100%);
}

.compare-toast[data-tone="warning"] {
    background: #262626;
}

[x-cloak] {
    display: none !important;
}

/* Autocomplete Styles */
.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}
.ac-group {
    padding: 8px 0;
}
.ac-group:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}
.ac-group-title {
    padding: 4px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ac-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #1e293b;
    text-decoration: none;
    transition: background-color 0.2s;
}
.ac-item:hover {
    background-color: #f8fafc;
}
.ac-icon {
    margin-right: 12px;
    font-size: 1.25rem;
    color: #64748b;
}
.ac-text {
    font-size: 0.875rem;
}
.ac-text strong {
    color: #c9952a; /* brand gold */
    font-weight: 600;
}
.ac-no-results {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

@media (max-width: 900px) {
    .site-header {
        flex-wrap: wrap;
        height: auto;
        padding: 16px;
    }

    .header-search-wrap {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .city-picker-trigger {
        min-width: 118px;
    }

    .city-picker-overlay {
        padding: 16px;
    }

    .city-picker-modal {
        width: min(680px, calc(100vw - 32px));
    }

    .site-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding-bottom: 120px;
    }
    .site-footer .footer-links{display: block; width: 100%;}
   .site-footer p, .site-footer a{display: block; padding: 8px; margin-bottom: 16px;}
    .compare-bucket {
        left: 16px;
        right: 16px;
        bottom: 72px;
    }

    .compare-bucket-button {
        justify-content: center;
        min-height: 50px;
    }

    .compare-toast {
        left: 16px;
        right: 16px;
        bottom: 88px;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .site-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .header-logo {
        min-width: 0;
        grid-column: 1;
        grid-row: 1;
    }



    .header-mobile-search-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: 1.5px solid var(--border);
        background: var(--surface);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--brand-primary);
        transition: border-color 0.18s ease, background 0.18s ease;
        grid-column: 2;
        grid-row: 1;
    }

    .header-mobile-search-btn:hover,
    .header-mobile-search-btn:focus-visible {
        border-color: var(--brand-primary);
        background: #fff;
        outline: none;
    }

    .header-mobile-search-btn svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.4;
        stroke-linecap: round;
    }

    .header-actions {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .btn-advisory {
        display: none;
    }

    .header-search-wrap {
        order: initial;
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: none;
        margin: 0;
        display: none;
    }

    .site-header.is-mobile-search-open .header-search-wrap {
        display: block;
    }

    .header-search {
        height: 46px;
        flex-wrap: nowrap;
        border-radius: 18px;
        padding: 4px 4px 4px 10px;
        gap: 6px;
    }

    .header-search-city,
    .city-picker {
        display: none;
    }

    .search-input-wrapper {
        min-width: 0;
        flex: 1 1 auto;
    }

    .search-input {
        padding: 0 8px;
        font-size: 14px;
    }

    .header-mobile-search-close {
        width: 34px;
        height: 34px;
        border: none;
        background: transparent;
        color: #7b8496;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        flex-shrink: 0;
    }

    .search-btn {
        margin-right: 0;
    }

    .city-picker-overlay {
        padding: 12px;
    }

    .city-picker-modal {
        width: calc(100vw - 24px);
    }

    .city-picker-modal-head {
        padding: 16px 16px 0;
    }

    .city-picker-modal-body {
        padding: 16px;
    }

    .city-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
