/* V47 — product gallery and packaging precision fixes.
   Scope: product.html only.
   Built after V46. Does not touch header, drawer, home, store, cart, dashboard, or Firestore logic. */

body.product-v47 .page-hero{
  padding:28px 0 22px!important;
}

body.product-v47 .page-hero .container{
  gap:10px!important;
}

body.product-v47 .page-hero p{
  display:none!important;
}

body.product-v47 .product-gallery-main{
  cursor:zoom-in!important;
  position:relative!important;
}

body.product-v47 .product-gallery-main::after{
  content:"انقر لتكبير الصورة";
  position:absolute;
  left:16px;
  bottom:16px;
  z-index:3;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(5,4,3,.72);
  color:#fff7e8;
  border:1px solid rgba(221,185,103,.20);
  font-size:11px;
  font-weight:900;
  opacity:0;
  transform:translateY(4px);
  transition:opacity .18s ease, transform .18s ease;
  pointer-events:none;
}

body.product-v47 .product-gallery-panel:hover .product-gallery-main::after{
  opacity:1;
  transform:translateY(0);
}

body.product-v47 .product-gallery-thumbs{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  max-width:100%!important;
}

body.product-v47 .product-gallery-thumbs[hidden]{
  display:none!important;
}

body.product-v47 .product-gallery-thumbs button{
  cursor:pointer!important;
  outline:0!important;
}

body.product-v47 .product-gallery-thumbs button:focus-visible{
  outline:2px solid rgba(221,185,103,.75)!important;
  outline-offset:3px!important;
}

body.product-v47 .product-gallery-hint{
  margin-top:14px!important;
}

/* Keep radio circles, remove the strange vertical rectangle/focus box around them. */
body.product-v47 .packaging-options label{
  overflow:hidden!important;
}

body.product-v47 .packaging-options input[type="radio"]{
  appearance:auto!important;
  -webkit-appearance:radio!important;
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  min-height:18px!important;
  max-height:18px!important;
  margin:0 0 0 8px!important;
  padding:0!important;
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  border-radius:50%!important;
  accent-color:#c79542!important;
  flex:0 0 18px!important;
}

body.product-v47 .packaging-options input[type="radio"]:focus,
body.product-v47 .packaging-options input[type="radio"]:focus-visible,
body.product-v47 .packaging-options input[type="radio"]:active{
  outline:0!important;
  box-shadow:none!important;
}

body.product-v47 .packaging-options label:has(input:checked) input[type="radio"]{
  box-shadow:none!important;
}

/* Image lightbox */
body.product-lightbox-open{
  overflow:hidden!important;
}

body.product-v47 .product-lightbox[hidden]{
  display:none!important;
}

body.product-v47 .product-lightbox{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:22px;
}

body.product-v47 .product-lightbox__backdrop{
  position:absolute;
  inset:0;
  background:rgba(5,4,3,.78);
  backdrop-filter:blur(14px);
}

body.product-v47 .product-lightbox__dialog{
  position:relative;
  z-index:1;
  width:min(1060px,100%);
  min-height:min(720px,86vh);
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:18px;
  border-radius:34px;
  background:
    radial-gradient(circle at 50% 0%, rgba(203,159,77,.16), transparent 38%),
    linear-gradient(180deg,#15110b 0%,#080604 100%);
  border:1px solid rgba(221,185,103,.24);
  box-shadow:0 36px 100px rgba(0,0,0,.48);
}

body.product-v47 .product-lightbox__image{
  width:100%;
  min-height:min(620px,72vh);
  border-radius:26px;
  background-size:contain!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-color:#0c0905!important;
  border:1px solid rgba(221,185,103,.20);
}

body.product-v47 .product-lightbox__caption{
  margin:0;
  text-align:center;
  color:rgba(255,247,229,.72);
  font-size:13px;
  font-weight:800;
}

body.product-v47 .product-lightbox__close,
body.product-v47 .product-lightbox__nav{
  position:absolute;
  z-index:3;
  border:1px solid rgba(221,185,103,.20);
  background:rgba(255,247,229,.94);
  color:#0f0b06;
  box-shadow:0 14px 38px rgba(0,0,0,.28);
  cursor:pointer;
}

body.product-v47 .product-lightbox__close{
  top:14px;
  left:14px;
  width:42px;
  height:42px;
  border-radius:50%;
  font-size:26px;
  line-height:1;
}

body.product-v47 .product-lightbox__nav{
  top:50%;
  transform:translateY(-50%);
  width:44px;
  height:58px;
  border-radius:999px;
  font-size:34px;
  line-height:1;
}

body.product-v47 .product-lightbox__nav--prev{
  right:18px;
}

body.product-v47 .product-lightbox__nav--next{
  left:18px;
}

@media(max-width:680px){
  body.product-v47 .product-gallery-main::after{
    opacity:1;
    transform:none;
    left:12px;
    bottom:12px;
    font-size:10px;
    padding:6px 10px;
  }

  body.product-v47 .product-gallery-thumbs{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    overflow:visible!important;
    padding-bottom:0!important;
  }

  body.product-v47 .product-gallery-thumbs button{
    min-width:0!important;
    height:72px!important;
  }

  body.product-v47 .product-lightbox{
    padding:10px;
  }

  body.product-v47 .product-lightbox__dialog{
    min-height:80vh;
    padding:10px;
    border-radius:24px;
  }

  body.product-v47 .product-lightbox__image{
    min-height:70vh;
    border-radius:18px;
  }

  body.product-v47 .product-lightbox__close{
    top:10px;
    left:10px;
    width:38px;
    height:38px;
  }

  body.product-v47 .product-lightbox__nav{
    width:38px;
    height:50px;
    font-size:30px;
  }

  body.product-v47 .product-lightbox__nav--prev{
    right:10px;
  }

  body.product-v47 .product-lightbox__nav--next{
    left:10px;
  }
}
