/* TopDeals home page ([td-home]). Tokens from the design prototype (homepage/index.html). */
.td-home {
    --navy: #0b1638; --navy-2: #13214d; --yellow: #ffc812; --yellow-2: #ffb800; --red: #ee2e3a;
    --ink: #0b1638; --text: #2b3245; --muted: #6b7385; --line: #e7e9ef; --soft: #f5f6fa; --radius: 14px;
    --shadow: 0 4px 18px rgba(11, 22, 56, .07);
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    max-width: 1536px;
    margin: 0 auto;
    padding: 18px 34px 40px;
}
.td-home *, .td-home *::before, .td-home *::after { box-sizing: border-box; }
.td-home a { color: inherit; text-decoration: none; }
.td-home img { display: block; max-width: 100%; }
.td-home h2, .td-home h3 { margin: 0; color: var(--ink); font-family: Inter, sans-serif; }

.td-btn-y, .td-btn-n { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; font-weight: 700; white-space: nowrap; transition: background-color .2s, transform .1s; }
.td-btn-y { background: var(--yellow); color: var(--ink); font-size: 15px; padding: 12px 22px; }
.td-btn-y:hover { background: var(--yellow-2); }
.td-btn-n { background: var(--navy); color: #fff; font-size: 12.5px; padding: 9px 16px; border-radius: 999px; }
.td-btn-n:hover { background: var(--navy-2); }
a:active .td-btn-y, a:active .td-btn-n { transform: translateY(1px); }
.td-btn-y i, .td-btn-n i { font-size: 12px; }

/* ---------- Hero ---------- */
.td-hero { display: grid; grid-template-columns: 1fr 380px; gap: 16px; }
.td-slider { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy); aspect-ratio: 703 / 278; }
.td-slides { display: flex; height: 100%; transition: transform .6s cubic-bezier(.6, .05, .25, 1); }
.td-slide { position: relative; flex: 0 0 100%; height: 100%; display: block; }
.td-slide img { width: 100%; height: 100%; object-fit: cover; }
/* Copy slides: navy panel on the left, photo on the right with a soft fade. */
.td-slide.has-copy img { position: absolute; right: 0; top: 0; width: 60%; object-position: center; }
.td-slide.has-copy::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 52%; background: linear-gradient(90deg, var(--navy) 72%, rgba(11, 22, 56, 0)); }
.td-slide__copy { position: absolute; z-index: 1; left: 8%; top: 50%; transform: translateY(-50%); max-width: 42%; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; color: #fff; }
.td-slide__title { font-size: clamp(30px, 3.4vw, 52px); font-weight: 800; line-height: 1.02; letter-spacing: -1.2px; }
.td-slide__title span { display: block; color: var(--yellow); }
.td-slide__text { font-size: clamp(13px, 1.05vw, 16px); line-height: 1.45; opacity: .92; }
.td-slide__copy .td-btn-y { margin-top: 6px; }
.td-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .14); z-index: 2; cursor: pointer; transition: transform .15s; }
.td-arrow:hover { transform: translateY(-50%) scale(1.06); }
.td-slider .prev { left: 16px; }
.td-slider .next { right: 16px; }
.td-dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 7px; z-index: 2; }
.td-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 5px; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .3s, background .3s; }
.td-dots button[aria-current="true"] { width: 18px; background: var(--yellow); }

.td-side { display: grid; grid-template-rows: 1fr 1fr; gap: 14px; }
.td-side__card { position: relative; border-radius: var(--radius); overflow: hidden; display: block; min-height: 130px; transition: transform .2s, box-shadow .2s; }
.td-side__card img { position: absolute; right: 0; top: 0; height: 100%; width: 58%; object-fit: cover; }
.td-tint-1 { background: #fde3e4; }
.td-tint-2 { background: #dfe9f6; }
.td-side__card::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 55%; background: linear-gradient(90deg, var(--tint, inherit) 70%, transparent); }
.td-tint-1::after { background: linear-gradient(90deg, #fde3e4 70%, rgba(253, 227, 228, 0)); }
.td-tint-2::after { background: linear-gradient(90deg, #dfe9f6 70%, rgba(223, 233, 246, 0)); }
.td-side__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 18px; max-width: 62%; height: 100%; justify-content: center; }
.td-side__title { font-size: 21px; font-weight: 800; line-height: 1.05; color: var(--ink); letter-spacing: -.4px; }
.td-side__title span { display: block; color: var(--red); }
.td-tint-2 .td-side__title span { color: var(--ink); }
.td-side__text { font-size: 12.5px; color: var(--text); margin-bottom: 6px; }

/* ---------- Trust + seller ---------- */
.td-assure { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.td-assure__trust { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; padding: 14px 22px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.td-assure__trust li { display: flex; align-items: center; gap: 10px; }
.td-assure__trust i { font-size: 26px; color: var(--ink); }
.td-assure__trust strong { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.td-assure__trust small { display: block; font-size: 11px; color: var(--muted); }
.td-assure__seller { display: flex; align-items: center; gap: 18px; padding: 14px 22px; background: var(--navy); color: #fff; border-radius: var(--radius); }
.td-assure__seller > i { font-size: 34px; color: var(--yellow); }
.td-assure__seller strong { display: block; font-size: 15px; font-weight: 700; color: #fff; }
.td-assure__seller small { display: block; font-size: 12px; color: rgba(255, 255, 255, .78); }
.td-assure__seller .td-btn-y { margin-left: auto; font-size: 13px; padding: 9px 16px; }

/* ---------- Section heads ---------- */
.td-section { margin-top: 26px; }
.td-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.td-section__head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.td-section__head a { font-size: 13px; font-weight: 600; color: var(--navy-2); display: inline-flex; align-items: center; gap: 6px; }
.td-section__head a:hover { color: #c79200; }

/* ---------- Shop by category ---------- */
.td-cats { display: grid; grid-template-columns: repeat(10, 1fr); gap: 12px; }
.td-cat { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.td-cat__img { width: 100%; aspect-ratio: 1 / .82; border-radius: 12px; background: var(--soft); display: grid; place-items: center; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.td-cat__img img { width: 78%; height: 78%; object-fit: contain; mix-blend-mode: multiply; }
.td-cat__img i { font-size: 34px; color: var(--navy-2); }
.td-cat:hover .td-cat__img { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(11, 22, 56, .12); }
.td-cat__name { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }

/* ---------- Promo cards ---------- */
.td-promos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.td-promo { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 236 / 180; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 16px 18px; transition: transform .2s, box-shadow .2s; }
.td-promo img { position: absolute; left: 0; right: 0; bottom: 0; top: 24%; z-index: 0; width: 100%; height: 76%; object-fit: cover; object-position: center bottom; }
.td-promo__title, .td-promo .td-btn-n { position: relative; z-index: 2; }
.td-promo__title { font-size: clamp(17px, 1.45vw, 22px); font-weight: 800; color: var(--ink); line-height: 1.12; letter-spacing: -.4px; max-width: 75%; }
.td-promo .td-btn-n { align-self: flex-start; }
/* Image sits lower-right; a tinted panel keeps the title readable. */
.td-promo::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, var(--promo-tint) 30%, rgba(255, 255, 255, 0) 46%); }
.td-promo--beauty { background: #fbe3e5; --promo-tint: #fbe3e5; }
.td-promo--fashion { background: #efeae6; --promo-tint: #efeae6; }
.td-promo--toys { background: #dfeaf9; --promo-tint: #dfeaf9; }
.td-promo--computers { background: #ead9fb; --promo-tint: #ead9fb; }
.td-promo:hover, .td-side__card:hover, .td-bottom__card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(11, 22, 56, .14); }

/* ---------- 2x2 collections ---------- */
.td-collections { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.td-collection { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.td-collection__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.td-collection__head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.td-collection__head a { font-size: 11.5px; font-weight: 600; color: var(--navy-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.td-collection__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.td-collection__grid a { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text); }
.td-collection__img { aspect-ratio: 1.45 / 1; border-radius: 10px; background: var(--soft); display: grid; place-items: center; overflow: hidden; transition: transform .2s; }
.td-collection__img img { width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.td-collection__grid a:hover .td-collection__img { transform: scale(1.03); }
.td-collection:nth-child(1) .td-collection__img { background: #f6efe9; }
.td-collection:nth-child(2) .td-collection__img { background: #e8f3ef; }
.td-collection:nth-child(3) .td-collection__img { background: #fdf3c8; }
.td-collection:nth-child(4) .td-collection__img { background: #eef0fb; }

/* ---------- Deals (mockup "Flash Deals") ---------- */
.td-deals { position: relative; margin-top: 30px; }
.td-deals__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.td-bolt { width: 26px; height: 38px; flex: none; }
.td-deals__head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; line-height: 1; }
.td-deals__sub { font-size: 14px; font-weight: 400; color: #4a5164; margin-left: 4px; }
.td-deals__ends { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink); }
.td-timer { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink); }
.td-timer b { background: var(--red); color: #fff; border-radius: 6px; font-size: 16px; font-weight: 700; min-width: 32px; height: 32px; padding: 0 4px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.td-deals__all { font-size: 14px; font-weight: 700; color: var(--navy-2) !important; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.td-deals__ends + .td-deals__all { margin-left: 20px; }
.td-deals__sub + .td-deals__all { margin-left: auto; }
.td-deals__track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 4px 10px; margin: -4px -4px 0; }
.td-deals__track::-webkit-scrollbar { display: none; }
.td-deals__next { top: 56%; right: -8px; width: 48px; height: 48px; }

/* Card. .ps-product is kept for Martfury's add-to-cart script; its own styles are reset here. */
.td-home .td-deal { flex: 0 0 calc((100% - 5 * 14px) / 6.5); min-width: 172px; scroll-snap-align: start; position: relative; display: flex; flex-direction: column; margin: 0; padding: 12px 12px 14px; background: #fff; border: 0 !important; border-radius: 12px; box-shadow: 0 1px 2px rgba(11, 22, 56, .05), 0 4px 14px rgba(11, 22, 56, .07); font-family: Inter, system-ui, sans-serif; transition: box-shadow .2s, transform .2s; }
.td-home .td-deal:hover { box-shadow: 0 10px 24px rgba(11, 22, 56, .13); transform: translateY(-2px); }
.td-deal__media { display: block; aspect-ratio: 4 / 3; margin-bottom: 10px; }
.td-deal__media img { width: 100%; height: 100%; object-fit: contain; }
.td-deal__badge { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 9px; border-radius: 999px; letter-spacing: -.2px; }
.td-deal__title { display: block; font-size: 15px; font-weight: 500; line-height: 1.35; color: #141a2e !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.td-deal__title:hover { color: var(--navy-2) !important; text-decoration: underline; }
.td-deal__rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8a90a0; margin-bottom: 2px; }
.td-stars { --rating: 0; position: relative; display: inline-block; font-size: 13px; line-height: 1; letter-spacing: 1px; color: #d9dce3; }
.td-stars::before { content: '★★★★★'; }
.td-stars::after { content: '★★★★★'; position: absolute; left: 0; top: 0; width: calc(var(--rating) / 5 * 100%); overflow: hidden; color: var(--yellow-2); }
.td-deal__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.td-deal__price > span:first-child { font-size: 22px; font-weight: 800; color: var(--red); letter-spacing: -.5px; line-height: 1.1; }
.td-deal__price:not(.sale) > span:first-child { color: var(--ink); }
.td-deal__price small, .td-deal__price del { font-size: 14px; font-weight: 400; color: #8a90a0; }
.td-deal__cta { margin-top: auto; position: static !important; opacity: 1 !important; visibility: visible !important; transform: none !important; display: block !important; padding: 0 !important; border: 0 !important; background: none !important; }
.td-deal__btn { display: flex !important; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; border-radius: 7px; background: var(--yellow); color: var(--ink) !important; font-size: 15px; font-weight: 700; letter-spacing: -.1px; transition: background .15s; }
.td-deal__btn:hover { background: var(--yellow-2); }
.td-deal__btn i { font-size: 16px; }
.td-deal__btn--muted { background: var(--soft); }
.td-deal__btn:focus-visible, .td-deal__title:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }

/* ---------- Bottom banners ---------- */
.td-bottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.td-bottom__card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 317 / 148; display: flex; align-items: center; transition: transform .2s, box-shadow .2s; }
.td-bottom__card img { position: absolute; right: 0; top: 0; height: 100%; width: 52%; object-fit: cover; }
.td-bottom--1 { background: #e7f4e4; }
.td-bottom--2 { background: #e2ecf8; }
.td-bottom--3 { background: #fdf0c6; }
.td-bottom__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 0 22px; max-width: 56%; }
.td-bottom__title { font-size: clamp(18px, 1.6vw, 24px); font-weight: 800; color: var(--ink); line-height: 1.08; letter-spacing: -.5px; }
.td-bottom__text { font-size: 13px; color: var(--text); margin-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
    .td-hero { grid-template-columns: 1fr 330px; }
    .td-cats { grid-template-columns: repeat(5, 1fr); }
    .td-assure { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
    .td-home { padding: 14px 20px 32px; }
    .td-hero { grid-template-columns: 1fr; }
    .td-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .td-side__card { aspect-ratio: 352 / 150; }
    .td-promos, .td-collections { grid-template-columns: repeat(2, 1fr); }
    .td-assure__trust li:nth-child(n + 3) { display: none; }
}
@media (max-width: 767px) {
    .td-slider .td-arrow { display: none; }
    .td-home { padding: 10px 14px 28px; }
    .td-slider { aspect-ratio: 4 / 3; }
    .td-slide.has-copy img { width: 100%; opacity: .45; }
    .td-slide.has-copy::after { width: 100%; background: linear-gradient(90deg, var(--navy) 35%, rgba(11, 22, 56, .2)); }
    .td-slide__copy { max-width: 84%; left: 6%; }
    .td-arrow { width: 30px; height: 30px; }
    .td-side { grid-template-columns: 1fr; }
    .td-cats { grid-template-columns: repeat(10, 108px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: -14px; padding-right: 14px; }
    .td-cats::-webkit-scrollbar { display: none; }
    .td-cat { scroll-snap-align: start; }
    .td-promos { grid-template-columns: 1fr 1fr; gap: 10px; }
    .td-collections { grid-template-columns: 1fr; }
    .td-bottom { grid-template-columns: 1fr; }
    .td-assure__seller { flex-wrap: wrap; }
    .td-deals__ends { margin-left: 0; }
    .td-deals__next { display: none; }
    .td-home .td-deal { flex-basis: 46%; min-width: 150px; }
    .td-deal__title { font-size: 14px; }
    .td-deal__price > span:first-child { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    .td-slides, .td-cat__img, .td-promo, .td-side__card, .td-bottom__card, .td-collection__img, .td-home .td-deal { transition: none; }
}

/* "Still in your cart" strip (partials/td-cart-reminder.blade.php) */
.td-cartnudge { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 12px 16px; border: 1px solid #f3d27a; border-radius: var(--radius); background: #fffaeb; }
.td-cartnudge__thumbs { display: flex; flex: none; }
.td-cartnudge__thumbs img { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; border: 2px solid #fff; background: #fff; box-shadow: 0 1px 4px rgba(11, 22, 56, .12); }
.td-cartnudge__thumbs img + img { margin-left: -12px; }
.td-cartnudge__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-cartnudge__text b { font-size: 15px; font-weight: 800; color: var(--ink); }
.td-cartnudge__text span { font-size: 13px; color: var(--text); }
.td-cartnudge__actions { display: flex; gap: 8px; flex: none; }
.td-cartnudge__btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 8px; background: var(--yellow); color: var(--ink) !important; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.td-cartnudge__btn:hover { background: var(--yellow-2); }
.td-cartnudge__btn--ghost { background: #fff; border: 1.5px solid var(--ink); }
@media (max-width: 767px) {
    .td-cartnudge { flex-wrap: wrap; }
    .td-cartnudge__actions { width: 100%; }
    .td-cartnudge__btn { flex: 1; justify-content: center; }
}
