/* ==========================================================================
   صفحه جزئیات محصول - عینک سمیعی (مدن و یکپارچه)
   ========================================================================== */

.product-detail {
    color: var(--ink, #17324a);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 991.98px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* --------------------------------------------------------------------------
   گالری تصاویر محصول
   -------------------------------------------------------------------------- */
.product-gallery {
    position: relative;
    background: #ffffff;
    border: 1px solid #e4ebf1;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.product-gallery-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 14px;
    background: #f8fafc;
}

.product-gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    user-select: none;
}

/* فلش‌های گالری */
#gallery-prev,
#gallery-next {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(23, 50, 74, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink, #17324a);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.2s ease;
}

#gallery-prev { right: 16px; }
#gallery-next { left: 16px; }

#gallery-prev:hover,
#gallery-next:hover {
    background: var(--sky-600, #087cb5);
    color: #ffffff;
    border-color: var(--sky-600, #087cb5);
    transform: translateY(-50%) scale(1.08);
}

/* نقطه‌های گالری (Dots) */
.product-gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.product-gallery-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-gallery-dot.is-active {
    background: var(--sky-600, #087cb5);
    width: 24px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   پنل خرید و اطلاعات محصول
   -------------------------------------------------------------------------- */
.product-buy-panel {
    background: #ffffff;
    border: 1px solid #e4ebf1;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.product-eyebrow {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sky-600, #087cb5);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-eyebrow span {
    color: #cbd5e1;
}

.product-detail-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--ink, #17324a);
    line-height: 1.4;
    margin-bottom: 6px;
}

.product-detail-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 18px;
}

/* کادر قیمت */
.product-buy-price-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

#price-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   انتخاب رنگ و سایز (Variants)
   -------------------------------------------------------------------------- */
.variant-selectors-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selector-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 0.88rem;
}

.selector-label .active-val {
    color: var(--ink, #17324a);
    font-weight: 700;
}

.color-swatches-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 3px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch-btn .swatch-circle {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-swatch-btn:hover {
    border-color: var(--sky-400, #38bdf8);
    transform: scale(1.08);
}

.color-swatch-btn.is-active {
    border-color: var(--sky-600, #087cb5);
    box-shadow: 0 0 0 3px var(--sky-100, #e0f2fe);
    transform: scale(1.08);
}

/* دکمه‌های سایز */
.size-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-pill-btn {
    min-height: 38px;
    padding: 6px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink, #17324a);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.size-pill-btn:hover {
    border-color: var(--sky-400, #38bdf8);
    background: var(--sky-50, #f0f9ff);
}

.size-pill-btn.is-active {
    border-color: var(--sky-600, #087cb5);
    background: var(--sky-600, #087cb5);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(8, 124, 181, 0.2);
}

/* --------------------------------------------------------------------------
   انتخاب تعداد و دکمه خرید
   -------------------------------------------------------------------------- */
.quantity-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    margin-top: 16px;
}

.quantity-label {
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.quantity-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: #ffffff;
    color: var(--sky-600, #087cb5);
    cursor: pointer;
    transition: background 0.15s ease;
}

.quantity-button:hover:not(:disabled) {
    background: #f1f5f9;
}

#add-to-cart-quantity {
    width: 50px;
    height: 38px;
    border: 0;
    border-right: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    text-align: center;
    font-weight: 700;
    color: var(--ink, #17324a);
    background: #ffffff;
}

.product-add-cart {
    margin-top: 16px;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    background: var(--sky-600, #087cb5);
    border: none;
    box-shadow: 0 4px 14px rgba(8, 124, 181, 0.25);
    transition: all 0.2s ease;
}

.product-add-cart:hover:not(:disabled) {
    background: var(--sky-700, #026aa2);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   بخش مشخصات پایین صفحه
   -------------------------------------------------------------------------- */
.product-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 40px;
}

.product-info-section {
    background: #ffffff;
    border: 1px solid #e4ebf1;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
}

.product-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.product-section-mark {
    width: 5px;
    height: 20px;
    background: var(--sky-600, #087cb5);
    border-radius: 4px;
}

.product-section-heading h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink, #17324a);
    margin: 0;
}

.product-specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 0;
}

.product-specs div {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
}

.product-specs dt {
    color: #64748b;
    font-weight: 500;
    font-size: 0.88rem;
    margin: 0;
}

.product-specs dd {
    color: var(--ink, #17324a);
    font-weight: 600;
    font-size: 0.88rem;
    margin: 0;
}

.product-description {
    color: #475569;
    line-height: 1.9;
    font-size: 0.95rem;
}
/* static/products/css/detail.css */

/* ---------- Cart Toast ---------- */
.cart-toast{
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9999;

  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 280px;
  max-width: min(92vw, 420px);

  padding: 12px 14px;
  border-radius: 14px;

  background: rgba(17, 24, 39, 0.92);
  color: #fff;

  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 50px rgba(0,0,0,0.25);

  transform: translateY(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.cart-toast.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cart-toast.is-error{
  background: rgba(127, 29, 29, 0.92);
}

.cart-toast-icon{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.18);
}

.cart-toast.is-error .cart-toast-icon{
  background: rgba(239, 68, 68, 0.22);
}

.cart-toast-content{
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.4;
}

.cart-toast-content strong{
  font-size: 0.95rem;
  font-weight: 800;
}

.cart-toast-content span{
  font-size: 0.85rem;
  opacity: 0.9;
}

.cart-toast-link{
  margin-right: auto;
  font-weight: 700;
  font-size: 0.85rem;
  color: #93c5fd;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(147, 197, 253, 0.12);
}

.cart-toast-link:hover{
  background: rgba(147, 197, 253, 0.18);
}

/* ---------- Button micro animation ---------- */
.product-add-cart.is-loading{
  position: relative;
  overflow: hidden;
}

.product-add-cart.is-loading::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: translateX(-120%);
  animation: shimmer 0.9s infinite;
}

@keyframes shimmer{
  to{ transform: translateX(120%); }
}

.product-add-cart.is-success{
  animation: popSuccess .35s ease;
}

@keyframes popSuccess{
  0%{ transform: scale(1); }
  45%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}

/* ---------- Fly-to-cart dot ---------- */
.cart-fly-dot{
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 8px 20px rgba(34,197,94,0.35);
  z-index: 9999;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
}

.cart-fly-dot.is-visible{
  opacity: 1;
}

@media (prefers-reduced-motion: reduce){
  .cart-toast,
  .product-add-cart.is-loading::after,
  .product-add-cart.is-success{
    animation: none !important;
    transition: none !important;
  }
}
