/* TopDeals category page (mockup 9). Markup: views/ecommerce/product-category.blade.php. */
.td-catpage { --c-navy: #0b1638; --c-yellow: #ffc812; --c-yellow-2: #ffb800; --c-line: #e7e9ef; --c-soft: #f5f6fa; --c-muted: #6b7385; --c-blue: #1a5fd0; font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--c-navy); }
.td-catpage a { text-decoration: none; }

/* The hero carries the breadcrumb, so Martfury's breadcrumb bar and top gap go on this page. */
main:has(.td-catpage) > .ps-breadcrumb { display: none; }
main:has(.td-catpage) .mt-40 { margin-top: 14px !important; }

/* ---------- Hero + tiles ---------- */
.td-cat-top { display: grid; grid-template-columns: minmax(0, 5.9fr) repeat(var(--tiles, 4), minmax(0, 1fr)); gap: 6px; height: 258px; }
.td-cat-top.is-solo { grid-template-columns: 1fr; }
.td-cat-hero { position: relative; overflow: hidden; border-radius: 10px; background: linear-gradient(105deg, #fbf3e8 0%, #f6eadb 55%, #f1e2cf 100%); display: flex; align-items: center; }
.td-cat-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.td-cat-hero.has-image::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(251, 243, 232, .92) 0%, rgba(251, 243, 232, .75) 34%, rgba(251, 243, 232, 0) 56%); z-index: 1; }
.td-cat-hero__copy { position: relative; z-index: 2; padding: 12px 32px; max-width: 470px; }
.td-cat-crumbs .breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; background: none; font-size: 12.5px; list-style: none; }
.td-cat-crumbs .breadcrumb li, .td-cat-crumbs .breadcrumb a { color: #4a5164 !important; font-size: 12.5px; }
.td-cat-crumbs .breadcrumb li + li::before { content: '›'; padding: 0 6px 0 0; color: #8a90a0; }
.td-cat-hero__label { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--c-yellow); font-size: 11.5px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.td-cat-hero__title { margin: 10px 0 8px; font-size: clamp(26px, 2.4vw, 36px); font-weight: 800; line-height: 1.04; letter-spacing: -1px; color: var(--c-navy); }
.td-cat-hero__title span { display: block; }
.td-cat-hero__text { margin: 0 0 16px; font-size: 15px; line-height: 1.4; color: #2b3245; }
.td-cat-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 8px; background: var(--c-yellow); font-size: 15px; font-weight: 700; color: var(--c-navy) !important; transition: background .15s; }
.td-cat-btn:hover { background: var(--c-yellow-2); }

/* No designer hero yet: three real product photos on the right. */
.td-cat-hero__collage { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); width: 46%; height: 82%; display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }
.td-cat-hero__collage span { display: grid; place-items: center; background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(80, 52, 20, .08); overflow: hidden; padding: 8px; }
.td-cat-hero__collage span:first-child { grid-row: 1 / 3; }
.td-cat-hero__collage img { max-width: 100%; max-height: 100%; object-fit: contain; }

.td-cat-tile { position: relative; overflow: hidden; border-radius: 10px; background: #eef0f4; display: block; color: var(--c-navy) !important; transition: transform .2s, box-shadow .2s; }
.td-cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.td-cat-tile.is-auto { background: linear-gradient(180deg, #f3f5f9 0%, #e9edf4 100%); }
.td-cat-tile.is-auto img { inset: auto 10px 46px; width: calc(100% - 20px); height: 52%; object-fit: contain; mix-blend-mode: multiply; }
.td-cat-tile__copy { position: relative; z-index: 1; display: block; padding: 18px 14px 0; }
.td-cat-tile__copy b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; }
.td-cat-tile__copy span { display: block; margin-top: 6px; font-size: 13.5px; line-height: 1.3; color: #3a4155; }
.td-cat-tile__go { position: absolute; left: 14px; bottom: 14px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; background: var(--c-navy); color: #fff; display: grid; place-items: center; transition: transform .15s; }
.td-cat-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(11, 22, 56, .14); }
.td-cat-tile:hover .td-cat-tile__go { transform: translateX(3px); }

/* ---------- Sub-category strip ---------- */
.td-cat-strip { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.td-cat-strip::-webkit-scrollbar { display: none; }
.td-cat-strip a { flex: 1 1 0; min-width: 104px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--c-navy) !important; }
.td-cat-strip__img { position: relative; display: block; width: 100%; height: 72px; padding: 0; background: #fff; border: 1px solid var(--c-line); border-radius: 8px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.td-cat-strip__img img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.td-cat-strip__name { font-size: 11.5px; font-weight: 500; text-align: center; line-height: 1.25; }
.td-cat-strip a:hover .td-cat-strip__img { border-color: #c9ced9; box-shadow: 0 4px 12px rgba(11, 22, 56, .08); }

/* ---------- Body: filters + products ---------- */
.td-cat-body { margin-top: 18px; }
@media (min-width: 1200px) {
    .td-cat-body { display: grid !important; grid-template-columns: 212px minmax(0, 1fr); gap: 18px; align-items: start; }
    .td-cat-body > .ps-layout__left, .td-cat-body > .ps-layout__right { width: auto !important; max-width: none !important; min-width: 0 !important; flex: none !important; padding: 0 !important; }
    .td-filters .ps-layout__left-container { background: #fff; border: 1px solid var(--c-line); border-radius: 10px; padding: 14px 14px 6px; }
}
.td-filters__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; }
.td-filters__head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--c-navy); }
.td-filters__head a { font-size: 13px; font-weight: 600; color: var(--c-blue) !important; }

/* Restyle Botble's filter blocks (markup from the ecommerce plugin, replaced by AJAX after each change). */
.td-filters .bb-shop-sidebar { padding: 0; background: none; border: 0; }
.td-filters .bb-product-filter { padding: 12px 0; margin: 0 !important; border-top: 1px solid var(--c-line); }
.td-filters .bb-product-filter-title { margin: 0 0 10px !important; padding: 0 !important; border: 0 !important; font-size: 14px !important; font-weight: 700 !important; color: var(--c-navy) !important; font-family: inherit !important; }
.td-filters .bb-product-filter-items { margin: 0; padding: 0; list-style: none; max-height: 236px; overflow-y: auto; scrollbar-width: thin; }
.td-filters .bb-product-filter-items .bb-product-filter-items { max-height: none; padding-left: 12px; }
.td-filters .bb-product-filter-item { margin: 0 0 6px; font-size: 13.5px; color: #2b3245; }
.td-filters .filter-checkbox .bb-product-filter-item, .td-filters .filter-visual .bb-product-filter-item { display: flex; align-items: center; gap: 8px; }
.td-filters .bb-product-filter-item input[type=checkbox] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--c-navy); }
.td-filters .bb-product-filter-item label { margin: 0; font-size: 13.5px; color: #2b3245; cursor: pointer; line-height: 1.3; }
.td-filters .bb-product-filter-link { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 13.5px; color: #2b3245 !important; }
.td-filters .bb-product-filter-link svg, .td-filters .bb-product-filter-link i { width: 14px; height: 14px; font-size: 13px; flex: none; }
.td-filters .bb-product-filter-link.active { font-weight: 700; color: var(--c-navy) !important; }
.td-filters .bb-product-filter-link:hover { color: var(--c-blue) !important; }
.td-filters .bb-product-attribute-swatch-display { width: 14px; height: 14px; border-radius: 50%; flex: none; margin-left: auto; box-shadow: 0 0 0 1px var(--c-line); }
.td-filters .price-slider { height: 4px !important; margin: 10px 8px 16px !important; border: 0 !important; border-radius: 4px; background: #dfe3ec !important; }
.td-filters .price-slider .ui-slider-range { background: var(--c-navy) !important; }
.td-filters .price-slider .ui-slider-handle { top: -6px !important; width: 16px !important; height: 16px !important; margin-left: -8px !important; border-radius: 50% !important; border: 3px solid #fff !important; background: var(--c-navy) !important; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); cursor: grab; }
.td-filters .bb-product-price-filter-info { font-size: 12.5px; color: var(--c-muted); }

/* TopDeals filter templates (views/ecommerce/includes/filters/*) */
.td-filters .td-more-list { max-height: none; overflow: visible; }
.td-filters .td-more-list > .td-extra { display: none; }
.td-filters .td-more-list.is-open > .td-extra, .td-filters .td-more-list.is-searching > .td-extra:not([hidden]) { display: flex; }
.td-filters .td-more-list > [hidden] { display: none !important; }
.td-filters .bb-product-filter-item label { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.td-filter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-filter-count { flex: none; font-size: 12.5px; color: var(--c-muted); font-weight: 400; }
.td-swatch { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.td-more { display: inline-block; margin: 2px 0 0; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--c-blue); cursor: pointer; }
.td-more:hover { text-decoration: underline; }
.td-filter-up { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; color: var(--c-muted) !important; }
.td-filter-up i { font-size: 11px; }
.td-filter-up:hover { color: var(--c-blue) !important; }
.td-filter-current { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--c-navy); }
.td-filter-cats .bb-product-filter-item { margin-bottom: 2px; }
.td-filter-link { display: flex; align-items: baseline; gap: 6px; padding: 3px 0 3px 10px; border-left: 2px solid var(--c-line); font-size: 13.5px; color: #2b3245 !important; }
.td-filter-link .td-filter-name { white-space: normal; }
.td-filter-link:hover { border-left-color: var(--c-yellow); color: var(--c-navy) !important; }
.td-filter-search { width: 100%; height: 34px; margin: 0 0 10px; padding: 0 10px; border: 1px solid var(--c-line); border-radius: 7px; font: inherit; font-size: 13px; color: var(--c-navy); }
.td-filter-search:focus { outline: 0; border-color: var(--c-navy); }

/* ---------- Toolbar ---------- */
.td-cat-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; }
.td-cat-bar h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.4px; color: var(--c-navy); font-family: inherit; }
.td-cat-bar h1 + .td-found { margin-right: auto; padding: 0; font-size: 14px; font-weight: 400; color: var(--c-muted); letter-spacing: 0; }
.td-cat-bar__filter { display: none !important; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--c-line); border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--c-navy); }
.td-cat-bar__sort { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: #2b3245; }
.td-cat-bar__sort select, .td-cat-bar__sort .select2-container .select2-selection { height: 34px !important; min-width: 150px; border: 1px solid var(--c-line) !important; border-radius: 7px !important; background-color: #fff; font-size: 13.5px; color: var(--c-navy); }
.td-cat-bar__views { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.td-cat-bar__views a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--c-line); border-radius: 7px; background: #fff; color: #6b7385 !important; font-size: 16px; }
.td-cat-bar__views li.active a { border-color: var(--c-navy); color: var(--c-navy) !important; box-shadow: inset 0 0 0 1px var(--c-navy); }

/* ---------- Campaign banners ---------- */
.td-cat-campaigns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.td-cat-campaign { position: relative; overflow: hidden; border-radius: 8px; aspect-ratio: 1000 / 320; background: #f3ece2; color: var(--c-navy) !important; }
.td-cat-campaign img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.td-cat-campaign__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; height: 100%; justify-content: center; padding: 0 22px; max-width: 58%; }
.td-cat-campaign__copy b { font-size: clamp(16px, 1.45vw, 21px); font-weight: 800; letter-spacing: -.5px; line-height: 1.05; }
.td-cat-campaign__copy > span:not(.td-cat-campaign__btn) { font-size: 13px; line-height: 1.3; color: #2b3245; }
.td-cat-campaign__btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 7px 14px; border-radius: 18px; background: var(--c-navy); color: #fff; font-size: 12.5px; font-weight: 700; }

/* ---------- Product grid ---------- */
.td-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(182px, 1fr)); gap: 8px; }
.td-grid > .ps-product { margin: 0 !important; height: auto; }
.td-grid .td-card__vendor { display: none; }
.td-grid .td-card__price { font-size: 19px !important; font-weight: 800 !important; letter-spacing: -.4px; }
.td-empty { display: flex; flex-direction: column; gap: 4px; padding: 28px; border: 1px dashed var(--c-line); border-radius: 10px; text-align: center; font-size: 14px; color: var(--c-muted); }
.td-empty b { color: var(--c-navy); font-size: 15px; }
.td-pagination { margin-top: 18px; }
.td-catpage .bb-product-items-wrapper { position: relative; min-height: 200px; }

.td-catpage a:focus-visible, .td-catpage button:focus-visible { outline: 2px solid var(--c-blue); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
    .td-cat-bar__filter { display: inline-flex !important; }
    .td-filters__head { padding: 10px 16px 0; justify-content: flex-end; }
    .td-filters__head h2 { display: none; }
    .td-filters .ps-layout__left-content { padding: 0 16px; }
    .td-cat-bar h1 { flex: none; }
    .td-cat-bar h1 + .td-found { flex: 1 0 50%; }
}
@media (max-width: 1100px) {
    .td-cat-top { grid-template-columns: repeat(var(--tiles, 4), minmax(0, 1fr)); height: auto; }
    .td-cat-hero { grid-column: 1 / -1; min-height: 240px; }
    .td-cat-tile { height: 200px; }
}
@media (max-width: 900px) {
    .td-cat-campaigns { grid-template-columns: 1fr; }
    .td-cat-hero__collage { width: 40%; }
}
@media (max-width: 767px) {
    /* Phone layout (mockup 11): hero card with the picture on the right, swipeable sub-category strip,
       2 x 2 wide tiles (words left, picture right), then the products. */
    main:has(.td-catpage) .mt-40 { margin-top: 10px !important; }
    /* Hero, then the strip, then the tiles: the page becomes one 2-column grid and the top block dissolves. */
    .td-catpage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .td-cat-top { display: contents !important; }
    .td-cat-strip, .td-cat-body { grid-column: 1 / -1; min-width: 0; }
    .td-cat-strip { order: 2; }
    .td-cat-body { order: 4; }
    .td-cat-hero { grid-column: 1 / -1; min-height: 210px; border-radius: 16px; }
    .td-cat-crumbs { display: none; }
    .td-cat-hero__copy { padding: 18px 16px 18px 20px; max-width: 62%; }
    .td-cat-hero__title { font-size: 25px; margin: 10px 0 6px; }
    .td-cat-hero__text { font-size: 13.5px; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .td-cat-btn { padding: 10px 14px; font-size: 13.5px; white-space: nowrap; }
    .td-cat-hero.has-image .td-cat-hero__img { object-position: 70% center; }
    .td-cat-hero.has-image::before { background: linear-gradient(90deg, rgba(251, 243, 232, .95) 0%, rgba(251, 243, 232, .82) 45%, rgba(251, 243, 232, 0) 72%); }
    .td-cat-hero__collage { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 38%; height: 78%; grid-template-columns: 1fr; grid-template-rows: 1fr; }
    .td-cat-hero__collage span:not(:first-child) { display: none; }
    .td-cat-hero__collage span:first-child { grid-row: auto; }

    .td-cat-strip { margin: 4px -15px 4px; padding: 0 15px 2px; gap: 10px; scroll-snap-type: x proximity; }
    .td-cat-strip a { flex: 0 0 30%; min-width: 0; scroll-snap-align: start; }
    .td-cat-strip__img { height: 84px; border-radius: 12px; background: #f6f7fa; border-color: transparent; }
    .td-cat-strip__name { font-size: 12.5px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

    .td-cat-tile { height: 150px; border-radius: 14px; order: 3; }
    .td-cat-tile__copy { padding: 14px 14px 0; max-width: 62%; }
    .td-cat-tile__copy b { font-size: 16px; }
    .td-cat-tile__copy span { font-size: 13px; }
    .td-cat-tile__go { left: 14px; bottom: 12px; width: 32px; height: 32px; }
    .td-cat-tile:not(.is-auto) img { object-position: center top; }
    .td-cat-tile.is-auto img { inset: 12px 8px 12px auto; width: 48%; height: auto; }
    .td-cat-hero { order: 1; }

    .td-cat-body { margin-top: 10px; }
    .td-cat-bar { gap: 8px 10px; }
    .td-cat-bar h1 { font-size: 21px; }
    .td-cat-bar__sort select { min-width: 0; }
    .td-cat-bar__views { display: none; }
    .td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .td-cat-campaign { aspect-ratio: 2.4 / 1; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .td-cat-tile, .td-cat-tile__go, .td-cat-btn { transition: none; }
}

/* ---------- Shop / search results page (views/ecommerce/products.blade.php) ---------- */
.td-search-head { grid-column: 1 / -1; margin: 4px 0 4px; }
.td-search-head h1 { margin: 0 0 10px; font-size: 26px; font-weight: 800; letter-spacing: -.6px; color: var(--c-navy); font-family: inherit; }
.td-search-head h1 span { color: #c79200; }
.td-search-depts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--c-muted); }
.td-search-depts a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--c-line); border-radius: 18px; background: #fff; font-size: 13.5px; font-weight: 500; color: var(--c-navy) !important; }
.td-search-depts a:hover { border-color: var(--c-yellow); background: #fffaeb; }
.td-search-depts small { font-size: 11.5px; color: var(--c-muted); }
.td-cat-bar__title { margin: 0 auto 0 0; font-size: 19px; font-weight: 800; letter-spacing: -.4px; color: var(--c-navy); font-family: inherit; }
.td-cat-bar__title .td-found { font-size: 14px; font-weight: 400; color: var(--c-muted); letter-spacing: 0; }
@media (max-width: 767px) {
    .td-search-head h1 { font-size: 21px; }
    .td-search-depts { flex-wrap: nowrap; overflow-x: auto; margin: 0 -15px; padding: 0 15px 4px; scrollbar-width: none; }
    .td-search-depts a, .td-search-depts span { flex: none; }
}
