/* =====================================================================
   BirTool.az — Product Detail Page  ·  css/pdp.css
   gallery · buy box · trust card · urgency · specs · FAQ · related ·
   mobile sticky add-to-cart bar
   Depends on css/style.css + css/shell.css (chrome)
   ===================================================================== */

.pdp-wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.pdp-breadcrumb { padding: 20px 0 18px; }

/* ===================== TOP: gallery + buy box ===================== */
.pdp-top { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; padding-bottom: 40px; }
@media (max-width: 920px){ .pdp-top { grid-template-columns: 1fr; gap: 28px; } }

/* gallery */
.gallery { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; }
.gallery__main { position: relative; aspect-ratio: 1/1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery__main .badge { position: absolute; top: 16px; left: 16px; z-index: 2; }
.gallery__main .gallery__fav { position: absolute; top: 16px; right: 16px; z-index: 2; }
.gallery__ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray-300); position: relative; }
.gallery__ph svg { width: 42%; height: 42%; }
.gallery__ph::after { content: "Şəkil yoxdur"; position: absolute; bottom: 22px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--gray-400); }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; padding: 40px; }
.gallery__thumbs { display: flex; gap: 10px; }
.gallery__thumb { width: 74px; height: 74px; flex: none; border: 2px solid var(--border); border-radius: var(--radius-md); background: var(--gray-50); display: flex; align-items: center; justify-content: center; color: var(--gray-300); cursor: pointer; transition: border-color var(--dur) var(--ease); padding: 8px; }
.gallery__thumb svg { width: 60%; height: 60%; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb:hover { border-color: var(--gray-400); }
.gallery__thumb.is-active { border-color: var(--primary); }
@media (max-width: 920px){ .gallery { position: static; } }

/* gallery trust card */
.gallery-trust { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.gallery-trust__row { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: var(--fs-sm); font-weight: 600; color: var(--gray-700); }
.gallery-trust__row svg { width: 19px; height: 19px; flex: none; }
.gallery-trust__row .ok { color: var(--success); }
.gallery-trust__row .pri { color: var(--primary); }
.gallery-trust__row b { color: var(--text-strong); }

/* ===================== BUY BOX ===================== */
.buybox { display: flex; flex-direction: column; }
.buybox__badges { display: flex; gap: 8px; margin-bottom: 14px; }
.buybox h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 800; color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.buybox__brand { font-size: var(--fs-sm); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.buybox__rating { display: flex; align-items: center; gap: 10px; margin: 12px 0 20px; flex-wrap: wrap; }
.buybox__rating .stars { display: inline-flex; gap: 1px; }
.buybox__rating .stars svg { width: 17px; height: 17px; }
.buybox__rating .score { font-weight: 800; color: var(--text-strong); }
.buybox__rating .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--gray-300); }
.buybox__rating .meta { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.buybox__rating .views { display: inline-flex; align-items: center; gap: 6px; }
.buybox__rating .views svg { width: 15px; height: 15px; }

/* price block */
.price-block { background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.price-block__row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-block__now { font-size: 2.5rem; font-weight: 900; color: var(--text-strong); letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.price-block__old { font-size: 1.15rem; font-weight: 600; color: var(--gray-400); text-decoration: line-through; white-space: nowrap; }
.price-block__disc { background: var(--primary); color: #fff; font-size: var(--fs-sm); font-weight: 800; padding: 4px 10px; border-radius: var(--radius-sm); }
.price-block__save { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: var(--fs-sm); font-weight: 800; color: var(--success-text); }
.price-block__save svg { width: 16px; height: 16px; }

/* urgency */
.urgency { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 16px; background: var(--warning-bg); border: 1px solid #f3dca0; border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: 700; color: var(--warning-text); }
.urgency svg { width: 18px; height: 18px; flex: none; }
.urgency b { color: var(--primary-active); }

/* short desc */
.buybox__desc { color: var(--gray-600); line-height: 1.65; margin: 20px 0 0; font-size: var(--fs-base); }

/* qty + buy actions */
.buy-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.qty-row { display: flex; align-items: center; gap: 16px; }
.qty-row__label { font-size: var(--fs-sm); font-weight: 700; color: var(--text-strong); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.qty button { width: 44px; height: 46px; border: none; background: var(--surface); color: var(--text-strong); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background var(--dur) var(--ease); }
.qty button svg { width: 16px; height: 16px; }
.qty button:hover { background: var(--gray-100); color: var(--primary); }
.qty input { width: 52px; height: 46px; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; font: inherit; font-weight: 800; font-size: 1.05rem; color: var(--text-strong); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-secondary { display: flex; gap: 10px; }
.buy-secondary .btn { flex: 1; }
.buy-secondary .icon-btn { --size: 50px; }

.cod-note { display: flex; gap: 12px; padding: 14px 16px; background: var(--success-bg); border: 1px solid #bfe7d0; border-radius: var(--radius-md); margin-top: 4px; }
.cod-note svg { width: 20px; height: 20px; flex: none; color: var(--success-text); margin-top: 1px; }
.cod-note p { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--success-text); }
.cod-note p span { font-weight: 500; opacity: .9; }

/* ===================== DETAIL SECTIONS ===================== */
.pdp-detail { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; padding: 44px 0; border-top: 1px solid var(--border); }
@media (max-width: 920px){ .pdp-detail { grid-template-columns: 1fr; gap: 28px; } }
.detail-block + .detail-block { margin-top: 36px; }
.detail-block h2 { font-size: var(--fs-h3); font-weight: 800; color: var(--text-strong); letter-spacing: -0.01em; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.detail-block h2 svg { width: 22px; height: 22px; color: var(--primary); }
.detail-block p { color: var(--gray-600); line-height: 1.75; margin: 0 0 14px; }

/* specs table */
.specs { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.specs tr { border-bottom: 1px solid var(--border); }
.specs tr:last-child { border-bottom: none; }
.specs tr:nth-child(odd) { background: var(--gray-50); }
.specs th { text-align: left; padding: 14px 18px; font-size: var(--fs-sm); font-weight: 700; color: var(--gray-600); width: 42%; }
.specs td { padding: 14px 18px; font-size: var(--fs-sm); font-weight: 700; color: var(--text-strong); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.faq__q { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 18px; background: none; border: none; cursor: pointer; text-align: left; font-size: var(--fs-base); font-weight: 700; color: var(--text-strong); }
.faq__q .chev { margin-left: auto; width: 20px; height: 20px; color: var(--primary); flex: none; transition: transform var(--dur) var(--ease); }
.faq__item.is-open .faq__q .chev { transform: rotate(180deg); }
.faq__a { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height var(--dur) var(--ease), padding var(--dur) var(--ease); }
.faq__item.is-open .faq__a { padding: 0 18px 18px; max-height: 260px; }
.faq__a p { color: var(--gray-600); line-height: 1.65; margin: 0; font-size: var(--fs-sm); }

/* sticky aside (delivery summary on detail) */
.detail-aside { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
@media (max-width: 920px){ .detail-aside { position: static; } }
.detail-aside h3 { font-size: var(--fs-base); font-weight: 800; color: var(--text-strong); margin: 0 0 16px; }
.detail-aside .gallery-trust__row { border-bottom: 1px solid var(--border); }
.detail-aside .gallery-trust__row:last-child { border-bottom: none; }

/* ===================== RELATED ===================== */
.related { padding: 8px 0 56px; }
.related__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1080px){ .related__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px){ .related__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.pc-bottom { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.pc-actions-row { display: flex; gap: 6px; margin-top: var(--space-3); }
.pc-actions-row .icon-btn { --size: 40px; flex: none; }
.pc-actions-row .btn { flex: 1; }
.pc-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray-300); position: relative; }
.pc-ph svg { width: 46%; height: 46%; }
.pc-ph::after { content: "BirTool.az"; position: absolute; bottom: 14px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: var(--gray-300); }
@media (max-width: 760px){ .pc-actions-row .icon-btn { display: none; } }

/* hide global bottom nav + fab on PDP mobile — sticky add-to-cart takes over */
@media (max-width: 920px){
  .botnav, .fab-wa { display: none !important; }
}

/* ===================== MOBILE STICKY ADD-TO-CART ===================== */
.pdp-sticky { display: none; }
@media (max-width: 920px){
  .pdp-sticky {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(15,19,31,.10);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 12px;
  }
  .pdp-sticky__price { display: flex; flex-direction: column; line-height: 1.1; }
  .pdp-sticky__price .now { font-size: 1.3rem; font-weight: 900; color: var(--text-strong); }
  .pdp-sticky__price .old { font-size: var(--fs-xs); color: var(--gray-400); text-decoration: line-through; font-weight: 600; }
  .pdp-sticky .btn { flex: 1; }
  .pdp-has-sticky { padding-bottom: 80px; }
}
