/* ============================================================
   MEND — shop depth styles
   Search/sort · product detail view · reviews · related · recent
   ============================================================ */

/* ---------- search + sort ---------- */
.shop-tools {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between; margin-bottom: 1.6rem;
}
.search { position: relative; flex: 1 1 320px; max-width: 460px; }
.search svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-faint); pointer-events: none; }
.search input {
  width: 100%; font-family: inherit; font-size: .9rem; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: .8rem 1.1rem .8rem 2.7rem; transition: border-color .25s, background .25s;
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { outline: none; border-color: var(--brass); background: var(--paper); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.shop-tools__right { display: flex; align-items: center; gap: 1.4rem; }
#shop-count { font-size: .82rem; color: var(--ink-faint); white-space: nowrap; }
.sort { display: flex; align-items: center; gap: .5rem; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.sort select {
  font-family: inherit; font-size: .85rem; text-transform: none; letter-spacing: 0;
  color: var(--ink); background: transparent; border: none; border-bottom: 1px solid var(--line);
  padding: .35rem 1.4rem .35rem .2rem; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8577' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .1rem center; background-size: 14px;
}
.sort select:focus { outline: none; border-bottom-color: var(--brass); }

/* ---------- concierge picks banner ---------- */
#shop-pinned {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.6rem; padding: .85rem 1.2rem;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  font-size: .88rem; color: var(--ink-soft);
  animation: pinIn .45s var(--ease);
}
@keyframes pinIn { from { opacity: 0; transform: translateY(-8px); } }
#shop-pinned b { color: var(--ink); }
#shop-pinned button {
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); transition: all .2s;
}
#shop-pinned button:hover { border-color: var(--brass); }

/* ---------- card additions ---------- */
.card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-rate { font-size: 10px; color: var(--brass); font-weight: 600; white-space: nowrap; }
.card-rate i { color: var(--ink-faint); font-style: normal; }
.card-low {
  position: absolute; left: .7rem; bottom: .7rem; z-index: 2;
  background: rgb(217 122 148 / .95); color: #fff; font-size: 9px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: .3rem .55rem; border-radius: 6px;
  transition: opacity .3s;
}
.card:hover .card-low { opacity: 0; }

/* ---------- recently viewed ---------- */
#recent { padding: 0 0 clamp(4rem, 9vw, 7rem); }
.recent-h { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 1.2rem; }
.recent-row { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .6rem; }
.rc { flex: none; width: 150px; text-align: left; }
.rc img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 11px; background: var(--paper-2); margin-bottom: .5rem; transition: transform .5s var(--ease); }
.rc:hover img { transform: scale(1.04); }
.rc-n { display: block; font-size: .82rem; font-family: var(--serif); line-height: 1.25; }
.rc-p { display: block; font-size: .8rem; color: var(--ink-faint); margin-top: .15rem; }

/* ============================================================
   PRODUCT DETAIL VIEW
   ============================================================ */
#pdp {
  position: fixed; inset: 0; z-index: 89; display: flex; justify-content: flex-end;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
#pdp.open { opacity: 1; visibility: visible; }
.pdp-back { position: absolute; inset: 0; background: rgba(20,18,13,.55); backdrop-filter: blur(4px); }
.pdp-sheet {
  position: relative; z-index: 2; width: min(1080px, 100%); height: 100%;
  background: var(--paper); overflow: hidden;
  box-shadow: -40px 0 90px -40px rgba(0,0,0,.5);
  transform: translateX(4%); transition: transform .5s var(--ease);
  display: flex; flex-direction: column;
}
#pdp.open .pdp-sheet { transform: none; }
.pdp-close {
  position: absolute; top: 1.1rem; right: 1.1rem; z-index: 5; width: 42px; height: 42px;
  border-radius: 50%; background: rgb(250 247 240 / .92); display: grid; place-items: center;
  backdrop-filter: blur(6px); border: 1px solid var(--line); transition: transform .3s var(--ease);
}
.pdp-close:hover { transform: rotate(90deg); }
.pdp-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.pdp-grid { display: grid; grid-template-columns: 1.05fr 1fr; }
.pdp-media { background: var(--paper-2); padding: clamp(1rem, 2.5vw, 2rem); position: sticky; top: 0; align-self: start; }
.pdp-main { border-radius: 16px; overflow: hidden; background: var(--paper); aspect-ratio: 4/5; }
.pdp-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.pdp-main:hover img { transform: scale(1.06); }
.pdp-thumbs { display: flex; gap: .6rem; margin-top: .8rem; }
.pdp-thumb { width: 68px; aspect-ratio: 4/5; border-radius: 9px; overflow: hidden; border: 1.5px solid transparent; background: var(--paper); transition: border-color .25s; }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumb.active { border-color: var(--brass); }
.pdp-thumbs:has(.pdp-thumb:only-child) { display: none; }

.pdp-info { padding: clamp(2rem, 4vw, 3.4rem) clamp(1.4rem, 3.4vw, 3rem); }
.pdp-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); border: 1px solid var(--line); padding: .35rem .7rem; border-radius: 6px; margin-bottom: 1rem; }
.pdp-info h2 { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 600; line-height: 1.08; letter-spacing: -.02em; margin-bottom: .6rem; }
.pdp-rate { display: flex; align-items: center; gap: .6rem; font-size: .84rem; margin-bottom: 1rem; }
.pdp-rate .s { color: var(--brass); letter-spacing: .06em; }
.pdp-rate a { color: var(--ink-faint); text-decoration: underline; text-underline-offset: 3px; }
.pdp-rate a:hover { color: var(--ink); }
.pdp-price { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin-bottom: 1.1rem; }
.pdp-desc { font-size: .96rem; color: var(--ink-soft); margin-bottom: 1.3rem; }
.pdp-areas { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.8rem; }
.pdp-areas span { font-size: .74rem; padding: .35rem .8rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); }

.pdp-opt { margin-bottom: 1.5rem; }
.pdp-optlabel { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .7rem; }
.pdp-optlabel b { color: var(--ink); text-transform: none; letter-spacing: .02em; font-weight: 600; }
.pdp-optlabel em { color: var(--rose); font-style: normal; text-transform: none; letter-spacing: .02em; }
.pdp-swatches { display: flex; gap: .6rem; }
.pdp-sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); position: relative; transition: transform .2s; }
.pdp-sw:hover { transform: scale(1.1); }
.pdp-sw.active::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--brass); }
.pdp-sizes { display: flex; flex-wrap: wrap; gap: .5rem; }
.pdp-size {
  min-width: 52px; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 9px;
  font-size: .85rem; font-weight: 500; transition: all .2s;
}
.pdp-size:hover { border-color: var(--brass); }
.pdp-size.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
#pdp.needsize .pdp-sizes { animation: shake .4s; }
#pdp.needsize .pdp-size { border-color: var(--rose); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.pdp-buy { display: flex; gap: .7rem; margin: 1.8rem 0 1rem; }
.pdp-qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; flex: none; }
.pdp-qty button { width: 40px; height: 100%; font-size: 1.1rem; color: var(--ink-soft); }
.pdp-qty button:hover { color: var(--ink); }
.pdp-qty span { min-width: 30px; text-align: center; font-weight: 600; font-size: .9rem; }
.pdp-add {
  flex: 1; background: var(--ink); color: var(--paper); border-radius: 11px; padding: 1rem;
  font-size: .92rem; font-weight: 600; letter-spacing: .01em; transition: background .25s, transform .2s;
}
.pdp-add:hover { background: #000; transform: translateY(-1px); }

.pdp-stock { display: flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.pdp-stock .dot { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--sage-400)); }
.pdp-stock.low { color: var(--rose); }
.pdp-stock.low .dot { background: var(--rose); }

.pdp-wish { font-size: .85rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: .6rem 1.2rem; transition: all .25s; }
.pdp-wish:hover { border-color: var(--brass); color: var(--ink); }
.pdp-wish.active { color: var(--rose); border-color: var(--rose); }

.pdp-assure { list-style: none; margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); display: grid; gap: .55rem; }
.pdp-assure li { font-size: .84rem; color: var(--ink-soft); display: flex; gap: .6rem; }
.pdp-assure li::before { content: '—'; color: var(--brass); }

/* ---------- reviews ---------- */
.pdp-reviews { padding: clamp(2.5rem, 5vw, 4rem) clamp(1.4rem, 3.4vw, 3rem); border-top: 1px solid var(--line); background: var(--paper-2); }
.pdp-reviews h3, .pdp-related h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin-bottom: 1.8rem; }
.rev-grid { display: grid; grid-template-columns: 260px 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.rev-summary { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem; text-align: center; }
.rev-big { font-family: var(--serif); font-size: 3rem; line-height: 1; font-weight: 600; }
.rev-stars { color: var(--brass); margin: .4rem 0 .2rem; letter-spacing: .08em; }
.rev-count { font-size: .78rem; color: var(--ink-faint); margin-bottom: 1.2rem; }
.rev-bars { display: grid; gap: .35rem; }
.rev-bar { display: flex; align-items: center; gap: .5rem; font-size: .72rem; color: var(--ink-faint); }
.rev-bar i { flex: 1; height: 5px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.rev-bar b { display: block; height: 100%; background: var(--brass); border-radius: 3px; }
.rev-bar em { font-style: normal; min-width: 24px; text-align: right; }
.rev-list { display: grid; gap: 1rem; }
.rev { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; }
.rev header { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.rev-av { width: 34px; height: 34px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; color: var(--brass); flex: none; }
.rev header b { font-size: .85rem; display: block; }
.rev header span { font-size: .74rem; color: var(--ink-faint); }
.rev-s { margin-left: auto; color: var(--brass); font-size: .78rem; }
.rev p { font-size: .92rem; color: var(--ink-soft); line-height: 1.55; }

/* ---------- related ---------- */
.pdp-related { padding: clamp(2.5rem, 5vw, 4rem) clamp(1.4rem, 3.4vw, 3rem); }
.rel-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.rel { text-align: left; }
.rel img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 11px; background: var(--paper-2); margin-bottom: .55rem; transition: transform .5s var(--ease); }
.rel:hover img { transform: scale(1.04); }
.rel-n { display: block; font-family: var(--serif); font-size: .86rem; line-height: 1.25; }
.rel-p { display: block; font-size: .8rem; color: var(--ink-faint); margin-top: .15rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pdp-grid { grid-template-columns: 1fr; }
  .pdp-media { position: static; }
  .pdp-main { aspect-ratio: 1/1; }
  .rev-grid { grid-template-columns: 1fr; }
  .rel-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .shop-tools { flex-direction: column; align-items: stretch; }
  .shop-tools__right { justify-content: space-between; }
  .search { max-width: none; }
  .pdp-buy { flex-wrap: wrap; }
  .pdp-add { flex: 1 1 100%; }
}
