/* ==========================================================================
   Juoto Studio — Product card page (Product listing section + product card)
   Separate file: load it after jt-theme.css on the listing page + editor preview.
   Uses the same font, colours (color schemes) and radius variables as jt-theme.css.
   Classes: jt-pl-* (listing) and jt-lc-* (listing card)
   ========================================================================== */

.jt-pl {
  --jt-pl-cols: 4; --jt-pl-gap: 24px;
  --jt-lc-radius: 12px; --jt-lc-pad: 12px; --jt-lc-title: 15px; --jt-lc-title-w: 500; --jt-lc-lines: 2; --jt-lc-price: 15px;
  --jt-lc-ratio: 4 / 5; --jt-lc-atc-r: 8px;
  display: flex; flex-direction: column; gap: 22px;
  font-family: var(--jt-font-b);
}

/* ---------- heading ---------- */
.jt-pl__head { display: flex; flex-direction: column; gap: 8px; text-align: var(--jt-align, left); }
.jt-pl__title { margin: 0; font-family: var(--jt-font-h); font-size: var(--jt-h-size, 38px); font-weight: var(--jt-h-weight, 700); line-height: 1.1; letter-spacing: var(--jt-h-ls, -0.01em); text-transform: var(--jt-h-case, none); color: var(--jt-h-color, var(--jt-text)); }
.jt-pl__sub { margin: 0; max-width: 640px; color: var(--jt-muted); margin-left: var(--jt-ml, 0); margin-right: var(--jt-mr, auto); }

/* ---------- filter + sort bar ---------- */
.jt-pl__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 10px 0; border-bottom: 1px solid var(--jt-line); }
.jt-pl__bar--sticky { position: sticky; top: 0; z-index: 20; background: var(--jt-bg); }
.jt-pl__filters { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.jt-pl__chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--jt-line); border-radius: 999px;
  background: transparent; color: var(--jt-text); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.jt-pl__chip:hover { border-color: var(--jt-text); }
.jt-pl__chip.jt-is-on { background: var(--jt-btn-bg, var(--jt-text)); border-color: var(--jt-btn-bg, var(--jt-text)); color: var(--jt-btn-fg, var(--jt-bg)); }
/* tabs style */
.jt-pl__filters--tabs { gap: 2px 22px; }
.jt-pl__filters--tabs .jt-pl__chip { height: 38px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--jt-muted); }
.jt-pl__filters--tabs .jt-pl__chip:hover { color: var(--jt-text); }
.jt-pl__filters--tabs .jt-pl__chip.jt-is-on { background: none; color: var(--jt-text); border-bottom-color: var(--jt-text); }

.jt-pl__tools { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.jt-pl__count { font-size: 14px; color: var(--jt-muted); white-space: nowrap; }
.jt-pl__select { position: relative; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--jt-muted); }
.jt-pl__select > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.jt-pl__select select {
  height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--jt-line); border-radius: 0.5rem; background: var(--jt-bg); color: var(--jt-text);
  font: 500 14px/1 var(--jt-font-b); cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.jt-pl__select select:focus { outline: 2px solid color-mix(in srgb, var(--jt-accent) 40%, transparent); outline-offset: 1px; }

/* ---------- grid ---------- */
.jt-pl__grid { display: grid; grid-template-columns: repeat(var(--jt-pl-cols), minmax(0, 1fr)); gap: calc(var(--jt-pl-gap) * 1.4) var(--jt-pl-gap); }
.jt-pl__item { min-width: 0; }
.jt-pl__empty { margin-top: 8px; }

/* ---------- pagination ---------- */
.jt-pl__pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 12px; }
.jt-pl__pg {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--jt-line); border-radius: 0.5rem;
  color: var(--jt-text); font-size: 14px; font-weight: 500; text-decoration: none; transition: background .2s, border-color .2s;
}
.jt-pl__pg:hover { border-color: var(--jt-text); }
.jt-pl__pg.jt-is-on { background: var(--jt-btn-bg, var(--jt-text)); border-color: var(--jt-btn-bg, var(--jt-text)); color: var(--jt-btn-fg, var(--jt-bg)); }
.jt-pl__pg.jt-is-off { opacity: .35; pointer-events: none; }
.jt-pl__pg svg { width: 16px; height: 16px; }
.jt-pl__dots { padding: 0 4px; color: var(--jt-muted); }
.jt-pl__more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.jt-pl__more small { color: var(--jt-muted); font-size: 13px; }
.jt-pl__more-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 180px; height: 46px; padding: 0 26px;
  border: 1px solid var(--jt-text); border-radius: var(--jt-btn-radius, 0.5rem); color: var(--jt-text); font-weight: 600; text-decoration: none;
  transition: background .2s, color .2s;
}
.jt-pl__more-btn:hover { background: var(--jt-text); color: var(--jt-bg); }
.jt-pl__more-btn.jt-is-busy { opacity: .6; pointer-events: none; }

/* ==========================================================================
   Product card (jt-lc)
   ========================================================================== */
.jt-lc { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: var(--jt-lc-radius); color: var(--jt-text); transition: transform .35s var(--jt-ease-out, ease), box-shadow .35s, border-color .25s; }
.jt-lc__media { position: relative; overflow: hidden; border-radius: var(--jt-lc-radius); background: var(--jt-lc-img-bg, var(--jt-surface)); }
.jt-lc__img { display: block; position: relative; aspect-ratio: var(--jt-lc-ratio); }
.jt-lc--natural .jt-lc__img { aspect-ratio: auto; }
.jt-lc__img > img, .jt-lc__img > .jt-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--jt-ease-out, ease), opacity .5s; }
.jt-lc--natural .jt-lc__img > img:first-child { position: relative; height: auto; }
.jt-lc--fit-contain .jt-lc__img > img { object-fit: contain; padding: 6%; }
.jt-lc__img2 { opacity: 0; }

/* image hover */
.jt-lc--img-zoom:hover .jt-lc__img > img:first-child, .jt-lc--img-zoom:hover .jt-lc__img > .jt-ph { transform: scale(1.07); }
.jt-lc--img-second.jt-lc--has-2:hover .jt-lc__img2 { opacity: 1; }
.jt-lc--img-second.jt-lc--has-2:hover .jt-lc__img > img:first-child { opacity: 0; }

/* card styles */
.jt-lc--boxed { padding: var(--jt-lc-pad); background: var(--jt-lc-bg, var(--jt-surface)); }
.jt-lc--boxed .jt-lc__media { border-radius: calc(var(--jt-lc-radius) * .7); background: var(--jt-lc-img-bg, var(--jt-bg)); }
.jt-lc--bordered { padding: var(--jt-lc-pad); background: var(--jt-lc-bg, var(--jt-bg)); border: 1px solid var(--jt-line); }
.jt-lc--bordered .jt-lc__media { border-radius: calc(var(--jt-lc-radius) * .7); }
.jt-lc--minimal .jt-lc__media { border-radius: 0; }
.jt-lc--minimal { border-radius: 0; }
.jt-lc--overlay .jt-lc__info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 40px 14px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; border-radius: 0 0 var(--jt-lc-radius) var(--jt-lc-radius);
}
.jt-lc--overlay .jt-lc__vendor, .jt-lc--overlay .jt-lc__price s, .jt-lc--overlay .jt-lc__rating small { color: rgba(255,255,255,.75); }
.jt-lc--overlay .jt-lc__title a, .jt-lc--overlay .jt-lc__now { color: #fff; }

/* shadows + hover */
.jt-lc--shadow-soft { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 26px -18px rgba(0,0,0,.35); }
.jt-lc--shadow-strong { box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 24px 44px -22px rgba(0,0,0,.45); }
.jt-lc--hover-lift:hover { transform: translateY(-4px); }
.jt-lc--hover-shadow:hover { box-shadow: 0 2px 6px rgba(0,0,0,.05), 0 26px 46px -22px rgba(0,0,0,.4); }
.jt-lc--hover-border:hover { box-shadow: 0 0 0 1.5px var(--jt-text); }
.jt-lc--minimal.jt-lc--hover-lift:hover, .jt-lc--standard.jt-lc--hover-lift:hover { transform: none; }
.jt-lc--minimal.jt-lc--hover-lift:hover .jt-lc__media, .jt-lc--standard.jt-lc--hover-lift:hover .jt-lc__media { transform: translateY(-4px); box-shadow: 0 18px 34px -22px rgba(0,0,0,.45); }
.jt-lc__media { transition: transform .35s var(--jt-ease-out, ease), box-shadow .35s; }

/* ---------- info ---------- */
.jt-lc__info { display: flex; flex-direction: column; gap: 5px; padding-top: 12px; flex: 1; }
.jt-lc--align-center .jt-lc__info { align-items: center; text-align: center; }
.jt-lc--align-right .jt-lc__info { align-items: flex-end; text-align: right; }
.jt-lc__vendor { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--jt-muted); }
.jt-lc__title { margin: 0; font-family: var(--jt-font-b); font-size: var(--jt-lc-title); font-weight: var(--jt-lc-title-w); line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--jt-lc-lines); overflow: hidden; }
.jt-lc__title a { color: inherit; text-decoration: none; }
.jt-lc__title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.jt-lc__rating { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.jt-lc__rating small { color: var(--jt-muted); }
.jt-lc__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: var(--jt-lc-price); }
.jt-lc--align-center .jt-lc__price { justify-content: center; }
.jt-lc--align-right .jt-lc__price { justify-content: flex-end; }
.jt-lc__now { font-weight: 600; }
.jt-lc__now.jt-is-sale { color: var(--jt-sale); }
.jt-lc__price s { font-size: .86em; color: var(--jt-muted); }

/* ---------- badges ---------- */
.jt-lc__badges { position: absolute; z-index: 3; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.jt-lc--badge-top-right .jt-lc__badges { left: auto; right: 10px; align-items: flex-end; }
.jt-lc--badge-bottom-left .jt-lc__badges { top: auto; bottom: 10px; flex-direction: column-reverse; }
.jt-lc__badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .01em; border-radius: 999px; color: #fff; background: var(--jt-text); }
.jt-lc--shape-rounded .jt-lc__badge { border-radius: 6px; }
.jt-lc--shape-square .jt-lc__badge { border-radius: 0; }
.jt-lc__badge--sale { background: var(--jt-lc-sale-bg, var(--jt-sale)); }
.jt-lc__badge--new { background: var(--jt-lc-new-bg, var(--jt-text)); color: var(--jt-bg); }
.jt-lc__badge--soldout { background: color-mix(in srgb, var(--jt-text) 70%, transparent); }
.jt-lc--soldout .jt-lc__img { opacity: .6; }

/* ---------- wishlist ---------- */
.jt-lc__wish {
  position: absolute; z-index: 3; top: 10px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--jt-bg) 90%, transparent); color: var(--jt-text); cursor: pointer;
  box-shadow: 0 4px 12px -6px rgba(0,0,0,.35); transition: transform .2s, color .2s;
}
.jt-lc--wish-top-left .jt-lc__wish { right: auto; left: 10px; }
.jt-lc--wish-top-left.jt-lc--badge-top-left .jt-lc__badges, .jt-lc--wish-top-right.jt-lc--badge-top-right .jt-lc__badges { top: 54px; }
.jt-lc__wish:hover { transform: scale(1.08); }
.jt-lc__wish.jt-is-on { color: #e11d48; }
.jt-lc__wish.jt-is-on svg { fill: currentColor; }
.jt-lc__wish svg { width: 18px; height: 18px; }

/* ---------- add to cart ---------- */
.jt-lc__atc {
  --a-bg: var(--jt-lc-atc-bg, var(--jt-btn-bg, var(--jt-accent))); --a-fg: var(--jt-lc-atc-fg, var(--jt-btn-fg, #fff));
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; margin-top: 8px;
  border: 1.5px solid var(--a-bg); border-radius: var(--jt-lc-atc-r); background: var(--a-bg); color: var(--a-fg);
  font: 600 14px/1 var(--jt-font-b); cursor: pointer; white-space: nowrap; transition: filter .2s, transform .2s, background .2s, color .2s, opacity .25s;
}
.jt-lc__atc:hover { filter: brightness(1.08); transform: translateY(-1px); }
.jt-lc__atc:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.jt-lc__atc svg { width: 17px; height: 17px; flex: none; }
.jt-lc--atc-outline .jt-lc__atc { background: transparent; color: var(--jt-lc-atc-bg, var(--jt-text)); border-color: var(--jt-lc-atc-bg, var(--jt-text)); }
.jt-lc--atc-outline .jt-lc__atc:hover { background: var(--jt-lc-atc-bg, var(--jt-text)); color: var(--jt-lc-atc-fg, var(--jt-bg)); filter: none; }
.jt-lc--atc-soft .jt-lc__atc { background: color-mix(in srgb, var(--a-bg) 12%, transparent); color: var(--jt-lc-atc-bg, var(--jt-text)); border-color: transparent; }
.jt-lc--atc-sm .jt-lc__atc { height: 34px; padding: 0 12px; font-size: 13px; }
.jt-lc--atc-lg .jt-lc__atc { height: 48px; padding: 0 22px; font-size: 15px; }
.jt-lc--align-left.jt-lc--atc-below .jt-lc__atc { align-self: flex-start; }
.jt-lc--atc-bottom .jt-lc__atc { align-self: stretch; width: 100%; margin-top: auto; }
.jt-lc--atc-bottom .jt-lc__info { gap: 5px; }
.jt-lc--atc-bottom .jt-lc__price { margin-bottom: 8px; }
/* on image (hover) */
.jt-lc--atc-hover .jt-lc__atc { position: absolute; z-index: 3; left: 10px; right: 10px; bottom: 10px; margin: 0; opacity: 0; transform: translateY(10px); }
.jt-lc--atc-hover:hover .jt-lc__atc, .jt-lc--atc-hover .jt-lc__atc:focus-visible { opacity: 1; transform: none; }
/* round icon on image */
.jt-lc--atc-icon .jt-lc__atc { position: absolute; z-index: 3; right: 10px; bottom: 10px; width: 42px; height: 42px; padding: 0; margin: 0; border-radius: 50%; box-shadow: 0 8px 20px -8px rgba(0,0,0,.45); }
.jt-lc__atc.jt-is-added { filter: none; background: var(--jt-ok, #16a34a); border-color: var(--jt-ok, #16a34a); color: #fff; }

/* touch screens: show hover buttons always */
@media (hover: none) { .jt-lc--atc-hover .jt-lc__atc { opacity: 1; transform: none; } }

/* ---------- mobile ---------- */
@media (max-width: 749px) {
  .jt-pl { gap: 16px; }
  .jt-pl__bar { flex-direction: column; align-items: stretch; }
  .jt-pl__filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px 2px; }
  .jt-pl__filters::-webkit-scrollbar { display: none; }
  .jt-pl__tools { margin-left: 0; justify-content: space-between; }
  .jt-lc__atc { height: 36px; padding: 0 12px; font-size: 13px; }
  .jt-lc--atc-below .jt-lc__atc span { overflow: hidden; text-overflow: ellipsis; }
  .jt-lc__wish { width: 32px; height: 32px; }
}
