body{
  margin:0;
  background:
    radial-gradient(circle at top left, rgba(255,107,0,.08), transparent 22%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 30%, #f8fafc 100%);
}

.product-container{
  width:100%;
  max-width:1280px;
  margin:24px auto;
  padding:0 16px;

  display:grid;
  grid-template-columns:1.05fr 0.95fr;
  gap:24px;
  align-items:start;
}

.gallery,
.product-info{
  width:100%;
  border-radius:32px;
  overflow:hidden;
}

.gallery{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px;
}

.gallery-main-wrap{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.thumbnails{
  display:flex;
  flex-direction:row;
  gap:12px;
  overflow-x:auto;
  padding-bottom:4px;
}

.thumbnails::-webkit-scrollbar{
  display:none;
}
.thumbnails img{
  width:88px;
  min-width:88px;
  height:88px;
  object-fit:cover;
}
.thumbnails img:hover{
  transform:translateY(-2px);
  border-color:#cbd5e1;
}
.thumbs-navigation{
    display:flex;
    align-items:center;
    gap:10px;
}

.thumb-arrow{
    width:42px;
    height:42px;
    border:none;
    border-radius:50%;
    background:#111827;
    color:#fff;
    font-size:26px;
    cursor:pointer;
    flex-shrink:0;
}

.thumb-arrow:hover{
    opacity:.9;
}
.main-image{
  position:relative;
  overflow:hidden;
  border-radius:24px;
  min-height:540px;
  background:#f8fafc;
}

.main-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px;
  height:44px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.88);
  box-shadow:0 8px 18px rgba(15,23,42,.12);
  cursor:pointer;
  z-index:2;
}

.prev{left:16px}
.next{right:16px}

.image-options-wrap{
  background:#fff;
  border:1px solid #eef2f7;
  border-radius:20px;
  padding:14px;
}

.image-options-title{
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  margin-bottom:12px;
}

.image-options{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.image-option{
  position:relative;
  display:block;
}

.image-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.image-option span{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  width:92px;
  min-height:112px;
  padding:8px;
  border:1px solid #e2e8f0;
  border-radius:18px;
  background:#fff;
  cursor:pointer;
  transition:.25s ease;
  
}

.image-option img{
  width:72px;
  height:72px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid #edf2f7;
}

.image-option small{
  font-size:13px;
  font-weight:800;
  color:#111827;
  text-align:center;
  line-height:1.2;
}

.image-option input:checked + span{
  border-color:#111827;
  box-shadow:0 10px 24px rgba(15,23,42,.12);
  transform:translateY(-2px);
}

.product-info{
  padding:30px;
}

.product-info h1{
  margin:0 0 10px;
  font-size:clamp(2rem, 3vw, 1rem);
  line-height:1.08;
}

.product-info h3{
  margin:0 0 20px;
  color:#475569;
  font-size:1rem;
  line-height:1.7;
  font-weight:500;
}

.price-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.price{
  font-size:22px;
  font-weight:900;
  color:#ff5a1f;
}

.old-price{
  text-decoration:line-through;
  color:#000000;
  font-weight:700;
}

.stock-line{
  margin:10px 0 18px;
  font-weight:800;
}

.product-options{
  margin:18px 0 20px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.option-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.option-title{
  font-weight:800;
  color:#111827;
  font-size:14px;
}

.option-list{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.option-item{
  position:relative;
  display:inline-block;
}

.option-item input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.option-item.is-disabled,
.image-option.is-disabled{
    opacity:.45;
    filter:grayscale(100%);
}

.option-item.is-disabled{
    pointer-events:none;
}

.image-option.is-disabled{
    pointer-events:none;
}

.option-item small,
.option-out{
    display:block;
    margin-top:4px;
    color:#dc2626;
    font-size:12px;
    font-style:normal;
    font-weight:700;
}
.option-item span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  padding:11px 16px;
  border:1px solid #d1d5db;
  border-radius:999px;
  background:#fff;
  cursor:pointer;
  font-weight:700;
  transition:.25s ease;
}

.option-item input:checked + span{
  background:#111827;
  color:#fff;
  border-color:#111827;
}

.option-item span:hover{
  border-color:#111827;
}

.quantity-box{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
.option-slider-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
     position:relative;
    width:100%;
}

.visual-options-slider{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    gap:18px;
    overflow-x:auto;
    scroll-behavior:smooth;
    -webkit-overflow-scrolling:touch;
      padding:10px 14px;
    flex:1;
}

.visual-options-slider::-webkit-scrollbar{
    display:none;
}

.visual-options-slider .image-option{
    flex:0 0 auto;
}

.image-option span{
    width:140px;
    min-height:190px;
    border-radius:28px;
    overflow:hidden;
    background:#fff;
    border:2px solid transparent;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    padding:10px;
    gap:10px;
    transition:.35s ease;
    cursor:pointer;
    box-shadow:0 10px 28px rgba(0,0,0,.08);
}

.image-option:hover span{
    transform:translateY(-5px);
    box-shadow:0 18px 38px rgba(0,0,0,.14);
}

.image-option img{
    width:100%;
    height:130px;
    object-fit:cover;
    border-radius:22px;
    display:block;
}

.image-option small{
    font-size:15px;
    font-weight:900;
    color:#111827;
    text-align:center;
}

.image-option input:checked + span{
    border-color:#111827;
    transform:translateY(-5px) scale(1.02);
    box-shadow:
        0 20px 45px rgba(0,0,0,.18),
        0 0 0 4px rgba(17,24,39,.06);
}

.option-arrow{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:46px;
    height:46px;
    border:none;
    border-radius:50%;
    background:#111827;
    color:#fff;
    font-size:28px;
    font-weight:900;
    cursor:pointer;
    z-index:5;
    box-shadow:0 10px 25px rgba(0,0,0,.15);
}

.option-arrow:first-child{
    left:-22px;
}

.option-arrow:last-child{
    right:-22px;
}



@media(max-width:768px){

    .visual-options-slider{
        gap:12px;
        
    }

    .image-option span{
        width:104px;
        min-height:150px;
        border-radius:22px;
    }

    .image-option img{
        height:96px;
        border-radius:16px;
    }

    .image-option small{
        font-size:13px;
    }



    .option-arrow{
        width:36px;
        height:36px;
        font-size:20px;
    }

    .option-arrow:first-child{
        left:-10px;
    }

    .option-arrow:last-child{
        right:-10px;
    }

}
.q-btn,
.quantity-box input{
  height:46px;
  border-radius:14px;
  border:1px solid #e2e8f0;
  background:#fff;
}

.q-btn{
  width:46px;
  cursor:pointer;
  font-size:1.2rem;
}

.quantity-box input{
  width:72px;
  text-align:center;
  font-weight:700;
}

.btn-buy{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:52px;
  border:none;
  border-radius:18px;
  background:#101828;
  color:#fff;
  text-decoration:none;
  font-weight:800;
  margin-top:12px;
  cursor:pointer;
}

.btn-secondary{
  background:#fff;
  color:#101828;
  border:1px solid #e2e8f0;
}

.trust{
  margin-top:18px;
  padding:18px;
  background:#f8fafc;
  border-radius:20px;
  border:1px solid #eef2f7;
}

.trust p{
  margin:8px 0;
  color:#334155;
}

.order-popup{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.48);
  backdrop-filter:blur(6px);
  justify-content:center;
  align-items:center;
  z-index:9999;
  padding:20px;
}

.order-box{
  background:#fff;
  padding:24px;
  border-radius:24px;
  width:min(560px, 100%);
  box-shadow:0 30px 80px rgba(15,23,42,.22);
  position:relative;
}

.close-btn{
  position:absolute;
  top:14px;
  right:14px;
  border:none;
  background:#fff1f2;
  color:#e11d48;
  width:38px;
  height:38px;
  border-radius:999px;
  cursor:pointer;
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.form-grid .full,
.form-grid .error-banner{
  grid-column:1/-1;
}

.form-grid input,
.form-grid select{
  width:100%;
  height:46px;
  border-radius:14px;
  border:1px solid #e2e8f0;
  padding:0 14px;
}

.livraison{
  display:grid;
  gap:10px;
  margin:16px 0;
}

.livraison label{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px;
  border:1px solid #e2e8f0;
  border-radius:16px;
  background:#fff;
}

.total-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:16px 0;
}

.qty{
  display:flex;
  align-items:center;
  gap:8px;
}

.qty button,
.qty input{
  height:42px;
  border-radius:14px;
  border:1px solid #e2e8f0;
}

.qty button{
  width:42px;
}

.qty input{
  width:70px;
  text-align:center;
}
.order-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ff6b00, #ff5b00);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(123, 63, 242, 0.4);
  transition: all 0.4s ease;
}

.order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(123, 63, 242, 0.5);
}
@media (max-width: 980px){
  .product-container{
    grid-template-columns:1fr;
    padding:0 14px;
  }

  .main-image{
    min-height:360px;
  }

  .price-row{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:8px;
    flex-wrap:wrap;
  }

  .price{
    font-size:17px;
    font-weight:900;
    line-height:1;
  }

  .old-price{
    font-size:12px;
    line-height:1;
  }


}

@media (max-width: 640px){
 .product-container{
    gap:10px !important;
    padding:8px !important;
    margin-top:4px !important;
  }

  .gallery{
    padding:8px !important;
    gap:6px !important;
    border-radius:16px !important;
  }

   .main-image{
    height:340px !important;
    min-height:340px !important;
  }

  .main-image img{
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
    padding:6px;
  }

  .gallery-nav{
    width:32px !important;
    height:32px !important;
    font-size:16px !important;
  }

  .thumbs-navigation{
    margin-top:2px !important;
    gap:4px !important;
  }

  .thumbnails{
    gap:5px !important;
  }

  .thumbnails img{
    width:48px !important;
    min-width:48px !important;
    height:48px !important;
    border-radius:10px !important;
  }

  .thumb-arrow{
    width:28px !important;
    height:28px !important;
    font-size:15px !important;
  }

  .product-info{
    padding:16px !important;
    border-radius:18px !important;
  }

  .product-title{
    font-size:18px !important;
    line-height:1.1 !important;
    margin-bottom:10px !important;
  }

  .price{
    font-size:20px !important;
  }

  .image-options-wrap{
    margin-top:12px !important;
  }

  .image-option span{
    width:82px !important;
    min-height:110px !important;
    border-radius:18px !important;
  }

  .image-option img{
    width:58px !important;
    height:58px !important;
    border-radius:12px !important;
  }

  .option-arrow{
    width:30px !important;
    height:30px !important;
    font-size:16px !important;
  }

  .gallery-main-wrap{
    order:1 !important;
  }

  .thumbs-navigation{
    order:2 !important;
    margin-top:12px;
  }

  .thumbnails{
    flex-direction:row !important;
    overflow-x:auto;
    gap:8px;
  }

  .thumbnails img{
    width:64px;
    min-width:64px;
    height:64px;
    border-radius:12px;
  }

  .main-image{
    order:1;
  }

  .product-info{
    padding:22px;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .price{
    font-size:13px;
  }

  .old-price{
    font-size:10px;
  }


  .image-option span{
    width:84px;
    min-height:106px;
  }

  .image-option img{
    width:64px;
    height:64px;
  }
}

/* Product page responsive polish — colors untouched */
.product-container, .gallery, .product-info{min-width:0}
.gallery img, .main-product-image, .thumb img{
  max-width:100%;
}
.product-title, .product-description, .option-name{
  overflow-wrap:anywhere;
}
@media (max-width: 920px){
  .product-container{
    grid-template-columns:1fr !important;
    gap:18px;
  }
  .product-info{order:2}
  .gallery{order:1}
}
@media (max-width: 560px){
  .product-container{
    margin-top:12px;
    padding-inline:12px;
  }
  .gallery, .product-info{
    border-radius:20px;
  }
  .product-actions, .actions-row{
    display:grid !important;
    grid-template-columns:1fr;
  }
}

/* Product motion + layout finish - colors preserved */
@keyframes productReveal{
  from{opacity:0; transform:translateY(18px)}
  to{opacity:1; transform:translateY(0)}
}

.gallery,
.product-info{
  animation:productReveal .45s cubic-bezier(.22,1,.36,1) both;
}

.product-info{
  animation-delay:.06s;
}

.main-image{
  box-shadow:0 18px 44px rgba(15,23,42,.08);
}

.main-image img,
.thumbnails img,
.image-option span,
.option-item span,
.q-btn,
.btn-buy,
.order-btn,
.ship-choice{
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease,
    background .22s ease,
    color .22s ease;
}

.main-image:hover img{
  transform:scale(1.018);
}

.thumbnails img{
  border-radius:16px;
  border:1px solid #e2e8f0;
  cursor:pointer;
}

.thumbnails img:hover{
  transform:translateY(-3px) scale(1.02);
  box-shadow:0 12px 24px rgba(15,23,42,.12);
}

.nav:hover,
.option-arrow:hover{
  transform:translateY(-50%) scale(1.06);
}

.thumb-arrow:hover,
.q-btn:hover{
  transform:translateY(-1px) scale(1.03);
}

.btn-buy:hover,
.order-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 36px rgba(15,23,42,.18);
}

.btn-buy:active,
.order-btn:active,
.q-btn:active{
  transform:scale(.98);
}

.product-info h1,
.product-info h3{
  overflow-wrap:anywhere;
}

.product-info h1{
  font-size:clamp(1.7rem, 3vw, 2.55rem);
}

@media (min-width:981px){
  .product-info{
    position:sticky;
    top:92px;
  }
}

@media (max-width:980px){
  .product-container{
    max-width:760px;
  }

  .gallery{
    padding:14px;
  }

  .product-info{
    padding:22px;
  }
}

@media (max-width:640px){
  .product-container{
    max-width:520px;
  }

  .main-image{
    height:auto !important;
    min-height:0 !important;
    aspect-ratio:1 / 1.05;
  }

  .main-image img{
    object-fit:contain !important;
  }

  .nav{
    width:36px;
    height:36px;
  }

  .prev{left:10px}
  .next{right:10px}

  .product-info h1{
    font-size:1.45rem !important;
  }

  .product-info h3{
    font-size:.94rem;
    line-height:1.55;
  }

  .option-list{
    gap:8px;
  }

  .option-item span{
    min-height:42px;
    padding:10px 13px;
  }

  .quantity-box{
    justify-content:space-between;
  }

  .btn-buy{
    min-height:54px;
    border-radius:16px;
  }

  .trust{
    padding:14px;
    border-radius:16px;
  }

  .order-box{
    border-radius:22px 22px 0 0;
  }
}

@media (prefers-reduced-motion: reduce){
  .gallery,
  .product-info{
    animation:none !important;
  }
}

/* Center product thumbnails under the main photo */
.gallery .gallery-main-wrap{
  order:1;
}

.gallery .thumbs-navigation{
  order:2;
  display:grid;
  grid-template-columns:auto minmax(0, 470px) auto;
  justify-content:center;
  justify-items:center;
  width:100%;
}

.gallery .thumbnails{
  width:100%;
  margin:0 auto;
  justify-content:center;
  max-width:470px;
  overflow-x:auto;
  scroll-behavior:smooth;
  scroll-snap-type:x proximity;
}

.gallery .thumb-item{
  flex:0 0 auto;
  scroll-snap-align:center;
}

.gallery .thumb-item.is-active{
  border-color:#111827 !important;
  box-shadow:0 0 0 3px rgba(17,24,39,.10), 0 12px 24px rgba(15,23,42,.14);
  transform:translateY(-2px);
}

@media (max-width:640px){
  .gallery .gallery-main-wrap{
    order:1 !important;
  }

  .gallery .thumbs-navigation{
    order:2 !important;
    justify-content:center !important;
    justify-items:center !important;
    grid-template-columns:auto minmax(0, 288px) auto;
  }

  .gallery .thumbnails{
    width:100% !important;
    max-width:288px !important;
    margin:0 auto !important;
    justify-content:center !important;
    overflow-x:auto !important;
    flex-wrap:nowrap !important;
  }
}

/* Pro product page finish */
body{
  background:#f6f7f9;
}

.product-container{
  max-width:1220px;
  gap:18px;
}

.gallery,
.product-info{
  background:#fff;
  border:1px solid #e8edf3;
  border-radius:18px;
  box-shadow:0 12px 34px rgba(15,23,42,.06);
}

.gallery{
  padding:16px;
}

.main-image{
  min-height:520px;
  border-radius:14px;
  background:#f7f8fa;
  border:1px solid #eef2f7;
}

.main-image img{
  object-fit:contain;
  padding:12px;
}

.product-info{
  padding:24px;
}

.product-info h1{
  margin-bottom:14px;
  font-size:clamp(1.55rem, 2.5vw, 2.15rem);
  line-height:1.14;
  letter-spacing:0;
}

.product-info > .price{
  margin:0 0 10px;
  font-size:28px;
}

.stock-line{
  display:inline-flex;
  align-items:center;
  margin:0 0 18px;
  padding:7px 12px;
  border-radius:999px;
  background:#f0fdf4;
  font-size:14px;
}

.product-options{
  margin:12px 0 16px;
  gap:14px;
}

.option-item span{
  border-radius:10px;
}

.image-options-wrap{
  margin:4px 0 16px;
  border-radius:14px;
  background:#fbfcfd;
}

.image-option span{
  width:116px;
  min-height:152px;
  border-radius:14px;
  box-shadow:none;
}

.image-option img{
  height:96px;
  border-radius:10px;
}

.quantity-box{
  margin:16px 0;
}

.product-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:8px;
}

.product-actions .btn-buy{
  margin-top:0;
}

.btn-buy{
  border-radius:12px;
}

.btn-secondary{
  background:#fff;
  color:#101828;
  border:1px solid #d8dee8;
}

.product-description-card{
  margin-top:16px;
  padding:14px 0 0;
  border-top:1px solid #edf1f5;
}

.product-description-card span{
  display:block;
  margin-bottom:7px;
  color:#111827;
  font-size:14px;
  font-weight:900;
}

.product-description-card p{
  margin:0;
  color:#475569;
  font-size:15px;
  line-height:1.65;
}

.trust{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin-top:16px;
  padding:0;
  background:transparent;
  border:0;
}

.trust p{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  margin:0;
  padding:10px 12px;
  border:1px solid #edf1f5;
  border-radius:12px;
  background:#fbfcfd;
  color:#334155;
  font-weight:700;
}

.trust i{
  color:#ff5a1f;
  width:18px;
  text-align:center;
}

.products{
  padding-top:8px;
}

.products .section-top{
  padding:0 2px;
}








@media (max-width:980px){
  .product-actions{
    grid-template-columns:1fr;
  }

  .main-image{
    min-height:0;
  }
}

@media (max-width:640px){
  .product-container{
    padding:8px !important;
  }

  .product-info{
    padding:16px !important;
  }

  .product-info > .price{
    font-size:23px !important;
  }

  .image-option span{
    width:86px !important;
    min-height:116px !important;
  }

  .image-option img{
    height:62px !important;
  }

  .products{
    padding-top:4px !important;
  }
}
/* FIX produits liés في صفحة المنتج */
.products .product-grid{
  grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
}

@media(max-width:900px){
  .products .product-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}

@media(max-width:430px){
  .products .product-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}
