/**
 * TripManga — Universal Filter System v2.1
 * Clean, minimal filter UI for all search pages
 * Brand: #038a52 (green), #f47c04 (orange), #1a2b48 (navy)
 * Font: 'Poppins', sans-serif
 */

/* ============================================================================
   ROOT / RESET
   ============================================================================ */
.tm-filter *,
.tm-filter *::before,
.tm-filter *::after,
.tm-results *,
.tm-results *::before,
.tm-results *::after {
    box-sizing: border-box;
}

/* ============================================================================
   SIDEBAR FILTER CONTAINER
   ============================================================================ */
.tm-filter {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

/* ── Section ──────────────────────────────────────────────────────────────── */
.tm-filter__section {
    border-bottom: 1px solid #f0f0f0;
    padding: 0;
}
.tm-filter__section:last-child {
    border-bottom: none;
}

/* ── Section Header ───────────────────────────────────────────────────────── */
.tm-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.tm-filter__header:hover {
    background: #fafafa;
}
.tm-filter__title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1a2b48;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}
.tm-filter__toggle {
    font-size: 11px;
    color: #999;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}
.tm-filter__section.is-closed .tm-filter__toggle {
    transform: rotate(180deg);
}

/* ── Section Body ─────────────────────────────────────────────────────────── */
.tm-filter__body {
    padding: 0 20px 16px;
}
.tm-filter__section.is-closed .tm-filter__body {
    display: none;
}

/* ============================================================================
   FILTER: SEARCH INPUT (Location)
   ============================================================================ */
.tm-filter__search {
    position: relative;
}
.tm-filter__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #038a52;
    font-size: 14px;
    z-index: 2;
}
.tm-filter__search-input {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #555;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tm-filter__search-input::placeholder {
    color: #bbb;
    font-weight: 400;
}
.tm-filter__search-input:focus {
    border-color: #038a52;
    box-shadow: 0 0 0 3px rgba(3,138,82,0.08);
}

/* ============================================================================
   FILTER: SELECT DROPDOWN
   ============================================================================ */
.tm-filter__select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #444;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.tm-filter__select:focus {
    border-color: #038a52;
}

/* ============================================================================
   FILTER: PILL BUTTONS (for terms with counts)
   ============================================================================ */
.tm-filter__pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tm-filter__pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.3;
    position: relative;
}
.tm-filter__pill input[type="checkbox"],
.tm-filter__pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    clip: rect(0,0,0,0);
    pointer-events: none;
}
.tm-filter__pill:hover {
    border-color: #c0c0c0;
    background: #fafafa;
}
.tm-filter__pill.active,
.tm-filter__pill--active {
    border-color: #038a52;
    background: #f0faf5;
    color: #1a2b48;
    font-weight: 600;
}
.tm-filter__pill-count {
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
    flex-shrink: 0;
    min-width: 20px;
    text-align: right;
}
.tm-filter__pill.active .tm-filter__pill-count,
.tm-filter__pill--active .tm-filter__pill-count {
    color: #038a52;
}

/* ── Show More Link ───────────────────────────────────────────────────────── */
.tm-filter__show-more {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0 0;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #038a52;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}
.tm-filter__show-more:hover {
    color: #026d40;
}
.tm-filter__show-more i {
    font-size: 10px;
    transition: transform 0.2s;
}
.tm-filter__show-more.is-expanded i {
    transform: rotate(180deg);
}

/* Hidden items (collapsed by default) */
.tm-filter__pills .tm-filter__pill.is-hidden {
    display: none;
}
.tm-filter__pills.is-expanded .tm-filter__pill.is-hidden {
    display: flex;
}

/* ============================================================================
   FILTER: RANGE SLIDER (Price, Year, Mileage)
   ============================================================================ */
.tm-filter__range {
    padding: 4px 0 0;
}
.tm-filter__range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
}
.tm-filter__range-group {
    flex: 1;
    text-align: center;
}
.tm-filter__range-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #038a52;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.tm-filter__range-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a2b48;
}
.tm-filter__range-divider {
    font-size: 16px;
    color: #ccc;
    font-weight: 300;
    flex-shrink: 0;
}

/* Ion Range Slider — Brand green theme */
.tm-filter .irs--flat .irs-bar {
    background: #038a52;
    height: 4px;
    border-radius: 4px;
}
.tm-filter .irs--flat .irs-line {
    background: #e5e5e5;
    height: 4px;
    border-radius: 4px;
}
.tm-filter .irs--flat .irs-handle > i:first-child {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #038a52 !important;
    border: 3px solid #fff !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.18) !important;
}
.tm-filter .irs--flat .irs-handle {
    width: 22px;
    top: 18px;
}
.tm-filter .irs--flat .irs-from,
.tm-filter .irs--flat .irs-to,
.tm-filter .irs--flat .irs-single {
    background: #038a52 !important;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 2px 8px;
    color: #fff;
}
.tm-filter .irs--flat .irs-from::before,
.tm-filter .irs--flat .irs-to::before,
.tm-filter .irs--flat .irs-single::before {
    border-top-color: #038a52 !important;
}
.tm-filter .irs--flat .irs-grid-text {
    font-size: 10px;
    color: #bbb;
    font-family: 'Poppins', sans-serif;
}
.tm-filter .irs--flat .irs-min,
.tm-filter .irs--flat .irs-max {
    font-size: 10px;
    color: #999;
    font-family: 'Poppins', sans-serif;
    background: none;
}

/* ============================================================================
   FILTER: RATING (Stars with counts)
   ============================================================================ */
.tm-filter__ratings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tm-filter__rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}
.tm-filter__rating input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    clip: rect(0,0,0,0);
    pointer-events: none;
}
.tm-filter__rating:hover {
    border-color: #c0c0c0;
    background: #fafafa;
}
.tm-filter__rating.active {
    border-color: #f47c04;
    background: #fff9f0;
}
.tm-filter__rating-stars {
    display: flex;
    gap: 2px;
}
.tm-filter__rating-stars i {
    font-size: 14px;
    transition: color 0.15s;
}
.tm-filter__rating-stars .fa-star {
    color: #f47c04;
}
.tm-filter__rating-stars .fa-star.empty {
    color: #e0e0e0;
}
.tm-filter__rating-count {
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
}
.tm-filter__rating.active .tm-filter__rating-count {
    color: #f47c04;
}

/* ============================================================================
   FILTER: RENTAL PERIOD BUTTONS
   ============================================================================ */
.tm-filter__period-pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tm-filter__period-pill {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}
.tm-filter__period-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    clip: rect(0,0,0,0);
    pointer-events: none;
}
.tm-filter__period-pill:hover {
    border-color: #c0c0c0;
    background: #fafafa;
}
.tm-filter__period-pill.active {
    border-color: #038a52;
    background: #f0faf5;
    color: #1a2b48;
    font-weight: 600;
}

/* ============================================================================
   RESULTS TOP BAR
   ============================================================================ */
.tm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 16px;
    gap: 12px;
    flex-wrap: wrap;
    font-family: 'Poppins', sans-serif;
}
.tm-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tm-topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* View toggle (Grid / List) */
.tm-topbar__view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}
.tm-topbar__view-btn {
    width: 36px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    color: #bbb;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.tm-topbar__view-btn + .tm-topbar__view-btn {
    border-left: 1px solid #e0e0e0;
}
.tm-topbar__view-btn.active,
.tm-topbar__view-btn:hover {
    background: #1a2b48;
    color: #fff;
}
.tm-topbar__count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}
.tm-topbar__count strong {
    font-weight: 700;
    color: #1a2b48;
}

/* Topbar selects (Show N, Sort By) */
.tm-topbar__select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tm-topbar__select-label {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}
.tm-topbar__select {
    padding: 7px 32px 7px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.tm-topbar__select:focus {
    border-color: #038a52;
}

/* ============================================================================
   CAR CARD — Vertical Layout (image top, content bottom) in 3-col grid
   ============================================================================ */
.tm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tm-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    font-family: 'Poppins', sans-serif;
}
.tm-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    border-color: #d0d0d0;
}

/* ── Image: Top ───────────────────────────────────────────────────────────── */
.tm-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f0f0f0;
    overflow: hidden;
    flex-shrink: 0;
}
.tm-card__image a {
    display: block;
    width: 100%;
    height: 100%;
}
.tm-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f0f0f0;
    transition: transform 0.35s ease;
}
.tm-card:hover .tm-card__image img {
    transform: scale(1.04);
}
.tm-card__image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}
.tm-card__image .no-image i {
    font-size: 2.5rem;
    color: #ccc;
}

/* Badges on image */
.tm-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}
.tm-card__badge--featured {
    background: #038a52;
    color: #fff;
}
.tm-card__badge--discount {
    background: #026d40;
    color: #fff;
    top: auto;
    bottom: 10px;
    left: 10px;
}
.tm-card__badge--category {
    background: #f47c04;
    color: #fff;
}

/* Review badge on image (bottom-center overlap) */
.tm-card__review-badge {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2b48;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    z-index: 3;
    white-space: nowrap;
}
.tm-card__review-badge i {
    color: #f47c04;
    font-size: 13px;
}
.tm-card__review-badge span {
    color: #888;
    font-weight: 400;
    font-size: 12px;
}

/* ── Body: Bottom ─────────────────────────────────────────────────────────── */
.tm-card__body {
    flex: 1;
    min-width: 0;
    padding: 20px 18px 18px;
    display: flex;
    flex-direction: column;
}

/* Review line (text-based, used on search page) */
.tm-card__review-line {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}
.tm-card__review-line i {
    color: #f47c04;
    font-size: 13px;
}
.tm-card__review-line strong {
    color: #1a2b48;
    font-weight: 700;
    margin-left: 1px;
}

/* Title */
.tm-card__title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2b48;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tm-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}
.tm-card__title a:hover {
    color: #f47c04;
}
/* Featured cars get orange title */
.tm-card--featured .tm-card__title a {
    color: #f47c04;
}

/* Location */
.tm-card__location {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.4;
}
.tm-card__location i {
    color: #038a52;
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
}
.tm-card__location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider */
.tm-card__divider {
    width: 100%;
    height: 1px;
    background: #f0f0f0;
    margin: 0 0 10px;
}

/* Specs: 2-column grid */
.tm-card__specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 14px;
}
.tm-card__spec {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}
.tm-card__spec i {
    font-size: 14px;
    color: #888;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Footer: Price + Book Button */
.tm-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: auto;
    gap: 12px;
}
.tm-card__price {
    display: flex;
    flex-direction: column;
}
.tm-card__price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #1a2b48;
}
.tm-card__price-original {
    font-size: 13px;
    color: #bbb;
    text-decoration: line-through;
    margin-right: 4px;
}
.tm-card__price-unit {
    font-size: 12px;
    font-weight: 400;
    color: #999;
}
.tm-card__book-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 22px;
    border: 2px solid #038a52;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #038a52;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.tm-card__book-btn:hover {
    background: #f47c04;
    border-color: #f47c04;
    color: #fff;
}

/* ============================================================================
   HOMEPAGE: 4-Column Grid  (.tm-grid--home)
   ============================================================================ */
.tm-grid--home {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ============================================================================
   LIST VIEW: Horizontal Cards  (.tm-grid--list)
   Image left, content right — single column layout
   ============================================================================ */
.tm-grid--list {
    grid-template-columns: 1fr !important;
    gap: 16px;
}

/* Card becomes horizontal row */
.tm-grid--list .tm-card {
    flex-direction: row;
    height: auto;
    min-height: 0;
}

/* Image: fixed width on the left */
.tm-grid--list .tm-card__image {
    flex: 0 0 300px;
    width: 300px;
    aspect-ratio: auto;
    min-height: 220px;
    border-radius: 12px 0 0 12px;
}
.tm-grid--list .tm-card__image img {
    border-radius: 12px 0 0 12px;
}

/* Badges reposition for horizontal layout */
.tm-grid--list .tm-card__badge--discount {
    bottom: 10px;
    left: 10px;
}

/* Review badge: position bottom-left instead of center */
.tm-grid--list .tm-card__review-badge {
    left: 14px;
    transform: none;
    bottom: -12px;
}

/* Body: fills remaining space */
.tm-grid--list .tm-card__body {
    flex: 1;
    min-width: 0;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Title gets more room in list view */
.tm-grid--list .tm-card__title {
    font-size: 18px;
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
}

/* Location */
.tm-grid--list .tm-card__location {
    margin-bottom: 10px;
}

/* Specs: 3-column on list for wider space */
.tm-grid--list .tm-card__specs {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 20px;
    margin-bottom: 16px;
}
.tm-grid--list .tm-card__spec {
    font-size: 13px;
}

/* Footer: price and button spread out */
.tm-grid--list .tm-card__footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.tm-grid--list .tm-card__price-amount {
    font-size: 22px;
}
.tm-grid--list .tm-card__book-btn {
    padding: 10px 28px;
    font-size: 14px;
}

/* ============================================================================
   RESULTS: PAGINATION / LOAD MORE
   ============================================================================ */
.tm-pagination {
    text-align: center;
    padding: 32px 0 16px;
}
.tm-pagination__info {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #999;
    margin-top: 12px;
}

/* ============================================================================
   RESULTS: EMPTY STATE
   ============================================================================ */
.tm-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}
.tm-empty__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.tm-empty__icon i {
    font-size: 1.8rem;
    color: #ccc;
}
.tm-empty__title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px;
}
.tm-empty__text {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ============================================================================
   MOBILE FILTER TOGGLE
   ============================================================================ */
.tm-filter-mobile-btn {
    display: none;
}

/* ============================================================================
   LAYOUT: Sidebar + Results
   ============================================================================ */
.tm-search-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.tm-search-layout__sidebar {
    flex: 0 0 270px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.tm-search-layout__sidebar::-webkit-scrollbar {
    width: 4px;
}
.tm-search-layout__sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}
.tm-search-layout__content {
    flex: 1;
    min-width: 0;
}

/* Mobile filter overlay */
.tm-filter-overlay {
    display: none;
}

/* ============================================================================
   LIVEWIRE LOADING INDICATOR
   ============================================================================ */
.ajax-search-result.is-loading .tm-grid,
.tm-grid.is-loading {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
}
.ajax-search-result.is-loading .tm-grid::after,
.tm-grid.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #e0e0e0;
    border-top-color: #038a52;
    border-radius: 50%;
    animation: tmSpin 0.7s linear infinite;
    z-index: 20;
}
@keyframes tmSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   RESPONSIVE: Tablet (768-1199px)
   ============================================================================ */
@media (max-width: 1199px) {
    .tm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .tm-search-layout__sidebar {
        flex: 0 0 250px;
    }
    .tm-card__body {
        padding: 16px 16px;
    }
    .tm-card__title {
        font-size: 15px;
    }
    .tm-card__specs {
        gap: 5px 12px;
    }
    .tm-card__spec {
        font-size: 12px;
    }
    .tm-card__price-amount {
        font-size: 18px;
    }
    /* Homepage grid: 2 columns on tablet */
    .tm-grid--home {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* List view: shrink image on tablet */
    .tm-grid--list .tm-card__image {
        flex: 0 0 240px;
        width: 240px;
        min-height: 190px;
    }
    .tm-grid--list .tm-card__title {
        font-size: 16px;
    }
    .tm-grid--list .tm-card__specs {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px 14px;
    }
    .tm-grid--list .tm-card__body {
        padding: 16px 20px;
    }
    .tm-grid--list .tm-card__price-amount {
        font-size: 19px;
    }
    .tm-grid--list .tm-card__book-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
}

/* ============================================================================
   RESPONSIVE: Mobile (< 992px)
   ============================================================================ */
@media (max-width: 991px) {
    .tm-search-layout {
        flex-direction: column;
    }
    .tm-search-layout__sidebar {
        display: none;
    }

    /* Mobile filter button */
    .tm-filter-mobile-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 12px 20px;
        margin-bottom: 16px;
        background: #fff;
        border: 2px solid #1a2b48;
        border-radius: 8px;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        font-weight: 600;
        color: #1a2b48;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .tm-filter-mobile-btn:hover {
        background: #1a2b48;
        color: #fff;
    }

    /* Mobile filter overlay */
    .tm-filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1050;
        display: none;
    }
    .tm-filter-overlay.is-open {
        display: block;
    }
    .tm-filter-overlay__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1;
    }
    .tm-filter-overlay__panel {
        position: absolute;
        top: 0;
        left: 0;
        width: 88%;
        max-width: 340px;
        height: 100%;
        background: #fff;
        z-index: 2;
        overflow-y: auto;
        padding: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
        animation: tmSlideIn 0.3s ease;
    }
    .tm-filter-overlay__close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #eee;
    }
    .tm-filter-overlay__close-title {
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        font-weight: 700;
        color: #1a2b48;
    }
    .tm-filter-overlay__close-btn {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        border: 1px solid #eee;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 16px;
        color: #999;
        transition: all 0.2s;
    }
    .tm-filter-overlay__close-btn:hover {
        background: #f5f5f5;
        color: #333;
    }

    .tm-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .tm-topbar__left,
    .tm-topbar__right {
        justify-content: space-between;
    }
}

@keyframes tmSlideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* ============================================================================
   RESPONSIVE: Small Mobile (< 576px)
   ============================================================================ */
@media (max-width: 575px) {
    .tm-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .tm-card__body {
        padding: 14px 16px;
    }
    .tm-card__title {
        font-size: 14px;
    }
    .tm-card__specs {
        grid-template-columns: 1fr 1fr;
        gap: 5px 10px;
    }
    .tm-card__spec {
        font-size: 12px;
    }
    .tm-card__price-amount {
        font-size: 17px;
    }
    .tm-card__book-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    .tm-filter__header {
        padding: 14px 16px;
    }
    .tm-filter__body {
        padding: 0 16px 14px;
    }

    /* List view: stack vertically on small mobile */
    .tm-grid--list .tm-card {
        flex-direction: column;
    }
    .tm-grid--list .tm-card__image {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 10;
        min-height: auto;
        border-radius: 12px 12px 0 0;
    }
    .tm-grid--list .tm-card__image img {
        border-radius: 12px 12px 0 0;
    }
    .tm-grid--list .tm-card__review-badge {
        left: 50%;
        transform: translateX(-50%);
    }
    .tm-grid--list .tm-card__body {
        padding: 14px 16px;
    }
    .tm-grid--list .tm-card__title {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    .tm-grid--list .tm-card__specs {
        grid-template-columns: 1fr 1fr;
        gap: 5px 10px;
    }
    .tm-grid--list .tm-card__price-amount {
        font-size: 17px;
    }
    .tm-grid--list .tm-card__book-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    .tm-grid--list .tm-card__footer {
        border-top: none;
        padding-top: 0;
    }

    /* Homepage grid: 1 column on small mobile */
    .tm-grid--home {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}
