/* assets/css/product.css */

:root{
  --p-text:#111;
  --p-muted: rgba(0,0,0,.62);
  --p-line: rgba(0,0,0,.10);
  --p-bg:#fff;

  --p-card:#fff;
  --p-shadow: 0 10px 28px rgba(0,0,0,.08);

  --p-accent:#ff6a00;     /* оранжевый */
  --p-accent-2:#e35f00;

  --p-radius:14px;
  --p-radius-sm:12px;

  --p-font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Page */
.product-page{
  padding: 10px 0 18px;
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--p-font);
}

.p-wrap{
  display: grid;
  gap: 14px;
}

/* Title */
.p-title{
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* Main block */
.p-main{
  display: grid;
  gap: 14px;
}

/* “Card” containers */
.p-card{
  background: var(--p-card);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  overflow: hidden;
}

/* =========================================
   GALLERY
   ========================================= */
.p-gallery{
  padding: 10px;
}

.p-gallery__main{
  position: relative;
  border-radius: var(--p-radius-sm);
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  overflow: hidden;
}

.p-gallery__imgbtn{
  display:block;
  width:100%;
  border:0;
  padding:0;
  background: transparent;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.p-gallery__img{
  display:block;
  width:100%;
  height: 280px;
  object-fit: contain;
  background:#fff;
  padding: 10px;
}

.p-gallery__noimg{
  height: 280px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  gap: 8px;
  color: var(--p-muted);
  font-weight: 800;
}

/* arrows overlay */
.p-gbtn{
  position:absolute;
  top: 10px;
  height: 32px;
  min-width: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(17,17,17,.76);
  color:#fff;
  font-weight: 900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  -webkit-tap-highlight-color: transparent;
}
.p-gbtn:active{ transform: translateY(1px); }
.p-gbtn[disabled]{ opacity:.45; cursor: default; }

.p-gbtn--prev{ left: 10px; }
.p-gbtn--next{ right: 10px; }

.p-gpos{
  position:absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(17,17,17,.76);
  color:#fff;
  font-weight: 900;
  font-size: 13px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.12);
}

/* thumbs row */
.p-thumbs{
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.p-thumb{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 10px;
  overflow:hidden;
  background:#fff;
  height: 44px;
  cursor: pointer;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  -webkit-tap-highlight-color: transparent;
}
.p-thumb:active{ transform: translateY(1px); }
.p-thumb.is-active{
  border-color: var(--p-accent);
  box-shadow: 0 0 0 2px rgba(255,106,0,.18);
}

.p-thumb img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.p-thumb--more{
  background: rgba(0,0,0,.06);
  color: rgba(0,0,0,.80);
  font-weight: 900;
  font-size: 13px;
}

/* =========================================
   INFO
   ========================================= */
.p-info{
  padding: 12px;
}

.p-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.p-brand{
  font-size: 13px;
  color: rgba(0,0,0,.78);
  display:flex;
  align-items:center;
  gap: 8px;
}

.p-brand a{
  color: rgba(0,0,0,.86);
  text-decoration:none;
  font-weight: 900;
}
.p-brand a:active{ opacity:.85; }

.p-stock{
  font-size: 12.5px;
  color: var(--p-muted);
  font-weight: 800;
  display:flex;
  align-items:center;
  gap: 6px;
}
.p-stock__dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #11a35a;
}
.p-stock.is-out{ color: rgba(0,0,0,.55); }
.p-stock.is-out .p-stock__dot{ background: #999; }

.p-price{
  display:flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 10px;
}

.p-price__now{
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.p-price__old{
  font-size: 20px;
  color: var(--p-muted);
  text-decoration: line-through;
}

/* qty + button */
.p-buy{
  display:grid;
  gap: 10px;
}

.p-qty{
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.16);
  overflow: hidden;
  background: #fff;
}

.p-qty__btn{
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #111;
  -webkit-tap-highlight-color: transparent;
}

.p-qty__btn:disabled{
  opacity: .35;
  cursor: default;
}

.p-qty__input{
  border: 0;
  outline: none;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  color: #111;
  width: 100%;
  appearance: textfield;
}

.p-qty__input::-webkit-outer-spin-button,
.p-qty__input::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

.p-btn{
  height: 42px;
  border-radius: 999px;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.p-btn:active{ transform: translateY(1px); }
.p-btn:disabled{ opacity: .45; cursor: default; }

.p-btn.is-in-cart{
  background: var(--p-accent);
  border-color: var(--p-accent);
  color: #fff;
}

.p-msg{
  min-height: 16px;
  font-size: 12px;
  color: var(--p-muted);
}

/* Passport */
.p-passport{
  margin-top: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 12px;
}

.p-passport__title{
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 1000;
  color: rgba(0,0,0,.78);
}

.p-passport dl{
  display:grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 12px;
  margin:0;
}
.p-passport dt{
  color: rgba(0,0,0,.62);
  font-weight: 800;
}
.p-passport dd{
  margin:0;
  color: rgba(0,0,0,.88);
  font-weight: 800;
}

/* Sections */
.p-section{
  padding: 12px;
}

.p-section__title{
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 1000;
}

.p-desc{
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(0,0,0,.88);
}

/* Features table */
.p-props{
  width: 100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
}
.p-props td{
  border-top: 1px solid rgba(0,0,0,.08);
  padding: 10px;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.25;
}
.p-props tr:first-child td{ border-top: 0; }

.p-props td:first-child{
  width: 46%;
  color: rgba(0,0,0,.62);
  font-weight: 900;
  background: rgba(0,0,0,.02);
}
.p-props td:last-child{
  color: rgba(0,0,0,.88);
  font-weight: 800;
}

/* =========================================
   LIGHTBOX
   ========================================= */
.p-lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 10150;
  display:none;
}
.p-lightbox.is-open{ display:block; }

.p-lightbox__inner{
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px;
}

.p-lightbox__frame{
  width: min(980px, 96vw);
  max-height: min(90vh, 820px);
  background: #111;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  overflow:hidden;
  display:flex;
  flex-direction: column;
}

.p-lightbox__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px;
  background: rgba(0,0,0,.40);
  color:#fff;
  font-weight: 900;
}

.p-lightbox__close{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
  -webkit-tap-highlight-color: transparent;
}
.p-lightbox__close:active{ transform: translateY(1px); }

.p-lightbox__imgwrap{
  position: relative;
  flex: 1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#0f0f0f;
}

.p-lightbox__img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display:block;
  padding: 10px;
}

.p-lightbox__navbtn{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color:#fff;
  font-weight: 1000;
  cursor:pointer;
}
.p-lightbox__navbtn:active{ transform: translateY(-50%) translateY(1px); }

.p-lightbox__navbtn--prev{ left: 10px; }
.p-lightbox__navbtn--next{ right: 10px; }

/* responsive */
@media (min-width: 860px){
  .p-main{
    grid-template-columns: 1.1fr .9fr;
    align-items: start;
  }
  .p-gallery__img{ height: 340px; }
}

@media (max-width: 360px){
  .p-gallery__img{ height: 250px; }
  .p-thumbs{ gap: 5px; }
  .p-thumb{ height: 42px; }
}
