/* Johari shop page — single-store archive mirroring the Technotlife category
 * journey: H1 + count, filter sidebar, sort toolbar, product grid with offer
 * timers, pagination, collapsible bottom description. RTL, theme-aware.
 * Desktop >1100px: sidebar + 4 columns. 640–1100px: drawer + 3 columns.
 * Mobile <640px: drawer + 2 columns.
 */

.jd-shop {
  max-width: 1280px;
  margin-inline: auto;
  padding: 24px 24px 64px;
}

.jd-shop-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.jd-shop-head h1 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
}

.jd-shop-count {
  margin: 0;
  color: var(--jd-muted);
  font-size: 14px;
  white-space: nowrap;
}

.jd-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.jd-shop-filters-btn {
  display: none;
}

.jd-sort {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
  font-size: 14px;
}

.jd-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.jd-sort-label .jd-ico {
  width: 20px;
  height: 20px;
}

.jd-sort-current {
  display: none;
}

.jd-sort-list {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jd-sort-list a {
  display: inline-block;
  padding: 16px 0;
  color: var(--jd-text);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.jd-sort-list a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.jd-sort-list a.is-active {
  color: var(--jd-focus);
  font-weight: 800;
}

.jd-shop-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.jd-shop-side {
  position: sticky;
  top: 110px;
  background: var(--jd-glass-soft);
  border: 1px solid var(--jd-glass-border);
  border-radius: var(--jd-radius-md);
  box-shadow: var(--jd-glass-shadow-sm);
  padding: 20px;
}

.jd-shop-side-head {
  display: none;
}

.jd-shop-filters {
  display: grid;
  gap: 14px;
}

.jd-shop-filters .jd-field {
  display: grid;
  gap: 6px;
}

.jd-shop-filters label,
.jd-shop-filters .jd-field-label {
  font-size: 13px;
  font-weight: 700;
}

.jd-shop-filters input:not([type="checkbox"]),
.jd-shop-filters select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--jd-line);
  border-radius: 10px;
  background: var(--jd-bg);
  color: var(--jd-text);
  padding: 8px 12px;
  font-size: 14px;
}

.jd-search-field {
  display: flex;
  gap: 8px;
}

.jd-search-field input {
  flex: 1;
  min-width: 0;
}

.jd-clear-search {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--jd-line);
  background: var(--jd-surface);
  color: var(--jd-text);
  font-size: 13px;
  cursor: pointer;
}

.jd-price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jd-price-range input {
  flex: 1;
  min-width: 0;
  direction: ltr;
  text-align: center;
}

.jd-shop-filters .jd-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  cursor: pointer;
}

.jd-shop-filters .jd-button {
  width: 100%;
  min-height: 48px;
}

.jd-shop-overlay {
  display: none;
}

.jd-shop-main {
  min-width: 0;
}

.jd-shop-grid ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.jd-shop-grid ul.products::before,
.jd-shop-grid ul.products::after {
  display: none;
}

.jd-shop-grid ul.products li.product {
  display: flex;
  flex-direction: column;
  gap: 0;
  float: none;
  width: auto;
  margin: 0;
  padding: 16px;
  border-radius: var(--jd-radius-md);
  background: var(--jd-glass-soft);
  border: 1px solid var(--jd-glass-border);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.jd-shop-grid ul.products li.product:hover {
  transform: translateY(-3px);
  border-color: var(--jd-gold);
}

.jd-shop-grid ul.products li.product a img {
  border-radius: 10px;
  aspect-ratio: 1;
  object-fit: contain;
}

.jd-shop-grid ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.4em;
  font-size: 13px;
  line-height: 1.7;
  padding: 8px 0 0;
}

.jd-shop-grid .star-rating {
  color: var(--jd-gold);
  font-size: 12px;
  margin: 4px 0;
}

.jd-shop-grid ul.products li.product .price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--jd-text);
  margin-bottom: 8px;
}

.jd-shop-grid ul.products li.product .price del {
  font-size: 12px;
  font-weight: 400;
  color: var(--jd-muted);
  order: 2;
}

.jd-shop-grid ul.products li.product .price ins {
  text-decoration: none;
  order: 1;
}

.jd-card-offer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 12px;
}

.jd-card-offer-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: #da1e28;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.jd-card-offer time {
  color: #da1e28;
  font-weight: 800;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

.jd-card-stock {
  margin: 0 0 4px;
  color: #b25e09;
  font-size: 12px;
  font-weight: 600;
}

:root[data-johari-theme="dark"] .jd-card-stock {
  color: #f0b46a;
}

.jd-shop-grid ul.products li.product .button {
  margin-top: auto;
  width: 100%;
  min-height: 44px;
  font-size: 13px;
}

.jd-shop-grid .jd-compare-button {
  margin-top: 8px;
  width: 100%;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--jd-line);
  background: transparent;
  color: var(--jd-text);
  font-size: 12px;
  cursor: pointer;
}

.jd-shop-grid .jd-compare-button[aria-pressed="true"] {
  background: var(--jd-action);
  color: var(--jd-on-action);
  border-color: transparent;
}

.jd-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 24px;
}

.jd-pagination a,
.jd-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--jd-line);
  background: var(--jd-bg);
  text-decoration: none;
  font-size: 14px;
}

.jd-pagination .current {
  background: var(--jd-action);
  color: var(--jd-on-action);
  border-color: transparent;
  font-weight: 700;
}

/* Collapsible bottom description. */
.jd-shop-desc {
  margin-bottom: 24px;
  border: 1px solid var(--jd-glass-border);
  border-radius: var(--jd-radius-md);
  background: var(--jd-glass-soft);
}

.jd-shop-desc summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 15px;
}

.jd-shop-desc summary::-webkit-details-marker {
  display: none;
}

.jd-shop-desc summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-inline-start: auto;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
}

.jd-shop-desc details[open] summary::after {
  transform: rotate(135deg);
}

.jd-shop-desc-less {
  display: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--jd-muted);
}

.jd-shop-desc details[open] .jd-shop-desc-more {
  display: none;
}

.jd-shop-desc details[open] .jd-shop-desc-less {
  display: inline;
}

.jd-shop-desc-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--jd-focus);
}

.jd-shop-desc-body {
  padding: 0 20px 20px;
  color: var(--jd-muted);
  font-size: 14px;
  line-height: 2;
  display: grid;
  gap: 12px;
}

.jd-shop-desc-body p,
.jd-shop-desc-body h2,
.jd-shop-desc-body h3 {
  margin: 0;
}

.jd-shop-desc-body h2,
.jd-shop-desc-body h3 {
  color: var(--jd-text);
}

.jd-compare-link {
  font-size: 14px;
}

/* Drawer mode (tablet + mobile). */
@media (max-width: 1100px) {
  .jd-shop-filters-btn {
    display: inline-flex;
  }

  .jd-shop-layout {
    grid-template-columns: 1fr;
  }

  .jd-shop-side {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 200;
    width: min(360px, 90vw);
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(105%);
    transition: transform 0.28s ease;
  }

  [dir="ltr"] .jd-shop-side {
    transform: translateX(-105%);
  }

  .jd-shop-side.is-open {
    transform: none;
  }

  .jd-shop-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .jd-shop-side-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--jd-line);
    background: var(--jd-bg);
    color: var(--jd-text);
    font-size: 16px;
    cursor: pointer;
  }

  .jd-shop-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(12, 20, 25, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .jd-shop-overlay[hidden] {
    display: none;
  }

  body.jd-filters-open {
    overflow: hidden;
  }

  .jd-shop-grid ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .jd-sort-label {
    display: none;
  }

  .jd-sort-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--jd-line);
    border-radius: 999px;
    background: var(--jd-bg);
    color: var(--jd-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }

  .jd-sort-current::after {
    content: "";
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translateY(-2px);
  }

  .jd-sort-list {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 60;
    min-width: 190px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 12px;
    border-radius: 10px;
    background: var(--jd-bg);
    border: 1px solid var(--jd-glass-border);
    box-shadow: var(--jd-glass-shadow);
  }

  .jd-sort.is-open .jd-sort-list {
    display: flex;
  }

  .jd-sort-list a {
    padding: 10px 0;
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .jd-shop {
    padding: 16px 16px 56px;
  }

  .jd-shop-toolbar {
    position: sticky;
    top: 76px;
    z-index: 40;
    background: var(--jd-glass-strong);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
    border: 1px solid var(--jd-glass-border);
    border-radius: 14px;
    padding: 8px;
  }

  .jd-shop-filters-btn {
    flex: 1;
    min-height: 48px;
  }

  .jd-sort {
    flex: 1.4;
    justify-content: flex-end;
  }

  .jd-sort-current {
    flex: 1;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: transparent;
  }
}

@media (max-width: 640px) {
  .jd-shop-grid ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .jd-shop-grid ul.products li.product {
    padding: 12px;
  }

  .jd-shop-grid ul.products li.product .woocommerce-loop-product__title {
    font-size: 12px;
  }

  .jd-shop-grid ul.products li.product .price {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jd-shop-side,
  .jd-shop-grid ul.products li.product,
  .jd-shop-desc summary::after {
    transition: none;
  }

  .jd-shop-grid ul.products li.product:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .jd-shop-side,
  .jd-shop-grid ul.products li.product,
  .jd-shop-desc,
  .jd-shop-toolbar {
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
  }
}

@media print {
  .jd-shop-side,
  .jd-shop-toolbar,
  .jd-pagination {
    display: none;
  }

  .jd-shop-layout {
    grid-template-columns: 1fr;
  }
}

/* Owner: archive price opposite the title, with a distinct brand tone. */
.woocommerce ul.products li.product .price{display:block!important;text-align:end!important;color:var(--jd-price)!important;font-weight:800!important;margin-block:12px 18px!important}.woocommerce ul.products li.product .price ins{color:inherit!important}.woocommerce ul.products li.product .price del{color:var(--jd-muted)!important}
