/* Packages page (Views/Home/Products.cshtml): home.css components plus search, filters and results; products.js drives it */
.tm-plp .pathway { margin-top: 80px; }
.tm-plp .breadcrumb { margin: 0; padding: 0; }
.tm-plp__title { margin: 12px 0 24px; font-family: var(--font-display); font-size: 40px; line-height: 1.12; font-weight: 500; color: var(--ink); }

/* Services and devices pages: a line under the title; no tabs, so the dock keeps a little room above the search when it sticks */
.tm-plp__intro { max-width: 640px; margin: -12px 0 24px; font-size: 16px; line-height: 1.55; color: var(--muted); }
.tm-plp--plain .tm-plp__dock { padding-top: 12px; margin-top: -12px; }

/* Tabs, search and sort stay under the 64px header; the white runs edge to edge */
.tm-plp__dock { position: sticky; top: 64px; z-index: 5; padding: 0 0 12px; }
.tm-plp__dock::before {
    content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
    background: #fff; transition: box-shadow .25s ease;
}
.tm-plp__dock.is-stuck::before { box-shadow: 0 1px 0 var(--line), 0 10px 20px -16px rgba(17, 17, 17, .18); }
.tm-plp .tm-tabs { margin: 0 0 20px; }
/* home.css hides tabs and rows until their section scrolls in; this page has no sections, products.js animates instead */
html.tm-motion .tm-plp :is(.tm-tabs, .tm-offer__side, .tm-offer__list > li) { opacity: 1; }

.tm-plp__bar { display: flex; align-items: center; gap: 12px; }
.tm-plp__search { position: relative; flex: 0 1 560px; min-width: 0; margin: 0; }
.tm-plp__input {
    width: 100%; height: 48px; margin: 0; padding: 0 46px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: #fff; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.2;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.tm-plp__input::placeholder { color: var(--muted); opacity: 1; }
.tm-plp__input:hover { border-color: var(--muted); }
.tm-plp__input:focus { outline: none; border-color: var(--o); box-shadow: 0 0 0 3px rgba(255, 80, 0, .15); }
.tm-plp__input::-webkit-search-cancel-button, .tm-plp__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.tm-plp__glass {
    position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); pointer-events: none;
    fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.tm-plp__clear {
    position: absolute; right: 6px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0;
    transform: translateY(-50%); border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}
.tm-plp__clear[hidden] { display: none; }
.tm-plp__clear:hover { background: var(--warm); color: var(--ink); }
.tm-plp__clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Sort button and its menu (same pop-up as the header's account menu) */
.tm-plp__sort { position: relative; flex: none; margin: 0 0 0 auto; }
.tm-plp__sortbtn {
    display: inline-flex; align-items: center; gap: 8px; height: 48px; margin: 0; padding: 0 12px 0 16px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink);
    font: inherit; font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.tm-plp__sortbtn:hover { border-color: var(--muted); }
.tm-plp__sortbtn:focus-visible, .tm-plp__sort.is-open .tm-plp__sortbtn { outline: none; border-color: var(--o); box-shadow: 0 0 0 3px rgba(255, 80, 0, .15); }
/* Same weight family as the value (400/600 share one ascent), so both words sit on one line */
.tm-plp__sortkey { color: var(--muted); font-weight: 400; }
@supports (text-box: trim-both cap alphabetic) {
    .tm-plp__sortbtn > span { text-box: trim-both cap alphabetic; }
}
.tm-plp__sortbtn svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-plp__chev { transition: transform .25s var(--ease); }
.tm-plp__sort.is-open .tm-plp__chev { transform: rotate(180deg); }
.tm-plp__sortbtn .tm-plp__sorts { display: none; }
.tm-plp__menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 3; min-width: max(100%, 232px); margin: 0; padding: 6px; list-style: none;
    border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(17, 17, 17, .05), 0 20px 44px -18px rgba(17, 17, 17, .32);
    /* Unrolls downwards like the header menus, without a transform (a stopping transform jolts the text) */
    opacity: 0; visibility: hidden; clip-path: inset(-24px -40px calc(100% - 12px) -40px);
    transition: opacity .16s ease, clip-path .2s var(--ease), visibility 0s linear .2s;
}
.tm-plp__menu:focus { outline: none; }
.tm-plp__sort.is-open .tm-plp__menu { opacity: 1; visibility: visible; clip-path: inset(-24px -40px -64px -40px); transition: opacity .2s ease, clip-path .28s var(--ease), visibility 0s; }
.tm-plp__menu [role="option"] {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px;
    color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.3; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.tm-plp__menu [role="option"].is-active { background: #faf6f3; }
.tm-plp__menu [aria-selected="true"] { color: var(--o-text); font-weight: 600; }
.tm-plp__menu svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tm-plp__menu [aria-selected="true"] svg { opacity: 1; }

/* Filter chips; a pressed chip gains a check */
/* 4px above and below so no chip border sits on the dock's edge or a scroll box's clip line */
.tm-plp__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 4px 0; }
.tm-plp__chips:empty { display: none; }
.tm-plp__chip {
    position: relative; display: inline-flex; align-items: center; flex: none; height: 36px; margin: 0; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: 99px; background: #fff; color: var(--text);
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.tm-plp__chip[hidden] { display: none; }
.tm-plp__chip:hover { border-color: var(--muted); color: var(--ink); }
.tm-plp__chip svg {
    width: 0; height: 14px; margin-right: 0; opacity: 0; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
    transition: width .25s var(--ease), margin-right .25s var(--ease), opacity .2s ease;
}
.tm-plp__chip[aria-pressed="true"] { background: var(--tint); border-color: var(--o); color: var(--o-text); }
.tm-plp__chip[aria-pressed="true"] svg { width: 14px; margin-right: 6px; opacity: 1; }

/* What is shown: count, what the search understood, other tabs with matches, Clear */
.tm-plp__meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 20px; }
.tm-plp__status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; min-height: 21px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tm-plp__status b { color: var(--ink); font-weight: 600; }
.tm-plp__status button {
    margin: 0; padding: 0; border: 0; background: none; color: var(--o-text); font: inherit; font-weight: 600; cursor: pointer;
    background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px;
    transition: background-size .3s var(--ease-out);
}
.tm-plp__status button:hover { background-size: 100% 1px; }

/* Cards or list: a two-button switch on a warm track */
.tm-plp__views { display: flex; flex: none; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--warm); }
.tm-plp__view {
    display: grid; place-items: center; width: 36px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 7px;
    background: transparent; color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.tm-plp__view:hover { color: var(--ink); }
.tm-plp__view[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 17, .08), 0 0 0 1px rgba(17, 17, 17, .04); }
.tm-plp__view svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Results: cards (grid), wide rows (list on wide screens), home.css package rows (list on phones) */
.tm-plp__results { min-height: 320px; }
.tm-plp__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.tm-plp__media { display: block; width: 100%; margin: 0; padding: 0; border: 0; cursor: pointer; }
.tm-plp .tm-card__title { font-size: 20px; }
.tm-plp .tm-card__facts > span:first-child { min-width: 0; }
.tm-plp .tm-card__facts > span:first-child span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-plp .tm-card__desc { height: calc(1.6em * 3); }
.tm-plp__card, .tm-plp__line { cursor: pointer; }
.tm-plp__lines { margin: 0; padding: 0 24px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.tm-plp__line { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto auto; align-items: center; column-gap: 28px; padding: 18px 0; }
.tm-plp__line + .tm-plp__line { border-top: 1px solid var(--line); }
.tm-plp__thumb { display: block; aspect-ratio: 3 / 2; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: var(--r-sm); background: var(--warm); cursor: pointer; }
.tm-plp .tm-plp__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out), opacity .5s ease; }
.tm-plp__line:hover .tm-plp__thumb img { transform: scale(1.05); }
.tm-plp__main { min-width: 0; }
.tm-plp .tm-plp__name { margin: 0; font-size: 19px; line-height: 1.3; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.tm-plp__facts { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.tm-plp__facts svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tm-plp .tm-plp__desc {
    margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--text); max-height: calc(1.6em * 2); overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tm-plp .tm-plp__desc * { margin: 0; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }
.tm-plp__cost { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 96px; text-align: right; }
.tm-plp .tm-plp__cost strong { font-family: var(--font-display); font-size: 28px; line-height: 1; font-weight: 700; color: var(--o); }
.tm-plp .tm-plp__cost strong span { font-size: .6em; vertical-align: .5em; margin-right: 1px; }
.tm-plp .tm-plp__cost s { font-size: 13px; color: var(--muted); }
.tm-plp .tm-plp__cost small { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tm-plp__acts { display: flex; align-items: center; gap: 20px; }
.tm-plp .tm-plp__acts .tm-link { margin: 0; }
.tm-plp__skel-rows { display: none; }

/* Devices: product photos shown whole on warm grey, a sale tag, spec lines; rows are links to the device page */
.tm-plp .tm-plp__pic { position: relative; display: block; background: var(--warm); }
/* Device photos come on white: multiply lets the grey show through the white, so no white box sits in the grey */
.tm-plp .tm-plp__pic img { object-fit: contain; padding: 18px; mix-blend-mode: multiply; }
.tm-plp .tm-offer__thumb.tm-plp__pic img, .tm-plp .tm-plp__thumb.tm-plp__pic img { padding: 6px; }
.tm-plp__card--device { position: relative; }
/* Sale sticker as on the device page: "SALE" on ink, the cut on orange */
.tm-plp__sale { position: absolute; top: 12px; left: 12px; display: flex; height: 26px; overflow: hidden; border-radius: 6px; color: #fff; font-weight: 700; line-height: 1; }
.tm-plp__sale > span, .tm-plp__sale > b { display: flex; align-items: center; }
.tm-plp__sale > span { padding: 0 7px .2em; background: var(--ink); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.tm-plp__sale > b { padding: 0 8px .29em; background: var(--o); font-family: var(--font-display); font-size: 14px; font-variant-numeric: tabular-nums; }
.tm-plp__thumb .tm-plp__sale { top: 6px; left: 6px; height: 20px; border-radius: 5px; }
.tm-plp__thumb .tm-plp__sale > span { display: none; }
.tm-plp__thumb .tm-plp__sale > b { padding-inline: 6px; font-size: 12px; }
.tm-plp__specs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; color: var(--text); }
.tm-plp__specs li { position: relative; padding-left: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-plp__specs li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.tm-plp a.tm-offer__row { color: var(--ink); text-decoration: none; }
.tm-plp .tm-offer__price small s { color: var(--muted); }
.tm-plp .tm-plp__devlead {
    margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.tm-plp__empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; }
.tm-plp__empty-title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.tm-plp__empty p { margin: 0; }
.tm-plp__empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }

@media (pointer: coarse) {
    .tm-plp__chip::before, .tm-plp__status button::before {
        content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
    }
    .tm-plp__status button { position: relative; }
}
@media (max-width: 1199px) {
    .tm-plp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Wide rows: the buttons move under the text */
    .tm-plp__line { grid-template-columns: 168px minmax(0, 1fr) auto; row-gap: 14px; column-gap: 24px; }
    /* Picture and price both centre on the text and buttons between them */
    .tm-plp__thumb, .tm-plp__cost { grid-row: span 2; align-self: center; }
    .tm-plp__acts { grid-column: 2; }
}
@media (max-width: 991px) {
    .tm-plp__title { font-size: 32px; }
}
@media (max-width: 767px) {
    .tm-plp .pathway { margin-top: 76px; }
    .tm-plp__title { margin: 8px 0 12px; font-size: 26px; }
    .tm-plp__intro { margin: -4px 0 16px; font-size: 14px; }
    .tm-plp__dock { padding-bottom: 8px; }
    .tm-plp .tm-tabs { margin: 0 0 12px; }
    .tm-plp__bar { gap: 8px; }
    .tm-plp__search { flex: 1 1 auto; }
    .tm-plp__input { height: 44px; padding: 0 40px 0 40px; }
    .tm-plp__input:placeholder-shown { padding-right: 10px; }
    .tm-plp__glass { left: 13px; }
    .tm-plp__clear { right: 4px; }
    /* Sort shrinks to an icon (its words stay for screen readers); tinted once a sort other than Popular is picked */
    .tm-plp__sortbtn { justify-content: center; width: 44px; height: 44px; padding: 0; }
    .tm-plp__sortkey, .tm-plp__sortval { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .tm-plp__sortbtn .tm-plp__chev { display: none; }
    .tm-plp__sortbtn .tm-plp__sorts { display: block; width: 20px; height: 20px; stroke: var(--ink); }
    .tm-plp__sort.is-set .tm-plp__sortbtn { border-color: var(--o); background: var(--tint); }
    .tm-plp__sort.is-set .tm-plp__sorts { stroke: var(--o-text); }
    /* One row of chips that scrolls sideways */
    .tm-plp__chips {
        flex-wrap: nowrap; margin: 0 -16px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 16px;
    }
    .tm-plp__chips::-webkit-scrollbar { display: none; }
    /* Faded edges say there are more chips to swipe to */
    .tm-plp__chips.is-more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
    .tm-plp__chips.is-back { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); mask-image: linear-gradient(90deg, transparent, #000 40px); }
    .tm-plp__chips.is-back.is-more {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
    }
    .tm-plp__chip { height: 34px; padding: 0 12px; font-size: 13px; }
    .tm-plp__meta { gap: 12px; margin: 8px 0 14px; }
    .tm-plp__status { font-size: 13px; }
    /* Cards on phones: two small ones per row, a tap opens the package */
    .tm-plp__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .tm-plp__card { border-radius: 12px; }
    .tm-plp__card .tm-card__body { gap: 4px; padding: 10px 12px 12px; }
    .tm-plp__card .tm-card__top { flex-direction: column; align-items: flex-start; gap: 4px; }
    .tm-plp .tm-plp__card .tm-card__title { max-width: 100%; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
    .tm-plp .tm-plp__card .tm-card__price strong { font-size: 22px; }
    .tm-plp__card .tm-card__facts { margin: 0; font-size: 12px; }
    .tm-plp__card .tm-card__facts svg, .tm-plp .tm-plp__card .tm-card__perday, .tm-plp .tm-plp__card .tm-card__desc, .tm-plp__card .tm-card__actions,
    .tm-plp__card .tm-plp__specs, .tm-plp__card .tm-plp__devlead { display: none; }
    .tm-plp .tm-plp__card .tm-plp__pic img { padding: 10px; }
    .tm-plp__card .tm-plp__sale { top: 8px; left: 8px; height: 22px; }
    .tm-plp__card .tm-plp__sale > span { padding-inline: 6px; font-size: 9px; }
    .tm-plp__card .tm-plp__sale > b { padding-inline: 6px; font-size: 12px; }
    .tm-plp__skel-grid { display: none; }
    .tm-plp__skel-rows { display: flex; }
    .tm-plp__results { min-height: 240px; }
    .tm-plp .tm-offer__side { padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .tm-plp__chip svg, .tm-plp__dock::before { transition: none; }
}
