/* =========================================================================
   ToyotaLand — cars: archive, filters, list, single, categories
   ========================================================================= */

/* Archive layout */
.tl-shop { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 26px; align-items: start; }
.tl-shop__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 10px 12px; border-radius: 16px; background: var(--tl-soft); }
.tl-shop__filter-btn { display: none; }
.tl-shop__count { margin: 0; font-size: 14px; color: var(--tl-muted); }
.tl-shop__count strong { color: var(--tl-ink); font-size: 16px; }
.tl-shop__sort { margin-inline-start: auto; }
.tl-shop__sort select { min-height: 40px; padding: 0 14px; padding-inline-end: 36px; border: 1px solid var(--tl-line); border-radius: 12px; background: #fff; appearance: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.tl-view-toggle { display: flex; gap: 4px; padding: 3px; background: #fff; border-radius: 12px; border: 1px solid var(--tl-line); }
.tl-view-toggle a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--tl-muted); }
.tl-view-toggle a.is-active { background: var(--tl-ink); color: #fff; }
.tl-cars-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Filters */
.tl-filters { position: sticky; top: calc(var(--tl-header-h) + 16px); }
.tl-filters__backdrop { display: none; }
.tl-filters__panel { background: #fff; border: 1px solid var(--tl-line); border-radius: 22px; padding: 20px; max-height: calc(100vh - var(--tl-header-h) - 32px); overflow-y: auto; scrollbar-width: thin; }
.tl-filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tl-filters__head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0; }
.tl-filters__head .tl-icon-btn { display: none; }
.tl-filter { border: 0; margin: 0; padding: 16px 0; border-bottom: 1px solid var(--tl-line); min-width: 0; }
.tl-filter:last-of-type { border-bottom: 0; }
.tl-filter__title { display: block; padding: 0; font-size: 13px; font-weight: 800; color: var(--tl-ink); margin-bottom: 10px; }
.tl-filter__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-filter .tl-input { min-height: 42px; font-size: 13px; }
.tl-filters__actions { display: grid; gap: 8px; padding-top: 16px; position: sticky; bottom: -20px; background: #fff; padding-bottom: 4px; }

/* List view */
.tl-cars-list { display: grid; gap: 14px; }
.tl-car-row { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 18px; align-items: stretch; padding: 10px; background: #fff; border: 1px solid var(--tl-line); border-radius: 18px; transition: box-shadow .3s, border-color .3s; }
.tl-car-row:hover { box-shadow: var(--tl-shadow); border-color: transparent; }
.tl-car-row__media { position: relative; border-radius: 12px; overflow: hidden; background: var(--tl-soft); aspect-ratio: 4 / 3; }
.tl-car-row__media img { width: 100%; height: 100%; object-fit: cover; }
.tl-car-row__media .tl-ph { position: absolute; inset: 0; }
.tl-car-row__body { padding: 8px 0; display: flex; flex-direction: column; gap: 12px; }
.tl-car-row__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-specs-mini { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
.tl-specs-mini li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--tl-muted); min-width: 0; }
.tl-specs-mini li b { color: var(--tl-ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-specs-mini .tl-icon { color: var(--tl-primary); }
.tl-car-row__side { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 14px; border-radius: 14px; background: var(--tl-soft-2); }
.tl-car-row__price-label { font-size: 12px; color: var(--tl-muted); }
.tl-car-row__price { font-size: 17px; color: var(--tl-ink); font-weight: 900; }
.tl-car-row__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tl-car-row__actions .tl-btn { flex: 1; }
.tl-car-row__actions .tl-fav { width: 38px; height: 38px; }
.tl-car-row.is-sold img { filter: grayscale(.8); }

/* Shop list (table) page */
.tl-listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 10px 12px; background: var(--tl-soft); border-radius: 16px; }
.tl-listbar__side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-listbar select { min-height: 38px; padding: 0 14px; padding-inline-end: 34px; border: 1px solid var(--tl-line); border-radius: 12px; background: #fff; appearance: none; font-size: 13px; }
.tl-table-wrap { overflow-x: auto; border: 1px solid var(--tl-line); border-radius: 20px; background: #fff; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.tl-table th { position: sticky; top: 0; background: var(--tl-soft-2); text-align: start; padding: 14px 16px; font-weight: 800; color: var(--tl-ink); font-size: 12px; border-bottom: 1px solid var(--tl-line); white-space: nowrap; }
.tl-table td { padding: 12px 16px; border-bottom: 1px solid var(--tl-line); vertical-align: middle; }
.tl-table tr:last-child td { border-bottom: 0; }
.tl-table tbody tr { transition: background .2s; }
.tl-table tbody tr:hover { background: #fffafa; }
.tl-table tr.is-sold { opacity: .6; }
.tl-table__car { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.tl-table__car strong { display: block; color: var(--tl-ink); font-size: 14px; }
.tl-table__car small { color: var(--tl-muted); }
.tl-table__thumb { flex-shrink: 0; width: 76px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--tl-soft); position: relative; }
.tl-table__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-table__thumb .tl-ph { position: absolute; inset: 0; min-height: 0; }
.tl-table__thumb .tl-ph svg { width: 24px; height: 24px; }
.tl-table__price { font-weight: 900; color: var(--tl-ink); white-space: nowrap; }
.tl-table__act { white-space: nowrap; }
.tl-table__act .tl-fav { width: 38px; height: 38px; display: inline-grid; vertical-align: middle; margin-inline-start: 6px; }

/* Single car */
.tl-single { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.tl-gallery { position: sticky; top: calc(var(--tl-header-h) + 16px); }
.tl-gallery__main { position: relative; aspect-ratio: 16 / 11; border-radius: 22px; overflow: hidden; background: var(--tl-soft); }
.tl-gallery__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .45s var(--tl-ease); cursor: zoom-in; }
.tl-gallery__slide.is-active { opacity: 1; visibility: visible; }
.tl-gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.tl-gallery__empty { display: grid; place-items: center; cursor: default; }
.tl-gallery__empty .tl-car-svg { width: 60%; color: #2b2b2e; }
.tl-gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--tl-ink); display: grid; place-items: center; box-shadow: var(--tl-shadow-sm); transition: background .2s, color .2s; }
.tl-gallery__nav:hover { background: var(--tl-primary); color: #fff; }
.tl-gallery__nav.is-prev { inset-inline-start: 16px; }
.tl-gallery__nav.is-next { inset-inline-end: 16px; }
.tl-gallery__count { position: absolute; bottom: 16px; inset-inline-start: 16px; z-index: 3; padding: 4px 12px; border-radius: 20px; background: rgba(15,15,18,.6); color: #fff; font-size: 12px; backdrop-filter: blur(4px); }
.tl-gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tl-gallery__thumb { flex: 0 0 96px; height: 70px; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--tl-soft); opacity: .7; transition: all .2s; }
.tl-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tl-gallery__thumb.is-active, .tl-gallery__thumb:hover { opacity: 1; border-color: var(--tl-primary); }

.tl-summary__card { background: #fff; border: 1px solid var(--tl-line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.tl-summary__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-summary__icons { display: flex; gap: 6px; margin-inline-start: auto; }
.tl-summary__icons .tl-fav, .tl-summary__icons .tl-icon-btn { width: 40px; height: 40px; }
.tl-summary__title { font-size: clamp(20px, 2.3vw, 26px); margin: 0; }
.tl-summary__excerpt { margin: 0; color: var(--tl-muted); font-size: 14px; }
.tl-summary__price { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 18px; background: var(--tl-soft); }
.tl-summary__price > span { color: var(--tl-muted); font-size: 13px; }
.tl-summary__price div { display: flex; flex-direction: column; align-items: flex-end; }
.tl-summary__price del { color: var(--tl-subtle); font-size: 13px; }
.tl-summary__price strong { font-size: clamp(20px, 2.2vw, 24px); color: var(--tl-ink); font-weight: 900; }
.tl-keyspecs { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tl-keyspecs li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--tl-line); min-width: 0; }
.tl-keyspecs .tl-icon { color: var(--tl-primary); margin-bottom: 4px; }
.tl-keyspecs span { font-size: 11px; color: var(--tl-muted); }
.tl-keyspecs strong { font-size: 13px; color: var(--tl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tl-summary__cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-summary__cta .tl-btn--lg { grid-column: span 1; }
.tl-summary__cta .tl-btn--lg:only-of-type { grid-column: 1 / -1; }
.tl-summary__cta > .tl-btn:nth-child(3):last-child { grid-column: 1 / -1; }
.tl-trust { list-style: none; display: grid; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--tl-line-strong); }
.tl-trust li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tl-text); }
.tl-trust .tl-icon { color: var(--tl-success); }

.tl-anchors { position: sticky; top: var(--tl-header-h); z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-block: 1px solid var(--tl-line); margin-top: 6px; }
.admin-bar .tl-anchors { top: calc(var(--tl-header-h) + 32px); }
.tl-anchors .tl-container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tl-anchors a { position: relative; padding: 14px 14px; font-size: 14px; font-weight: 700; color: var(--tl-muted); white-space: nowrap; }
.tl-anchors a::after { content: ""; position: absolute; bottom: -1px; inset-inline: 14px; height: 3px; border-radius: 3px 3px 0 0; background: var(--tl-primary); transform: scaleX(0); transition: transform .25s; }
.tl-anchors a.is-active { color: var(--tl-ink); }
.tl-anchors a.is-active::after, .tl-anchors a:hover::after { transform: scaleX(1); }

.tl-single-body { display: grid; gap: 22px; padding-block: 28px 10px; }
.tl-block { background: #fff; border: 1px solid var(--tl-line); border-radius: 24px; padding: 28px; scroll-margin-top: calc(var(--tl-header-h) + 70px); }
.tl-block--soft { background: var(--tl-soft); border-color: transparent; }
.tl-block__title { font-size: 19px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.tl-block__title::before { content: ""; width: 6px; height: 22px; border-radius: 4px; background: var(--tl-primary); }
.tl-block__sub { margin: -10px 0 22px; color: var(--tl-muted); font-size: 13px; }
.tl-spec-table { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.tl-spec-table > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--tl-line); font-size: 14px; }
.tl-spec-table dt { display: flex; align-items: center; gap: 8px; color: var(--tl-muted); }
.tl-spec-table dt .tl-icon { color: var(--tl-subtle); }
.tl-spec-table dd { margin: 0; font-weight: 700; color: var(--tl-ink); text-align: left; }
.tl-note { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--tl-warn-50); color: var(--tl-warn); font-size: 13px; }
.tl-features { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tl-features li { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--tl-soft-2); font-size: 14px; }
.tl-features .tl-icon { color: var(--tl-success); }
.tl-visit { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 30px; align-items: start; }
.tl-visit__text p { color: var(--tl-muted); }
.tl-visit__phone { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--tl-primary-50); color: var(--tl-primary); font-weight: 900; font-size: 18px; margin-bottom: 12px; }
.tl-visit__addr { display: flex; gap: 6px; font-size: 13px; }
.tl-block--form { background: linear-gradient(180deg, #fff, var(--tl-soft-2)); }

.tl-buybar { display: none; }

/* Categories page */
.tl-brand-block { margin-bottom: 34px; }
.tl-brand-block__head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; background: var(--tl-soft); margin-bottom: 16px; }
.tl-brand-block__head > span:nth-child(2) { display: flex; flex-direction: column; }
.tl-brand-block__head strong { font-size: 20px; color: var(--tl-ink); }
.tl-brand-block__head small { color: var(--tl-muted); }
.tl-brand-block__head .tl-link-more { margin-inline-start: auto; }
.tl-brand-block__head:hover { color: inherit; }
.tl-brand-block__logo { flex-shrink: 0; width: 64px; height: 64px; border-radius: 18px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--tl-primary); box-shadow: var(--tl-shadow-sm); }
.tl-brand-block__logo img { width: 80%; height: 80%; object-fit: contain; }
.tl-cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tl-cat { position: relative; display: flex; flex-direction: column; border: 1px solid var(--tl-line); border-radius: 18px; overflow: hidden; background: #fff; transition: all .3s var(--tl-ease); }
.tl-cat:hover { transform: translateY(-3px); box-shadow: var(--tl-shadow); border-color: transparent; color: inherit; }
.tl-cat__media { aspect-ratio: 16 / 10; display: grid; place-items: center; background: linear-gradient(160deg, var(--tl-soft), #e9e9ec); overflow: hidden; }
.tl-cat__media img { width: 100%; height: 100%; object-fit: cover; }
.tl-cat__media .tl-car-svg { width: 72%; color: #2b2b2e; transition: transform .5s var(--tl-ease); }
.tl-cat:hover .tl-car-svg { transform: translateX(-8px); color: var(--tl-primary); }
.tl-cat__body { padding: 14px 16px; display: flex; flex-direction: column; }
.tl-cat__body strong { color: var(--tl-ink); }
.tl-cat__body small { color: var(--tl-muted); font-size: 12px; }
.tl-cat__go { position: absolute; bottom: 16px; inset-inline-end: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tl-soft); transition: all .25s; }
.tl-cat:hover .tl-cat__go { background: var(--tl-primary); color: #fff; }
.tl-body-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tl-body-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 10px; border-radius: 18px; border: 1px solid var(--tl-line); text-align: center; transition: all .25s; }
.tl-body-chip .tl-car-svg { width: 80%; color: var(--tl-subtle); margin-bottom: 6px; transition: color .25s; }
.tl-body-chip:hover { border-color: var(--tl-primary); color: inherit; }
.tl-body-chip:hover .tl-car-svg { color: var(--tl-primary); }
.tl-body-chip strong { color: var(--tl-ink); font-size: 14px; }
.tl-body-chip small { color: var(--tl-muted); font-size: 12px; }

@media (max-width: 1100px) {
	.tl-cars-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tl-car-row { grid-template-columns: 200px minmax(0, 1fr); }
	.tl-car-row__side { grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; }
	.tl-car-row__actions { margin: 0 auto 0 0; }
	.tl-cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tl-body-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
	.tl-shop { grid-template-columns: 1fr; }
	.tl-shop__filter-btn { display: inline-flex; }
	.tl-filters { position: fixed; inset: 0; z-index: 250; visibility: hidden; top: 0; }
	.tl-filters.is-open { visibility: visible; }
	.tl-filters__backdrop { display: block; position: absolute; inset: 0; background: rgba(15,15,18,.5); opacity: 0; transition: opacity .3s; }
	.tl-filters.is-open .tl-filters__backdrop { opacity: 1; }
	.tl-filters__panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(380px, 90vw); max-height: none; border-radius: 0; transform: translateX(100%); transition: transform .35s var(--tl-ease); }
	.tl-filters.is-open .tl-filters__panel { transform: none; }
	.tl-filters__head .tl-icon-btn { display: grid; }
	.tl-single { grid-template-columns: 1fr; }
	.tl-gallery { position: static; }
	.tl-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tl-visit { grid-template-columns: 1fr; }
	.tl-buybar { display: flex; align-items: center; gap: 10px; position: fixed; z-index: 90; inset-inline: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--tl-line); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.3); transform: translateY(100%); transition: transform .3s var(--tl-ease); }
	.tl-buybar.is-on { transform: none; }
	.tl-buybar > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
	.tl-buybar small { color: var(--tl-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.tl-buybar strong { color: var(--tl-ink); font-size: 15px; }
	.tl-buybar .tl-btn { min-height: 44px; }
	.single-product .tl-footer { padding-bottom: 90px; }
}

@media (max-width: 700px) {
	.tl-shop__bar { flex-wrap: wrap; }
	.tl-shop__count { order: -1; flex-basis: 100%; }
	.tl-shop__sort { margin-inline-start: 0; flex: 1; }
	.tl-shop__sort select { width: 100%; }
	.tl-cars-grid--3 { grid-template-columns: 1fr; }
	.tl-car-row { grid-template-columns: 1fr; }
	.tl-specs-mini { grid-template-columns: 1fr 1fr; }
	.tl-car-row__actions { width: 100%; }
	.tl-gallery__main { border-radius: 18px; }
	.tl-gallery__thumb { flex-basis: 72px; height: 54px; }
	.tl-keyspecs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tl-summary__card { padding: 18px; }
	.tl-summary__cta { grid-template-columns: 1fr; }
	.tl-block { padding: 20px 16px; border-radius: 20px; }
	.tl-spec-table { grid-template-columns: 1fr; }
	.tl-features { grid-template-columns: 1fr; }
	.tl-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.tl-body-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tl-brand-block__head .tl-link-more { display: none; }
	.tl-listbar { flex-direction: column; align-items: stretch; }
	.tl-table { min-width: 0; }
	.tl-table thead { display: none; }
	.tl-table, .tl-table tbody, .tl-table tr, .tl-table td { display: block; width: 100%; }
	.tl-table tr { padding: 12px; border-bottom: 8px solid var(--tl-soft); }
	.tl-table td { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 4px; border: 0; }
	.tl-table td::before { content: attr(data-label); color: var(--tl-muted); font-size: 12px; }
	.tl-table td:first-child::before, .tl-table td.tl-table__act::before { content: none; }
	.tl-table td.tl-table__act { justify-content: flex-end; }
}
