/* product.css - product page for Bongo Shi
   Load it after style.css and desktop-layout.css (product.html already does). */

.pd { padding: 6px 9px 0; }

/* back link */
.pd__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 12px;
  color: var(--grey);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.pd__back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* picture */
.pd__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #f0e9dc;
  border-radius: 14px;
  background: #fff;
}
.pd__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.pd__media .card__ph svg { width: 64px; height: 64px; }

/* small pictures under the big one */
.pd__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.pd__thumb { position: relative; flex: none; width: 60px; height: 60px; padding: 0; overflow: hidden; border: 2px solid #f0e9dc; border-radius: 10px; background: #fff; }
.pd__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.pd__thumb.is-on { border-color: var(--orange); }
.pd__thumb:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.pd__code { margin: -6px 0 12px; font-size: 13px; color: var(--grey); }
html[data-theme="dark"] .pd__code { color: #b9b4ac; }

/* size and color pickers */
.pd__opt { margin-top: 20px; }
.pd__opt-head { display: flex; align-items: baseline; gap: 8px; }
.pd__opt-head b { font-size: 14px; font-weight: 600; color: #111; }
.pd__pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pd__pill { display: inline-flex; align-items: center; gap: 7px; min-width: 46px; height: 40px; padding: 0 14px; justify-content: center; border: 1.5px solid #e7dfd0; border-radius: 10px; background: #fff; font-size: 14px; font-weight: 500; color: #111; }
.pd__pill.is-on { border-color: var(--orange); background: #fff1e6; color: #b34d00; font-weight: 600; }
.pd__pill:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.pd__dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.3); flex: none; }
.pd__opt.is-missing .pd__pill { border-color: #b3261e; }

/* delivery of this product: inside / outside Dhaka */
.pd__delivery { margin-top: 8px; padding: 10px 12px; border: 1px solid #f0e9dc; border-radius: 12px; background: #fffdf9; font-size: 13px; color: var(--grey); }
.pd__dz { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pd__dz + .pd__dz { margin-top: 6px; }
.pd__dz b { font-weight: 600; color: #111; text-align: right; }
.pd__dz b small { font-weight: 400; font-size: 12px; color: var(--grey); }
.pd__dz b.is-free { color: var(--green); }
.pd__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* details */
.pd__info { padding: 16px 3px 0; }
.pd__name { margin: 0 0 12px; font-size: 22px; font-weight: 600; line-height: 1.3; color: #111; }
.pd__price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pd__price b { font-size: 28px; font-weight: 600; color: var(--orange); }
.pd__price s { font-size: 16px; color: #999; }
.pd__save {
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 106, 78, 0.1);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.pd__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.pd__label { font-size: 14px; font-weight: 500; color: var(--grey); }
.pd__qty { display: inline-flex; align-items: center; border: 1px solid #e7dfd0; border-radius: 12px; overflow: hidden; }
.pd__qty button { width: 42px; height: 42px; display: grid; place-items: center; color: #222; font-size: 20px; line-height: 1; }
.pd__qty button:disabled { opacity: 0.35; cursor: default; }
.pd__qty button:not(:disabled):active { background: #fff1e6; }
.pd__qty output { min-width: 44px; text-align: center; font-size: 16px; font-weight: 600; color: #111; }

.pd__total { margin-top: 16px; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--grey); }
.pd__total b { font-size: 18px; font-weight: 600; color: #111; }

.pd__add {
  width: 100%;
  height: 52px;
  margin-top: 18px;
  border-radius: 14px;
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.pd__add:active { opacity: 0.85; }
.pd__add:focus-visible, .pd__qty button:focus-visible, .pd__back:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* loading + messages */
.pd--loading .pd__media { background: #f3ede3; border-color: transparent; animation: sk-pulse 1.2s ease-in-out infinite; }
.pd--loading .sk { height: 18px; margin-bottom: 12px; }
.pd--loading .sk--short { width: 45%; }
.pd__msg { padding: 56px 12px; text-align: center; color: var(--grey); font-size: 15px; }
.pd__btn {
  display: inline-block;
  margin-top: 16px;
  padding: 11px 22px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* dark mode */
html[data-theme="dark"] .pd__back { color: #b9b4ad; }
html[data-theme="dark"] .pd__thumb { border-color: #3a3836; background: #fff; }
html[data-theme="dark"] .pd__opt-head b { color: #f5f5f5; }
html[data-theme="dark"] .pd__pill { background: #262422; border-color: #3a3836; color: #f5f5f5; }
html[data-theme="dark"] .pd__pill.is-on { background: rgba(242, 106, 0, 0.2); border-color: var(--orange); color: #ffb27a; }
html[data-theme="dark"] .pd__delivery { background: #262422; border-color: #3a3836; }
html[data-theme="dark"] .pd__dz b { color: #f5f5f5; }
html[data-theme="dark"] .pd__dz b.is-free { color: #5fd1ac; }
html[data-theme="dark"] .pd__media { background: #fff; border-color: #3a3836; }
html[data-theme="dark"] .pd--loading .pd__media { background: #2e2a26; }
html[data-theme="dark"] .pd__name,
html[data-theme="dark"] .pd__total b,
html[data-theme="dark"] .pd__qty output { color: #f5f5f5; }
html[data-theme="dark"] .pd__price s { color: #8d8882; }
html[data-theme="dark"] .pd__save { background: rgba(0, 160, 120, 0.2); color: #5fd1ac; }
html[data-theme="dark"] .pd__label,
html[data-theme="dark"] .pd__total,
html[data-theme="dark"] .pd__msg { color: #b9b4ad; }
html[data-theme="dark"] .pd__qty { border-color: #3a3836; }
html[data-theme="dark"] .pd__qty button { color: #eee; }
html[data-theme="dark"] .pd__qty button:not(:disabled):active { background: #3a2a1d; }


/* buttons: favorite + add to cart + buy now */
.pd__actions { display: flex; gap: 10px; margin-top: 18px; }
.pd__actions .pd__add { flex: 1; width: auto; margin-top: 0; padding: 0 8px; }
.pd__add--outline { background: transparent; color: var(--orange); border: 1.5px solid var(--orange); }
.pd__fav {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1.5px solid #e7dfd0;
  border-radius: 14px;
  color: #777;
}
.pd__fav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pd__fav.is-on { color: var(--orange); border-color: var(--orange); background: rgba(242, 106, 0, 0.08); }
.pd__fav.is-on svg { fill: currentColor; }
.pd__fav:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* description / delivery / payment */
.pd__sec { margin-top: 26px; padding-top: 20px; border-top: 1px solid #f0e9dc; }
.pd__sec h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: #111; }
.pd__desc { font-size: 14px; line-height: 1.7; color: #444; white-space: pre-line; overflow-wrap: anywhere; }
.pd__list { list-style: none; display: grid; gap: 12px; }
.pd__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: #444; }
.pd__list small { display: block; margin-top: 2px; font-size: 12px; color: #888; }
.pd__list b { flex: none; font-weight: 600; color: #111; }
html[data-theme="dark"] .pd__add--outline { background: transparent; }
html[data-theme="dark"] .pd__fav { border-color: #3a3836; color: #b9b4ad; }
html[data-theme="dark"] .pd__fav.is-on { color: var(--orange); border-color: var(--orange); background: rgba(242, 106, 0, 0.16); }
html[data-theme="dark"] .pd__sec { border-top-color: #3a3836; }
html[data-theme="dark"] .pd__sec h2,
html[data-theme="dark"] .pd__list b { color: #f5f5f5; }
html[data-theme="dark"] .pd__desc,
html[data-theme="dark"] .pd__list li { color: #cfcac3; }
html[data-theme="dark"] .pd__list small { color: #8d8882; }

/* desktop (also "Desktop site" mode on phones) */
@media (min-width: 900px) {
  .pd { padding: 0; }
  .pd__back { padding: 0 0 18px; font-size: 15px; }
  .pd__back:hover { color: var(--orange); }

  .pd__layout {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
  .pd__gal { position: sticky; top: calc(var(--header-h) + 24px); }
  .pd__media { border-radius: 16px; }
  .pd__info { padding: 8px 0 0; max-width: 460px; }
  .pd__name { font-size: 32px; margin-bottom: 16px; }
  .pd__price b { font-size: 36px; }
  .pd__price s { font-size: 18px; }
  .pd__row { margin-top: 28px; justify-content: flex-start; gap: 20px; }
  .pd__add { margin-top: 22px; height: 54px; cursor: pointer; transition: opacity .15s ease; }
  .pd__add:hover { opacity: 0.9; }
  .pd__qty button:not(:disabled):hover { background: #fff1e6; cursor: pointer; }
  html[data-theme="dark"] .pd__qty button:not(:disabled):hover { background: #3a2a1d; }
  .pd__actions { margin-top: 22px; }
  .pd__actions .pd__add { margin-top: 0; }
  .pd__fav { width: 54px; height: 54px; cursor: pointer; }
  .pd__fav:hover { border-color: var(--orange); color: var(--orange); }
  .pd__sec { margin-top: 30px; padding-top: 24px; }
  .pd__desc, .pd__list li { font-size: 15px; }
  .pd--loading .pd__info { max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  .pd--loading .pd__media { animation: none; }
}
