/**
 * Category PLP — mobile app-style UI
 */

.category-app-bar,
.category-app-chips,
.category-filter-sheet-head,
.category-filter-reset-mobile {
  display: none;
}

.category-tsc-toolbar--desktop {
  display: flex;
}

@media (max-width: 991.98px) {
  .category-tsc-bc-wrap--desktop {
    display: none;
  }

  .category-tsc-toolbar--desktop {
    display: none;
  }
  .category-app-bar,
  .category-app-chips {
    display: flex;
  }

  .category-filter-sheet-head,
  .category-filter-reset-mobile {
    display: flex;
  }

  .category-filter-reset-mobile {
    display: block;
  }
  .page-category {
    background: #f0f4f8;
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
  }

  .page-category #main-content,
  .page-category .category-tsc {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
  }

  .page-category .category-tsc-layout,
  .page-category .category-tsc-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .page-category .mobile-nav-tabs {
    display: none !important;
  }

  .page-category .container-tsc {
    overflow-x: clip;
    width: 100%;
    box-sizing: border-box;
  }

  .page-category .site-footer {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    border-radius: 0;
    box-sizing: border-box;
  }

  .page-category .category-tsc {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .page-category .category-tsc-rail {
    display: none;
  }

  /* App top bar */
  .category-app-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 1px 0 rgba(74, 63, 26, 0.06);
  }

  .category-app-back {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f1f5f9;
    color: #5c4f20;
    text-decoration: none;
  }

  .category-app-title {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #5c4f20;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .category-app-count {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #fef8ea;
    padding: 5px 10px;
    border-radius: 999px;
  }

  /* Mobile hero — portrait banner */
  .category-tsc-hero {
    min-height: 0;
    max-height: none;
    margin: 0;
    /* border-radius: 0 0 24px 24px; */
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(74, 63, 26, 0.08);
  }

  .category-tsc-hero picture,
  .category-tsc-hero .category-tsc-hero-bg {
    display: block;
    width: 100%;
    min-height: 200px;
    /* max-height: 42vh; */
    object-fit: cover;
    /* object-position: center top; */
  }

  /* Marquee — compact single row */
  .category-tsc-marquee-wrap {
    padding: 8px 0;
    background: #fff;
    border: none;
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
  }

  .category-tsc-marquee-item {
    font-size: 11px;
    padding: 0 14px;
    gap: 6px;
  }

  .category-tsc-marquee-ico {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
  }

  .category-tsc-marquee-ico svg {
    width: 12px !important;
    height: 12px !important;
  }

  .container-tsc {
    padding-left: 14px;
    padding-right: 14px;
    max-width: 100%;
  }

  /* Sort / filter chips — app-style bar */
  .category-app-chips {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    margin: 0 0 4px;
    position: sticky;
    top: 60px;
    z-index: 25;
    background: #f0f4f8;
    box-shadow: 0 4px 12px rgba(74, 63, 26, 0.04);
  }

  .category-app-chip-sort {
    flex: 1;
    min-width: 0;
  }

  .category-app-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #5c4f20;
    box-shadow: 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='%23122b4f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
  }

  .category-app-chip-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    background: #5c4f20;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 63, 26, 0.18);
  }

  /* Product grid — 2-col app cards */
  .tsc-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
    padding: 6px 0 0;
    width: 100%;
  }

  .page-category .tsc-product-card {
    overflow: hidden;
    position: relative;
    min-width: 0;
  }

  .tsc-product-card {
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(74, 63, 26, 0.07);
  }

  .tsc-card-visual {
    display: block;
    overflow: hidden;
    position: relative;
    min-width: 0;
  }

  .tsc-card-img {
    aspect-ratio: 1 / 1;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    position: relative;
  }

  .tsc-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
  }

  /* Gift/save badges + card body — see category-card-plp.css */

  /* Filter bottom sheet */
  .category-filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
  }

  .category-filter-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .category-tsc-filters {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto !important;
    z-index: 210;
    max-height: 78vh;
    margin: 0 !important;
    padding: 0 20px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 24px 24px 0 0 !important;
    border: none !important;
    background: #fff !important;
    box-shadow: 0 -12px 40px rgba(74, 63, 26, 0.18);
    transform: translateY(105%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
  }

  body.category-filters-open .category-tsc-filters {
    transform: translateY(0);
  }

  .category-filter-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
  }

  .category-filter-sheet-head h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5c4f20;
  }

  .category-filter-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    font-size: 1.4rem;
    line-height: 1;
    color: #5c4f20;
    cursor: pointer;
  }

  .tsc-filter-apply--ghost {
    background: #fff !important;
    color: #5c4f20 !important;
    border: 2px solid #e2e8f0 !important;
    margin-top: 8px;
  }

  .category-tsc-pagination {
    padding-bottom: 16px;
  }
}

@media (max-width: 380px) {
  .tsc-product-grid {
    gap: 10px 8px;
  }
}
