/* CayMark global UI kit — Section 1: Feedback & Notifications */

/* ─── Toasts ─── */
#caymark-toast-host {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
}

.caymark-toast {
    pointer-events: auto;
    position: relative;
    width: 100%;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 2.75rem 1rem 1rem;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    transform: translateX(110%);
    opacity: 0;
    animation: caymarkToastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    touch-action: pan-y;
}

.caymark-toast.is-leaving {
    animation: caymarkToastOut 0.32s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.caymark-toast.is-swiping {
    animation: none;
    transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}

.caymark-toast--success {
    background: #e6f4ea;
    border: 1px solid #ceead6;
}

.caymark-toast--error {
    background: #fdecea;
    border: 1px solid #fad4cf;
}

.caymark-toast__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.caymark-toast--success .caymark-toast__icon { background: #34a853; }
.caymark-toast--error .caymark-toast__icon { background: #e8714a; }

.caymark-toast__icon svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #fff;
}

.caymark-toast__body { flex: 1; min-width: 0; padding-top: 0.125rem; }

.caymark-toast__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    margin: 0;
}

.caymark-toast__subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.45;
    margin: 0.25rem 0 0;
}

.caymark-toast__subtitle:empty { display: none; }

.caymark-toast__close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.caymark-toast__close:hover {
    color: #4b5563;
    background: rgba(0, 0, 0, 0.05);
}

@keyframes caymarkToastIn {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes caymarkToastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(110%); opacity: 0; }
}

/* ─── Skeleton loaders ─── */
@keyframes cm-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.cm-skeleton {
    background: linear-gradient(90deg, #e8ecf1 25%, #f4f6f8 50%, #e8ecf1 75%);
    background-size: 200% 100%;
    animation: cm-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}

.cm-skeleton-block { display: block; width: 100%; }

.cm-skeleton-auction-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .cm-skeleton-auction-card--row {
        flex-direction: row;
    }
    .cm-skeleton-auction-card--row .cm-skeleton-auction-card__media {
        width: 40%;
        min-height: 250px;
    }
}

.cm-skeleton-auction-card__media {
    min-height: 200px;
    border-radius: 0;
}

.cm-skeleton-auction-card__body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cm-skeleton-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .cm-skeleton-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .cm-skeleton-grid--cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cm-skeleton-table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.cm-skeleton-profile {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cm-skeleton-profile__avatar {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.cm-skeleton-profile__lines {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cm-skeleton-host[data-cm-loading="1"] > [data-cm-content] {
    display: none !important;
}

.cm-skeleton-host[data-cm-loading="1"] > [data-cm-skeleton] {
    display: block !important;
}

.cm-skeleton-host > [data-cm-skeleton] {
    display: none;
}

/* ─── Empty states ─── */
.cm-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 28rem;
    margin: 0 auto;
}

.cm-empty-state__icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #063466;
}

.cm-empty-state__icon svg,
.cm-empty-state__icon .material-icons-round {
    font-size: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.cm-empty-state__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
}

.cm-empty-state__desc {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}

.cm-empty-state__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    background: #063466;
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.cm-empty-state__cta:hover {
    background: #052a52;
    color: #fff;
}

/* ─── Confirm dialog ─── */
.cm-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cm-confirm-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.cm-confirm-dialog {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 100%;
    padding: 1.5rem;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.cm-confirm-overlay.is-open .cm-confirm-dialog {
    transform: scale(1) translateY(0);
}

.cm-confirm-dialog__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
}

.cm-confirm-dialog__desc {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}

.cm-confirm-dialog__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cm-confirm-dialog__btn {
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.cm-confirm-dialog__btn--cancel {
    background: #f1f5f9;
    color: #475569;
}

.cm-confirm-dialog__btn--cancel:hover { background: #e2e8f0; }

.cm-confirm-dialog__btn--confirm {
    background: #063466;
    color: #fff;
}

.cm-confirm-dialog__btn--confirm:hover { background: #052a52; }

.cm-confirm-dialog__btn--danger {
    background: #dc2626;
    color: #fff;
}

.cm-confirm-dialog__btn--danger:hover { background: #b91c1c; }

/* ─── Progress steps ─── */
.cm-progress-steps {
    width: 100%;
    margin-bottom: 1.5rem;
}

.cm-progress-steps__labels {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cm-progress-steps__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.cm-progress-steps__label.is-active {
    color: #063466;
    font-weight: 700;
}

.cm-progress-steps__label.is-done {
    color: #34a853;
}

.cm-progress-steps__track {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.cm-progress-steps__fill {
    height: 100%;
    background: linear-gradient(90deg, #063466, #2563eb);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.cm-progress-steps__meta {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
}

@media (max-width: 480px) {
    #caymark-toast-host {
        left: 1rem;
        right: 1rem;
        align-items: stretch;
    }
    .caymark-toast {
        min-width: 0;
        max-width: none;
    }
}

/* ─── Section 2: Forms & Input ─── */

.cm-field-error {
    font-size: 0.8125rem;
    color: #dc2626;
    margin: 0.375rem 0 0;
    line-height: 1.4;
}

.cm-field-invalid,
.cm-field-invalid:focus {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.cm-field-wrap {
    position: relative;
}

.cm-password-wrap {
    position: relative;
    display: block;
}

.cm-password-wrap input[type="password"],
.cm-password-wrap input[type="text"] {
    padding-right: 2.75rem !important;
}

.cm-password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 0;
    border-radius: 6px;
    z-index: 2;
}

.cm-password-toggle:hover {
    color: #4b5563;
    background: rgba(0, 0, 0, 0.04);
}

.cm-password-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    display: block;
}

.cm-password-strength {
    margin-top: 0.5rem;
}

.cm-password-strength__bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.cm-password-strength__fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.25s ease, background 0.25s ease;
}

.cm-password-strength__fill--weak { background: #dc2626; }
.cm-password-strength__fill--fair { background: #f59e0b; }
.cm-password-strength__fill--strong { background: #22c55e; }

.cm-password-strength__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.cm-password-strength__label--weak { color: #dc2626; }
.cm-password-strength__label--fair { color: #d97706; }
.cm-password-strength__label--strong { color: #16a34a; }

.cm-char-counter {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.35rem;
}

.cm-char-counter.is-near-limit {
    color: #d97706;
}

.cm-char-counter.is-at-limit {
    color: #dc2626;
    font-weight: 600;
}

.cm-textarea-wrap {
    position: relative;
}

.cm-textarea-wrap textarea {
    padding-bottom: 1.75rem;
}

.cm-textarea-wrap .cm-char-counter {
    position: absolute;
    right: 0.75rem;
    bottom: 0.5rem;
    margin: 0;
    pointer-events: none;
    background: linear-gradient(to left, #fff 60%, transparent);
    padding-left: 0.5rem;
}

/* ─── Section 3: Navigation & layout ─── */

/* Breadcrumbs */
.cm-breadcrumbs {
    padding: 0.75rem 0 0.25rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.cm-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cm-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748b;
}

.cm-breadcrumbs__link {
    color: #1e3a8a;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cm-breadcrumbs__link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.cm-breadcrumbs__current {
    color: #334155;
    font-weight: 600;
}

.cm-breadcrumbs__sep {
    color: #cbd5e1;
    user-select: none;
}

/* Public nav active state */
.cm-nav-link {
    position: relative;
    display: inline-block;
    padding: 0.75rem 0.5rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cm-nav-link:hover {
    color: #2563eb;
}

.cm-nav-link--active,
.cm-nav-link[aria-current="page"] {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
}

/* Sticky header scroll shadow */
.cm-site-header {
    transition: box-shadow 0.25s ease;
}

.cm-site-header.cm-header--scrolled {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Back to top */
.cm-back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.35);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
}

.cm-back-to-top:hover {
    box-shadow: 0 10px 28px rgba(30, 58, 138, 0.45);
}

.cm-back-to-top:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

.cm-back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .cm-back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* Branded 404 */
.cm-error-404 {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
}

.cm-error-404__code {
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #0a2258 0%, #1e3a8a 50%, #d4af37 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.cm-error-404__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0a2258;
    margin: 0 0 0.75rem;
}

.cm-error-404__desc {
    color: #64748b;
    max-width: 28rem;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.cm-error-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.cm-error-404__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cm-error-404__btn--primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.cm-error-404__btn--primary:hover {
    transform: translateY(-1px);
}

.cm-error-404__btn--secondary {
    background: #fff;
    color: #1e3a8a;
    border: 2px solid #d4af37;
}

.cm-error-404__search {
    width: 100%;
    max-width: 24rem;
}

.cm-error-404__search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.9375rem;
}

.cm-error-404__search input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ─── Section 4: Auction-specific UI ─── */

/* ── Live countdown — grid variant ─────────────────────────────── */
.cm-countdown--grid {
    display: block;
    width: 100%;
    background: rgba(0, 18, 50, 0.90);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(200, 168, 75, 0.22);
    padding: 7px 12px;
    color: #fff;
}

.cm-countdown--grid .cm-countdown__inner {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cm-countdown--grid .cm-countdown__icon {
    color: rgba(200, 168, 75, 0.75);
    flex-shrink: 0;
}

.cm-countdown--grid .cm-countdown__ends-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.42);
    flex-shrink: 0;
    white-space: nowrap;
}

.cm-countdown--grid .cm-countdown__blocks {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
}

.cm-countdown--grid .cm-countdown__block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 26px;
}

.cm-countdown--grid .cm-countdown__num {
    font-family: ui-monospace, 'Roboto Mono', 'Courier New', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #C8A84B;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.cm-countdown--grid .cm-countdown__lbl {
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.32);
    line-height: 1;
    margin-top: 2.5px;
}

.cm-countdown--grid .cm-countdown__sep {
    color: rgba(200, 168, 75, 0.38);
    font-size: 10px;
    font-weight: 300;
    align-self: flex-end;
    margin-bottom: 9px;
    line-height: 1;
}

/* Urgent state (< 1 hour) */
.cm-countdown--grid.cm-countdown--urgent {
    background: rgba(100, 20, 20, 0.90) !important;
    border-top-color: rgba(252, 165, 165, 0.22) !important;
}
.cm-countdown--grid.cm-countdown--urgent .cm-countdown__num {
    color: #fca5a5;
}
.cm-countdown--grid.cm-countdown--urgent .cm-countdown__icon {
    color: rgba(252, 165, 165, 0.65);
}
.cm-countdown--grid.cm-countdown--urgent .cm-countdown__sep {
    color: rgba(252, 165, 165, 0.38);
}

/* Ended badge */
.cm-countdown-ended--grid {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.60);
    padding: 7px 12px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* ── Countdown — detail variant ─────────────────────────────────── */
.cm-countdown--detail {
    background: linear-gradient(135deg, #001840 0%, #002452 100%);
    color: #fff;
    padding: 1.25rem;
    border-radius: 0.75rem;
    text-align: center;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(200, 168, 75, 0.20);
}

.cm-countdown--detail.cm-countdown--urgent {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
    border-color: rgba(252, 165, 165, 0.25) !important;
}

.cm-countdown--detail.cm-countdown--ended {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

.cm-countdown__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(200, 168, 75, 0.80);
    margin-bottom: 0.25rem;
}

.cm-countdown__display {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, 'Roboto Mono', 'Courier New', monospace;
    margin: 0.5rem 0;
    letter-spacing: 0.04em;
}

/* Outbid banner */
.cm-outbid-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #f87171;
    border-radius: 0.75rem;
    color: #991b1b;
}

.cm-outbid-banner__icon {
    color: #dc2626;
    flex-shrink: 0;
}

.cm-outbid-banner__text {
    flex: 1;
    margin: 0;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.cm-outbid-banner__dismiss {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #991b1b;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cm-outbid-banner__dismiss:hover {
    background: rgba(220, 38, 38, 0.12);
}

/* Watchlist heart */
.cm-watchlist-heart--icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.cm-watchlist-heart--icon:hover {
    color: #ef4444;
}

.cm-watchlist-heart--icon.is-active,
.cm-watchlist-heart--icon.is-active .cm-watchlist-heart__icon {
    color: #ef4444;
}

.cm-watchlist-heart__icon {
    font-size: 1.375rem;
}

.cm-watchlist-heart__count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
}

.cm-watchlist-heart.is-pop {
    animation: cm-watchlist-pop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cm-watchlist-heart.is-saving {
    opacity: 0.65;
    pointer-events: none;
}

@keyframes cm-watchlist-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Ending soon badge */
.cm-ending-soon-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

/* ─── Section 5: User Account Area ─── */

:root {
    --cm-navy: #0a1628;
    --cm-navy-mid: #1a365d;
    --cm-gold: #d4a017;
    --cm-gold-light: #f5d061;
}

/* Avatar */
.cm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--cm-avatar-size, 2.5rem);
    height: var(--cm-avatar-size, 2.5rem);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--cm-avatar-bg, var(--cm-navy));
    color: var(--cm-avatar-fg, var(--cm-gold-light));
    font-size: var(--cm-avatar-font, 0.8125rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 2px solid rgba(212, 160, 23, 0.35);
}

.cm-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cm-avatar__initials {
    line-height: 1;
}

/* Profile completion */
.cm-profile-completion {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.5rem;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid rgba(10, 22, 40, 0.08);
    box-shadow: 0 4px 20px rgba(10, 22, 40, 0.06);
}

.cm-profile-completion__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cm-profile-completion__title {
    margin: 0 0 0.25rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cm-navy);
}

.cm-profile-completion__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.cm-profile-completion__percent {
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cm-gold);
}

.cm-profile-completion__track {
    height: 0.5rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 0.875rem;
}

.cm-profile-completion__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cm-navy) 0%, var(--cm-gold) 100%);
    transition: width 0.35s ease;
}

.cm-profile-completion__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.375rem;
}

.cm-profile-completion__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cm-navy-mid);
    text-decoration: none;
    transition: color 0.15s ease;
}

.cm-profile-completion__link:hover {
    color: var(--cm-gold);
}

.cm-profile-completion__link .material-icons-round {
    font-size: 1.125rem;
}

.cm-profile-completion__link--static {
    cursor: default;
    opacity: 0.85;
}

/* Notification bell */
.cm-notification-bell {
    position: relative;
    display: inline-flex;
}

.cm-notification-bell__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.cm-notification-bell__trigger:hover,
.cm-notification-bell.is-open .cm-notification-bell__trigger {
    color: var(--cm-navy-mid);
    background: #f1f5f9;
}

.cm-notification-bell__trigger .material-icons-round {
    font-size: 1.5rem;
}

.cm-notification-bell__badge {
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.125rem;
    text-align: center;
}

.cm-notification-bell__panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 60;
    width: min(20rem, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.14);
    overflow: hidden;
}

.cm-notification-bell__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.cm-notification-bell__panel-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cm-navy);
}

.cm-notification-bell__panel-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #dc2626;
}

.cm-notification-bell__empty {
    margin: 0;
    padding: 1rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.cm-notification-bell__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 16rem;
    overflow-y: auto;
}

.cm-notification-bell__item {
    display: block;
    padding: 0.625rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s ease;
}

.cm-notification-bell__item:hover {
    background: #f8fafc;
}

.cm-notification-bell__item.is-unread {
    background: #eff6ff;
}

.cm-notification-bell__item-text {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
}

.cm-notification-bell__item-time {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.cm-notification-bell__view-all {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--cm-navy-mid);
    text-decoration: none;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.cm-notification-bell__view-all:hover {
    background: #eef2ff;
    color: var(--cm-gold);
}

/* Activity timeline */
.cm-activity-timeline {
    padding: 1.25rem 1.5rem;
    border-radius: 0.875rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(10, 22, 40, 0.05);
}

.cm-activity-timeline__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cm-activity-timeline__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cm-navy);
}

.cm-activity-timeline__head-icon {
    color: var(--cm-gold);
    font-size: 1.375rem;
}

.cm-activity-timeline__empty {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.cm-activity-timeline__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cm-activity-timeline__item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.cm-activity-timeline__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cm-activity-timeline__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cm-navy) 0%, var(--cm-navy-mid) 100%);
    color: var(--cm-gold-light);
}

.cm-activity-timeline__icon .material-icons-round {
    font-size: 1.125rem;
}

.cm-activity-timeline__body {
    flex: 1;
    min-width: 0;
}

.cm-activity-timeline__desc {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    text-decoration: none;
}

a.cm-activity-timeline__desc:hover {
    color: var(--cm-navy-mid);
}

.cm-activity-timeline__time {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ─── Section 6: Mobile-specific ─── */

/* Pull-to-refresh (inline indicator in host) */
.cm-pull-refresh-host,
.cm-pull-refresh-root {
    position: relative;
}

.cm-pull-refresh-host--pulling,
.cm-pull-refresh-host--refreshing {
    transition: transform 0.2s ease;
}

.cm-pull-refresh {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    transform: translate(-50%, calc(-100% + var(--cm-pull-offset, 0px)));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    color: var(--cm-navy-mid, #1a365d);
    font-size: 0.75rem;
    font-weight: 600;
}

.cm-pull-refresh--active { opacity: 1; }
.cm-pull-refresh--ready .cm-pull-refresh__label { color: var(--cm-gold, #d4a017); }

.cm-pull-refresh__spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #cbd5e1;
    border-top-color: var(--cm-navy-mid, #1a365d);
    border-radius: 50%;
    flex-shrink: 0;
}

.cm-pull-refresh--loading .cm-pull-refresh__spinner {
    animation: cm-pull-spin 0.7s linear infinite;
}

/* Pull to refresh (fixed top indicator — legacy) */
.cm-pull-refresh-root {
    position: relative;
}

.cm-pull-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 99980;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-left: -50%;
    transform: translateY(-120%);
    background: rgba(10, 22, 40, 0.92);
    color: var(--cm-gold-light, #f5d061);
    border-radius: 0 0 12px 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(10, 22, 40, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cm-pull-refresh-indicator.is-pulling,
.cm-pull-refresh-indicator.is-refreshing {
    opacity: 1;
}

.cm-pull-refresh-indicator.is-ready .cm-pull-refresh-indicator__text::after {
    content: ' — release';
}

.cm-pull-refresh-indicator__spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(245, 208, 97, 0.35);
    border-top-color: var(--cm-gold, #d4a017);
    border-radius: 50%;
}

.cm-pull-refresh-indicator.is-refreshing .cm-pull-refresh-indicator__spinner {
    animation: cm-pull-spin 0.7s linear infinite;
}

@keyframes cm-pull-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .cm-pull-refresh-indicator.is-refreshing .cm-pull-refresh-indicator__spinner {
        animation: none;
        border-top-color: var(--cm-gold-light, #f5d061);
    }
}

/* Filter bottom sheet */
.cm-bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 99995;
    pointer-events: none;
    visibility: hidden;
}

.cm-bottom-sheet.is-open,
.cm-bottom-sheet--open {
    pointer-events: auto;
    visibility: visible;
}

.cm-bottom-sheet__backdrop,
.cm-bottom-sheet__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, 0.45);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cm-bottom-sheet.is-open .cm-bottom-sheet__backdrop,
.cm-bottom-sheet--open .cm-bottom-sheet__overlay {
    opacity: 1;
}

.cm-bottom-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(10, 22, 40, 0.18);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.cm-bottom-sheet.is-open .cm-bottom-sheet__panel,
.cm-bottom-sheet--open .cm-bottom-sheet__panel {
    transform: translateY(0);
}

.cm-bottom-sheet__panel.is-dragging {
    transition: none;
}

.cm-bottom-sheet__handle {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 0.75rem 0 0.25rem;
    cursor: grab;
    touch-action: none;
}

.cm-bottom-sheet__handle-bar {
    width: 2.5rem;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
}

.cm-bottom-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1.25rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.cm-bottom-sheet__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--cm-navy, #0a1628);
}

.cm-bottom-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
}

.cm-bottom-sheet__close:hover {
    background: #e2e8f0;
}

.cm-bottom-sheet__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem 1.5rem;
}

body.cm-sheet-open {
    overflow: hidden;
}

/* Vehicle finder inside bottom sheet (no sticky sidebar) */
.vehicle-finder--sheet {
    position: static;
    top: auto;
    max-height: none;
    display: block;
}

.vehicle-finder--sheet .vehicle-finder-body {
    padding: 0;
    overflow: visible;
}

.cm-bottom-sheet__footer {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.cm-bottom-sheet__btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.cm-bottom-sheet__btn--ghost {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.cm-bottom-sheet__btn--primary {
    background: linear-gradient(135deg, var(--cm-navy, #0a1628) 0%, var(--cm-navy-mid, #1a365d) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(10, 22, 40, 0.2);
}

.cm-bottom-sheet__handle::after {
    content: '';
    display: block;
    width: 2.5rem;
    height: 4px;
    margin: 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
}

/* Mobile filters trigger (auction) */
.cm-mobile-filters-btn {
    position: fixed;
    left: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 99988;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cm-navy, #0a1628) 0%, var(--cm-navy-mid, #1a365d) 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(10, 22, 40, 0.35);
    cursor: pointer;
}

.cm-mobile-filters-btn .material-icons {
    font-size: 1.125rem;
}

.cm-mobile-filters-btn:hover {
    box-shadow: 0 8px 24px rgba(10, 22, 40, 0.4);
}

@media (min-width: 1280px) {
    .cm-mobile-filters-btn {
        display: none !important;
    }
}

/* FAB — Post a Listing */
.cm-fab-post-listing {
    position: fixed;
    right: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 99989;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--cm-navy, #0a1628) 0%, var(--cm-navy-mid, #1a365d) 100%);
    color: var(--cm-gold-light, #f5d061);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(10, 22, 40, 0.4), inset 0 1px 0 rgba(212, 160, 23, 0.25);
    border: 1px solid rgba(212, 160, 23, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cm-fab-post-listing:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(10, 22, 40, 0.45);
}

.cm-fab-post-listing__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.2);
    font-size: 1.25rem !important;
}

@media (max-width: 380px) {
    .cm-fab-post-listing__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .cm-fab-post-listing {
        padding: 0.875rem;
        border-radius: 50%;
    }
}

@media (min-width: 1280px) {
    .cm-fab-post-listing {
        display: none !important;
    }
}

@media (max-width: 1279px) {
    .cm-back-to-top {
        bottom: 1rem;
    }

    body:has(.cm-fab-post-listing) .cm-back-to-top {
        bottom: 5.5rem;
    }

    body:has(.cm-mobile-filters-btn) .cm-back-to-top {
        right: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cm-bottom-sheet__panel,
    .cm-bottom-sheet__backdrop,
    .cm-fab-post-listing,
    .cm-pull-refresh-indicator {
        transition: none;
    }
}
