/*
 * Phase 08-G.15 — Final Single Product Layout Lock
 * Loaded AFTER commerce.css and scoped only to body.single-product.
 */

/* ---------- Stable physical desktop grid ---------- */
body.single-product .woocommerce div.product{
  direction:ltr!important;
  display:grid!important;
  grid-template-columns:minmax(0,.96fr) minmax(0,1.04fr)!important;
  grid-template-rows:auto minmax(0,1fr) auto auto auto!important;
  grid-template-areas:
    "summary gallery"
    "dock gallery"
    "tabs tabs"
    "upsells upsells"
    "related related"!important;
  column-gap:34px!important;
  row-gap:0!important;
  align-items:stretch!important;
}

body.single-product .woocommerce div.product div.images{
  direction:rtl!important;
  grid-area:gallery!important;
  align-self:stretch!important;
  width:auto!important;
  min-width:0!important;
  margin:0!important;
}

body.single-product .woocommerce div.product div.summary{
  direction:rtl!important;
  grid-area:summary!important;
  display:flex!important;
  flex-direction:column!important;
  align-self:start!important;
  width:auto!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  margin:0!important;
  padding:8px 4px 0!important;
}

/* The dock is a REAL second row under summary and the gallery spans both rows.
   Therefore the dock baseline is the gallery/image baseline. */
body.single-product .woocommerce div.product>.mkp-product-bottom-dock{
  direction:ltr!important;
  grid-area:dock!important;
  display:grid!important;
  grid-template-columns:minmax(270px,1.22fr) minmax(190px,.78fr)!important;
  grid-template-areas:"purchase meta"!important;
  gap:10px!important;
  align-self:end!important;
  align-items:stretch!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:12px 0 0!important;
}

body.single-product .mkp-product-bottom-dock__purchase{
  direction:rtl!important;
  grid-area:purchase!important;
  min-width:0!important;
}

body.single-product .mkp-product-bottom-dock__meta{
  direction:rtl!important;
  grid-area:meta!important;
  min-width:0!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase,
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card{
  width:100%!important;
  height:100%!important;
  min-height:138px!important;
  margin:0!important;
  border-radius:15px!important;
}

/* ---------- Purchase card: price top, quantity right, wide CTA left ---------- */
body.single-product .mkp-product-bottom-dock .mkp-product-purchase{
  display:flex!important;
  flex-direction:column!important;
  padding:11px!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:60px!important;
  padding:8px 10px 10px!important;
  border-bottom:1px solid var(--mkp-border)!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price .price{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:2px!important;
  margin:0!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price .price del{
  font-size:.68rem!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price .price ins,
body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price .price>.woocommerce-Price-amount{
  font-size:.94rem!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase__action{
  display:flex!important;
  align-items:flex-end!important;
  flex:1 1 auto!important;
  width:100%!important;
  padding-top:10px!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase form.cart{
  direction:rtl!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:stretch!important;
  gap:8px!important;
  width:100%!important;
  margin:auto 0 0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase form.cart .quantity{
  order:1!important;
  flex:0 0 58px!important;
  width:58px!important;
  margin:0!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase form.cart .quantity .qty{
  width:58px!important;
  min-width:58px!important;
  min-height:46px!important;
  height:46px!important;
  text-align:center!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-purchase form.cart .single_add_to_cart_button{
  order:2!important;
  flex:1 1 auto!important;
  width:auto!important;
  min-width:0!important;
  min-height:46px!important;
  padding:9px 18px!important;
  font-size:.64rem!important;
  white-space:nowrap!important;
}

/* ---------- Meta card: KEEP text right-aligned RTL ---------- */
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card,
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__row,
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__row>div,
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__row strong,
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__chips,
body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__chips a{
  direction:rtl!important;
  text-align:right!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-meta-card{
  display:grid!important;
  align-content:center!important;
  gap:7px!important;
  padding:9px!important;
}

body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__chips{
  justify-content:flex-start!important;
}

/* ---------- Description / Reviews: one clear boxed section ---------- */
body.single-product .woocommerce div.product .woocommerce-tabs{
  direction:rtl!important;
  grid-area:tabs!important;
  width:100%!important;
  margin:30px 0 0!important;
  padding:18px!important;
  border:1px solid var(--mkp-border)!important;
  border-radius:22px!important;
  background:
    radial-gradient(circle at 88% 0%,rgba(16,149,79,.055),transparent 24rem),
    var(--mkp-surface-soft)!important;
  box-shadow:0 14px 34px rgba(2,18,25,.12)!important;
}

body.single-product .woocommerce div.product .woocommerce-tabs ul.tabs{
  display:flex!important;
  justify-content:center!important;
  gap:7px!important;
  margin:0 0 14px!important;
  padding:0!important;
}

body.single-product .woocommerce div.product .woocommerce-Tabs-panel,
body.single-product .woocommerce div.product #reviews{
  width:100%!important;
  margin:0!important;
  padding:19px!important;
  border:1px solid var(--mkp-border)!important;
  border-radius:17px!important;
  background:var(--mkp-surface)!important;
}

/* ---------- Related / Upsells: genuinely centered ---------- */
body.single-product .woocommerce div.product .upsells{
  direction:rtl!important;
  grid-area:upsells!important;
  width:100%!important;
  text-align:center!important;
}

body.single-product .woocommerce div.product .related{
  direction:rtl!important;
  grid-area:related!important;
  width:100%!important;
  text-align:center!important;
}

body.single-product .woocommerce div.product .related>h2,
body.single-product .woocommerce div.product .upsells>h2{
  width:100%!important;
  text-align:center!important;
}

body.single-product .woocommerce div.product .related ul.products,
body.single-product .woocommerce div.product .upsells ul.products{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:center!important;
  align-items:stretch!important;
  gap:14px!important;
  width:min(100%,980px)!important;
  margin-inline:auto!important;
}

body.single-product .woocommerce div.product .related ul.products li.product,
body.single-product .woocommerce div.product .upsells ul.products li.product{
  float:none!important;
  flex:0 1 280px!important;
  width:min(100%,280px)!important;
  max-width:280px!important;
  margin:0!important;
  text-align:center!important;
}

/* ---------- Mobile locked behavior ---------- */
@media(max-width:900px){
  body.single-product .woocommerce div.product{
    direction:rtl!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto!important;
    grid-template-areas:
      "gallery"
      "summary"
      "dock"
      "tabs"
      "upsells"
      "related"!important;
    row-gap:0!important;
  }

  body.single-product .woocommerce div.product div.images{
    grid-area:gallery!important;
  }

  body.single-product .woocommerce div.product div.summary{
    grid-area:summary!important;
    text-align:center!important;
    align-items:stretch!important;
    padding-top:18px!important;
  }

  /* Purchase FIRST, Meta SECOND on mobile. */
  body.single-product .woocommerce div.product>.mkp-product-bottom-dock{
    direction:rtl!important;
    grid-area:dock!important;
    grid-template-columns:1fr!important;
    grid-template-areas:
      "purchase"
      "meta"!important;
    gap:9px!important;
    margin:14px 0 0!important;
    padding:0!important;
  }

  body.single-product .mkp-product-bottom-dock .mkp-product-purchase,
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card{
    min-height:auto!important;
    height:auto!important;
  }

  /* General mobile product texts centered. */
  body.single-product .woocommerce div.product .product_title,
  body.single-product .woocommerce div.product .woocommerce-product-details__short-description,
  body.single-product .woocommerce div.product .woocommerce-product-details__short-description p,
  body.single-product .woocommerce div.product .stock,
  body.single-product .woocommerce div.product .woocommerce-tabs,
  body.single-product .woocommerce div.product .woocommerce-Tabs-panel,
  body.single-product .woocommerce div.product #reviews,
  body.single-product .woocommerce div.product .related,
  body.single-product .woocommerce div.product .upsells,
  body.single-product .mkp-product-bottom-dock .mkp-product-purchase,
  body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price,
  body.single-product .mkp-product-bottom-dock .mkp-product-purchase__action{
    text-align:center!important;
  }

  body.single-product .mkp-product-bottom-dock .mkp-product-purchase__price .price,
  body.single-product .mkp-product-bottom-dock .mkp-product-purchase form.cart,
  body.single-product .woocommerce div.product .woocommerce-tabs ul.tabs{
    justify-content:center!important;
  }

  /* Explicit exception: Category / Tag text stays RTL right-aligned. */
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card,
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__row,
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__row>div,
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__row strong,
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__chips,
  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__chips a{
    direction:rtl!important;
    text-align:right!important;
  }

  body.single-product .mkp-product-bottom-dock .mkp-product-meta-card__chips{
    justify-content:flex-start!important;
  }
}

@media(max-width:620px){
  body.single-product .woocommerce div.product .related ul.products li.product,
  body.single-product .woocommerce div.product .upsells ul.products li.product{
    flex:0 0 100%!important;
    width:100%!important;
    max-width:100%!important;
  }
}
