/* Integration states only. Layout and visual tokens come directly from demo CSS. */
[data-favorite] {
    cursor: pointer;
}

[data-favorite][aria-busy="true"] {
    opacity: .45;
    cursor: wait;
}

[data-favorite]:focus-visible {
    outline: 2px solid var(--kc-blue);
    outline-offset: 2px;
}

.kc-skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10001;
    transform: translateY(-200%);
    background: white;
    padding: 12px;
    border-radius: 8px;
}

.kc-skip-link:focus {
    transform: none;
}

[hidden] {
    display: none !important;
}

.search-card {
    color: inherit;
    text-decoration: none;
}

.search-card .kc-photo-ph {
    width: 100%;
    height: 100%;
}

.search-suggestions:not([hidden]) {
    display: block;
}

.search-suggestions button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-card);
    font: inherit;
    cursor: pointer;
}

.search-suggestions button:hover {
    background: var(--surface);
}

.search-suggestions button:focus {
    outline: none;
    background: var(--kc-blue-tint);
    box-shadow: inset 3px 0 0 var(--kc-blue);
}

.search-suggestions button:focus svg {
    stroke: var(--kc-blue);
}

.kc-filterfields .search-suggestions {
    position: static;
}

.kc-filterfields>.kc-label {
    margin-bottom: -12px;
}

.kc-filterfields .kc-row2>div {
    min-width: 0;
}

.kc-filterfields .kc-row2 .kc-label {
    display: block;
    margin-bottom: 8px;
}

.kc-filterfields #zip-label:empty,
#search-feedback:empty,
#search-warnings:empty {
    display: none;
}

.kc-filterfields #zip-label {
    font-size: 12px;
    color: var(--ink-soft);
}

#search-warnings:not(:empty) {
    padding: 12px;
    border-radius: 10px;
    background: #fff4df;
    margin: 12px 0;
}

#listings-app {
    position: relative;
}

#search-loading {
    position: fixed;
    z-index: 80;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    border-radius: 12px;
    color: white;
    background: var(--ink);
    box-shadow: var(--shadow-float);
}

.kc-preview-toast {
    position: fixed;
    z-index: 10000;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    width: max-content;
    padding: 12px 18px;
    border-radius: 12px;
    background: #162e3b;
    color: white;
    font-size: 13px;
    box-shadow: var(--shadow-float);
}

.kc-preview-note,
.kc-location-credit {
    font-size: 10px;
    color: var(--ink-faint);
    text-align: center;
}

.kc-preview-note {
    margin-top: 24px;
}

.page-content img {
    max-width: 100%;
    height: auto;
}

.page-content {
    overflow-wrap: anywhere;
}

.kc-intro {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink-soft);
    margin-bottom: 20px;
}

.kc-extra-sort .kc-label {
    display: block;
    margin-bottom: 8px;
}

@media (max-width: 1023px) {
    #filterSheet:not(.open) {
        visibility: hidden;
    }
}

.kc-auth-main,
[data-demo-preview] {
    display: contents;
}

.kc-auth-panel form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kc-account-dropdown {
    position: relative;
}

.kc-account-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.kc-account-dropdown summary::-webkit-details-marker {
    display: none;
}

.kc-account-links {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    z-index: 60;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-card);
    color: var(--ink);
    box-shadow: var(--shadow-float);
}

.kc-account-links a,
.kc-account-links button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    -webkit-text-fill-color: currentColor;
    border: 0;
    background: none;
    cursor: pointer;
    border-radius: 8px;
}

.kc-account-links a:hover,
.kc-account-links button:hover {
    background: var(--surface);
}

.kc-mobile-account .kc-account-links {
    top: auto;
    bottom: calc(100% + 16px);
    max-width: calc(100vw - 24px);
    max-height: 65dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.kc-account-links .kc-account-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    color: var(--kc-blue);
    min-height: 44px;
}

.kc-account-contact svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.kc-page-login .kc-login-options {
    justify-content: space-between;
    align-items: center;
}

.kc-login-options label {
    font-size: 12.5px;
    color: var(--ink-soft);
}

.kc-location-button {
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.kc-scroll-locked {
    overflow: hidden !important;
}

@media (max-width: 1023px) {
    .kc-page-listings #filterSheet {
        position: fixed;
        inset: 0;
        padding: 0;
        align-items: flex-end;
        justify-content: center;
        z-index: 100;
    }

    .kc-page-listings #filterSheet .kc-sheet {
        width: 100%;
        max-width: none;
        max-height: 86vh;
        max-height: 86dvh;
        border-radius: 20px 20px 0 0;
    }

    #filterSheet .kc-sheet-handle {
        flex-shrink: 0;
        background: var(--ink-faint);
    }

    #filterSheet .kc-sheet-head,
    #filterSheet .kc-sheet-foot {
        flex-shrink: 0;
    }

    #filterSheet .kc-sheet-body {
        min-height: 0;
        overscroll-behavior: contain;
    }

    #filterSheet .kc-sheet-head {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 8px;
        padding: 4px 18px 8px;
    }

    #filterSheet .kc-sheet-head button {
        min-height: 44px;
        padding: 8px;
    }

    #filterSheet [data-filter-close] {
        justify-self: end;
        min-width: 52px;
        border-radius: 8px;
        background: var(--kc-blue-tint);
    }

    #filterSheet h3 {
        font-weight: 700;
    }

    [data-desktop-apply] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kc-skeleton-block::after {
        animation: none;
    }
}

/* Keep mobile scrolling inside the app, including while the keyboard is open. */
@media (max-width: 1023px) {

    html,
    body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .kc-page {
        position: fixed;
        top: var(--kc-viewport-top, 0px);
        left: 0;
        width: 100%;
        height: var(--kc-viewport-height, 100dvh);
        min-height: 0;
        padding: 0;
        display: flex;
    }

    .kc-frame {
        width: 100%;
        height: 100%;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .kc-content {
        min-height: 0;
        overscroll-behavior-y: contain;
        scroll-padding-block: 16px;
    }

    .kc-page input,
    .kc-page select,
    .kc-page textarea {
        font-size: 16px !important;
    }

    .kc-keyboard-open .kc-bottomnav {
        display: none;
    }

    .kc-page-home .kc-hero-wrap {
        flex: 1 0 auto;
        overflow: visible;
    }

    .kc-page-home .kc-hero-deco {
        overflow: hidden;
    }


    .kc-page-listings #filterSheet {
        top: var(--kc-viewport-top, 0px);
        bottom: auto;
        height: var(--kc-viewport-height, 100dvh);
    }

    .kc-page-listings #filterSheet .kc-sheet {
        max-height: calc(var(--kc-viewport-height, 100dvh) - 20px);
    }
}

.search-suggestions {
    max-height: min(260px, 40vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.kc-page-home .search-suggestions {
    overflow-y: auto;
}

.kc-floating-suggestions {
    position: fixed !important;
    right: auto;
    bottom: auto;
    z-index: 200;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-card);
    box-shadow: var(--shadow-float);
}

.kc-floating-suggestions .kc-suggest-item {
    min-height: 44px;
}

.kc-autocomplete-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    color: var(--ink-soft);
    background: var(--surface-card);
    font-size: 13px;
    text-align: left;
}

.kc-autocomplete-spinner {
    flex: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--kc-blue);
    border-radius: 50%;
    animation: kc-autocomplete-spin .65s linear infinite;
}

.search-suggestions .kc-autocomplete-retry {
    color: var(--kc-blue);
    font-weight: 700;
}

@keyframes kc-autocomplete-spin {
    to {
        transform: rotate(360deg);
    }
}

.kc-year-manual {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.kc-year-manual .kc-input {
    flex: 1;
    min-width: 0;
    width: 0;
}

.kc-year-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    padding: 0;
    min-height: 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-field);
    background: var(--surface-card);
    color: var(--kc-blue);
    cursor: pointer;
}

.kc-year-back svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.kc-year-back:hover {
    background: var(--kc-blue-tint);
}

@media (prefers-reduced-motion: reduce) {
    .kc-autocomplete-spinner {
        animation: none;
    }
}

/* Year help remains inside the field width on narrow filter sheets. */
.kc-year-field {
    position: relative;
}

.kc-year-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12.5px;
    line-height: 1;
    height: 1em;
}

.kc-year-label .kc-label {
    margin: 0;
}

.kc-year-help {
    margin-left: auto;
    display: inline-flex;
}

.kc-year-help-toggle {
    position: relative;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--kc-blue);
    background: transparent;
    font: 700 10px/1 var(--font-body);
    cursor: help;
}

.kc-year-help-toggle::after {
    content: '';
    position: absolute;
    inset: -5px;
}

.kc-year-help-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 4px);
    z-index: 25;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: var(--surface-card);
    color: var(--ink);
    box-shadow: var(--shadow-float);
    font-size: 12px;
    line-height: 1.5;
}

#search-pagination {
    gap: 4px;
}

@media (max-width: 600px) {
    #search-pagination .kc-page-btn {
        min-width: 30px;
        height: 40px;
        padding: 0 5px;
        font-size: 12px;
    }

    #search-pagination .kc-page-ellipsis {
        padding: 0;
    }
}

#search-pagination .kc-page-ellipsis {
    min-width: 16px;
    color: var(--ink-soft);
    text-align: center;
    font-weight: 800;
}

/* Shared listing indicators remain consistent across server and AJAX cards. */
.kc-distance,
.kc-listing-meta .kc-distance {
    color: var(--kc-blue);
    font-weight: 600;
}

.kc-listing.is-viewed .kc-listing-viewed.kc-eye-toggle {
    display: flex;
    position: absolute;
    top: 12px;
    right: 13px;
    transform: none;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    color: var(--kc-blue);
    cursor: default;
}

.kc-distance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kc-distance svg {
    width: 12px;
    height: 12px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.kc-page-home .kc-locrow svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.saved-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 24px;
    min-height: 370px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-card);
}

.saved-empty-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 24px;
    color: var(--kc-blue);
    border-radius: 24px;
    background: var(--kc-blue-tint);
}

.saved-empty-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.saved-empty h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 23px;
    line-height: 1.4;
}

.saved-empty p {
    max-width: 460px;
    margin: 14px 0 24px;
    line-height: 1.75;
    color: var(--ink-soft);
}

.saved-empty .kc-btn {
    gap: 10px;
}

.saved-empty-note {
    margin-top: 20px;
    font-size: 12px;
    color: var(--ink-soft);
}

@media (max-width: 1023px) {
    .saved-empty {
        min-height: 350px;
        padding: 36px 20px;
    }

    .saved-empty h2 {
        font-size: 20px;
    }
}

.kc-page-coupon .kc-couponsearch {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 24px;
}

.kc-page-coupon .kc-couponsearch .kc-field {
    min-width: 0;
}

.kc-page-coupon .kc-coupon-grid>.saved-empty {
    grid-column: 1 / -1;
}

#coupon-results[aria-busy="true"] {
    display: none;
}

#coupon-loading[hidden] {
    display: none;
}

.coupon-skeleton-image {
    aspect-ratio: 16 / 10;
}

.coupon-skeleton-image,
.coupon-skeleton .kc-coupon-card-body>span {
    display: block;
    background: linear-gradient(90deg, #e8edf5 25%, #f5f7fb 50%, #e8edf5 75%);
    background-size: 200% 100%;
    animation: coupon-shimmer 1.5s linear infinite;
}

.coupon-skeleton .kc-coupon-card-body>span {
    height: 20px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.coupon-skeleton .kc-coupon-card-body>span:nth-child(even) {
    width: 65%;
}

@keyframes coupon-shimmer {
    to {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .coupon-skeleton-image,
    .coupon-skeleton .kc-coupon-card-body>span {
        animation: none;
    }
}

.public-page .page-content>h1 {
    margin-bottom: 20px;
}

.public-page-body {
    display: flow-root;
}

.public-page-body p {
    font-size: 13.5px;
    line-height: 1.65;
    /* color: var(--ink-soft); */
    margin: 0 0 10px;
}

.public-page-body p a {
    color: var(--kc-blue);
    text-decoration: underline;
}

.public-page-body p:last-child {
    margin-bottom: 0;
}

.public-page-body> :first-child {
    margin-top: 0;
}

.public-page-body ul {
    padding-left: 20px;
    margin: 0 0 10px;
    font-size: 13.5px;
    line-height: 1.65;
}

.public-page-body h2 {
    font-size: 17px;
}

.public-page-body blockquote {
    margin: 0 0 10px;
    padding: 4px 0 4px 14px;
    border-left: 3px solid #dde3ea;
}

.public-page-body hr {
    margin: 16px 0;
    border: 0;
    border-top: 1px solid #dde3ea;
}

.public-page-body h3 {
    font-size: 15px;
}

@media (max-width: 767px) {
    .kc-page-coupon .kc-couponsearch {
        grid-template-columns: 1fr;
    }
}

.kc-page-coupon .kc-coupon-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.kc-page-coupon .kc-coupon-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    flex: none;
}

.kc-page-coupon .kc-coupon-card-shop,
.kc-page-coupon .kc-coupon-card-offer {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kc-page-coupon .kc-coupon-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
    height: 4.65em;
    min-height: 4.65em;
    overflow-wrap: anywhere;
}

.coupon-code {
    display: block;
    align-self: start;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 6px 10px;
    border-radius: 7px;
    background: #eaf2ff;
    border: 1px dashed #8db5f8;
    color: #225da9;
    font-size: 13px;
    letter-spacing: .5px;
}

.kc-page-coupon .coupon-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--ink-soft);
}

.coupon-meta svg {
    width: 14px;
    height: 14px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.kc-page-coupon .coupon-meta.kc-distance {
    color: var(--kc-blue);
}

.kc-page-coupon .kc-coupon-card-expiry {
    margin-top: auto;
    padding: 7px 9px;
    border-radius: 6px;
    background: #fff2dd;
    color: #97440a;
    font-size: 12px;
    font-weight: 800;
}

.coupon-tabs {
    max-width: 480px;
    width: 100%;
    margin: 0 auto 4px;
}

.coupon-tabs span {
    margin-left: 5px;
    font-size: 11px;
    opacity: .8;
}

#coupon-detail {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 22px 80px #162b4940;
    width: min(600px, calc(100vw - 28px));
    padding: 0;
    max-height: 85dvh;
    overflow-y: auto;
}

#coupon-detail::backdrop {
    background: #15243c80;
}

#coupon-detail-content {
    overflow-wrap: anywhere;
}

.kc-page-coupon [role="tabpanel"][hidden] {
    display: none;
}

@media (max-width: 1023px) {
    .kc-page-coupon .kc-coupon-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .kc-page-coupon .kc-coupon-grid {
        grid-template-columns: 1fr;
    }
}

/* The two categories now share one full-width panel instead of demo columns. */
.kc-page-coupon #coupon-feedback:not([hidden])~#coupon-results,
.kc-page-coupon #coupon-feedback:not([hidden])+#coupon-loading {
    margin-top: 20px;
}

.kc-page-coupon #coupon-results {
    grid-template-columns: minmax(0, 1fr);
}

.kc-page-coupon .kc-coupon-grid {
    grid-auto-rows: 1fr;
}

.coupon-tabs button:focus-visible {
    outline: 2px solid var(--kc-blue);
    outline-offset: 2px;
}

/* Additional card specifications stay desktop-only, except in related listings. */
.kc-listing-specs {
    flex-wrap: wrap;
}

.kc-listing-specs span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1023px) {
    .kc-listing-specs .kc-spec-extra {
        display: none;
    }

    #car-related-items .kc-listing-specs .kc-spec-extra {
        display: inline-block;
    }
}

@media (min-width: 1024px) {

    .kc-page-listings .kc-eye-toggle svg,
    .kc-page-listings .kc-listing.is-viewed .kc-listing-viewed.kc-eye-toggle {
        width: 32px;
        height: 32px;
    }
}

/* Home uses a quiet search-first layout; blue text stays inside the hero so the header and footer match other pages. */
.kc-page-home,
.kc-page-home .kc-frame,
.kc-page-home .kc-content {
    background: var(--surface-card);
}

.kc-page-home .kc-hero-wrap {
    /* --home-ink: #2455a4; */
    --home-ink: var(--kc-blue);
    --ink: var(--home-ink);
    --ink-soft: var(--home-ink);
    --ink-faint: var(--home-ink);
    color: var(--home-ink);
    background: var(--surface-card);
    justify-content: center;
    /* Side padding offsets the shared content gutter so the search bar keeps its width. */
    padding: 88px 4px 48px;
    min-height: 65svh;
}

.kc-page-home .kc-hero-inner {
    max-width: 640px;
    align-items: center;
    text-align: center;
    gap: 24px;
}

.kc-page-home .kc-hero-inner .kc-home-brand {
    color: var(--home-ink);
    font-size: clamp(44px, 8vw, 76px);
    line-height: 1.15;
    margin: 0;
}

.kc-page-home .kc-home-brand span {
    color: var(--kc-blue);
}

.kc-page-home .kc-locrow,
.kc-page-home .kc-location-button {
    /* color: var(--home-ink); */
    text-shadow: none;
}

.kc-page-home .kc-locrow,
.kc-page-home .kc-hero-inner .kc-sub {
    color: var(--home-ink);
}

.kc-page-home .kc-searchbar {
    border: 1px solid currentColor;
    box-shadow: var(--shadow-card);
}

.kc-page-home .kc-searchbar input {
    font-size: 16px;
    /* color: var(--home-ink); */
}

.kc-page-home .kc-searchbar input::placeholder {
    color: var(--home-ink);
    opacity: .75;
}

/* .kc-page-home .kc-searchbar button {
    background: var(--kc-blue-tint);
    color: var(--home-ink);
}
.kc-page-home .kc-searchbar button svg {
    stroke: currentColor;
} */
.kc-page-home .kc-locrow {
    flex-wrap: wrap;
    justify-content: center;
}

.kc-page-home .kc-hero-stats,
.kc-page-home #search-feedback:empty {
    display: none;
}

@media (min-width: 1024px) {
    .kc-page-home .kc-hero-wrap {
        /* Subtract the shared content padding and footer gap so the hero stays where it was. */
        min-height: calc(100vh - 294px);
        padding: 64px 24px;
    }
}
