* {
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

body.single-product {
  background: #fff;
  color: #0f172a;
  line-height: 1.6;
}

.apex-single-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.apex-breadcrumbs {
  padding: 18px 0 6px;
  font-size: 13px;
  color: #64748b;
  display: flex;
  gap: 8px;
  align-items: center;
}
.apex-breadcrumbs a {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}
.apex-breadcrumbs a:hover { color: #dc2626; }
.apex-breadcrumbs span { color: #64748b; font-size: 16px; }

.apex-product-main {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  padding: 30px 0;
}

.apex-main-img {
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
}
.apex-main-img img { width: 100%; display: block; }

.apex-thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 20px;
}
.apex-thumb {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: .3s;
}
.apex-thumb.active { border-color: #dc2626; }
.apex-thumb img { width: 100%; display: block; border-radius: 10px; }

.apex-product-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 18px;
}

.apex-price-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  max-width: 70%;
  margin: 14px auto 22px;
  justify-items: center;
}

.apex-price-row,
.apex-actions-row {
  width: 100%;
}

.apex-price-row {
  display: flex;
  justify-content: center;
}

.apex-price-box {
  background: #f8fafc;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: fit-content;
  min-width: 260px;
  max-width: 100%;
}
.apex-old-price {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: line-through;
  opacity: .55;
  text-decoration-thickness: 2px;
}
.apex-current-price {
  font-size: 34px;
  font-weight: 900;
  color: #dc2626;
  line-height: 1;
}

.apex-price-actions .apex-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  align-items: stretch;
  width: 100%;
}
.apex-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 18px;
}
.apex-qty input {
  border: none;
  width: 48px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  outline: none;
}
.apex-qty button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
}
.apex-add-to-cart {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
}
.apex-add-to-cart:hover { background: #dc2626; transform: translateY(-3px); }

.apex-trust-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}
.apex-trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #dc2626;
  padding: 16px 18px;
  border-radius: 12px;
  transition: .3s;
  margin-bottom: 0;
  width: 96%;
  margin-left: auto;
  margin-right: auto;
}
.apex-trust-item:hover { border: 2px solid #dc2626; box-shadow: 0 8px 16px rgba(0,0,0,.05); }
.apex-trust-item i { font-size: 32px; color: #dc2626; width: 45px; text-align: center; }
.apex-trust-title { font-size: 17px; font-weight: 800; color: #0f172a; line-height: 1.3; }
.apex-trust-desc { font-size: 13px; color: #64748b; font-weight: 500; line-height: 1.35; }

.apex-tabs { margin-top: 60px; border-top: 1px solid #e2e8f0; padding-top: 40px; }
.apex-tab-nav {
  display: flex;
  gap: 40px;
  margin-bottom: 30px;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}
.apex-tab-link {
  font-size: 18px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  position: relative;
  padding-bottom: 10px;
}
.apex-tab-link.active { color: #dc2626; }
.apex-tab-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #dc2626;
  border-radius: 10px;
}
.apex-tab-content { display: none; animation: fadeIn .4s ease; }
.apex-tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }

.apex-desc-wrap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
  align-items: center;
  margin-bottom: 30px;
}
.apex-desc-img {
  text-align: center;
  border: 2px solid #dc2626;
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(220,38,38,0.18);
}
.apex-desc-img img { width: 100%; height: auto; max-width: 100%; border-radius: 14px; display: block; margin: 0 auto; }
.apex-desc-text {
  font-size: 17px;
  color: #4b5563;
  line-height: 1.8;
  position: relative;
  padding: 14px 16px 14px 52px;
  background: linear-gradient(135deg, rgba(220,38,38,0.04), #fff);
  border-radius: 14px;
  border: 1px solid rgba(220,38,38,0.15);
  box-shadow: 0 10px 24px rgba(0,0,0,0.04);
}

/* Product description content can include inline table widths from editor.
   Force fit to container so text/specs never overflow viewport. */
.apex-desc-text table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
}

.apex-desc-text table td,
.apex-desc-text table th {
  width: auto !important;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.apex-desc-text::before {
  content: "\f15c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #dc2626;
  position: absolute;
  left: 18px;
  top: 16px;
  font-size: 20px;
}

.apex-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.apex-table tr:nth-child(even) { background: #f8fafc; }
.apex-table td { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; font-size: 15px; }
.apex-table .label { font-weight: 800; color: #64748b; width: 35%; }
.apex-table .value { font-weight: 600; color: #0f172a; }

.apex-desc-text table td:first-child,
.apex-desc-text table th:first-child {
  width: 42% !important;
}

.apex-desc-text table td:last-child,
.apex-desc-text table th:last-child {
  width: 58% !important;
}

.apex-related { margin: 60px 0 90px; }
.apex-related h2 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 24px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.apex-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.apex-rel-card {
  border: 2px solid #eee;
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  transition: 0.25s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.apex-rel-card:hover {
  border-color: #dc2626;
  box-shadow: 0 18px 40px rgba(220,38,38,0.25);
  transform: translateY(-4px);
}
.apex-rel-img { height: 160px; display: flex; align-items: center; justify-content: center; }
.apex-rel-img img { max-height: 100%; width: auto; object-fit: contain; }
.apex-rel-sku { font-size: 12px; color: #8a8f99; font-weight: 700; margin-top: 6px; }
.apex-rel-content { text-align: center; }
.apex-rel-name { font-size: 15px; font-weight: 800; line-height: 1.35; margin: 12px 0 6px; }
.apex-rel-price { font-weight: 900; color: #dc2626; margin-bottom: 8px; }
.apex-rel-btn {
  margin-top: 0;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}
.apex-rel-card:hover .apex-rel-btn {
  opacity: 1;
  max-height: 50px;
  margin-top: 14px;
}
.apex-rel-btn:hover { filter: brightness(1.05); }


/* ===============================
   PRODUCT META (SKU + STOCK)
================================ */

.apex-product-meta{
  display:flex;
  align-items:center;
  gap:20px;
  margin:14px 0 18px;
  font-size:14px;
  font-weight:600;
}

.apex-meta-item{
  display:flex;
  gap:6px;
  align-items:center;
}

.apex-meta-label{
  color:#6b7280;
}

.apex-meta-value{
  color:#111;
}

.apex-stock{
  font-weight:700;
  padding:4px 10px;
  border-radius:999px;
  font-size:13px;
}

.apex-stock.in-stock{
  background:#dcfce7;
  color:#15803d;
}

.apex-stock.out-stock{
  background:#fee2e2;
  color:#b91c1c;
}
/* ===============================
   SHARE PRODUCT
================================ */

.apex-share{
  margin-top:1px;
  padding-top:1px;
  border-top:1px solid #eee;
}

.apex-share-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  font-size:15px;
  margin-bottom:14px;
  color:#111;
}

.apex-share-title i{
  color:#dc2626;
}

.apex-share-icons{
  display:flex;
  gap:12px;
}

.apex-share-btn{
  width:42px;
  height:42px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f5f5f5;
  font-size:18px;
  color:#111;
  transition:.25s ease;
  text-decoration:none;
}

/* Brand Colors Hover */

.apex-share-btn.facebook:hover{
  background:#1877F2;
  color:#fff;
}

.apex-share-btn.instagram:hover{
  background:#E4405F;
  color:#fff;
}

.apex-share-btn.x:hover{
  background:#000;
  color:#fff;
}

.apex-share-btn.viber:hover{
  background:#7360F2;
  color:#fff;
}

.apex-share-btn.whatsapp:hover{
  background:#25D366;
  color:#fff;
}
/* DESKTOP GRID: left gallery, right head + buy */
.apex-product-main{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  column-gap:50px;   /* left-right spacing */
  row-gap:10px;      /* top-bottom spacing */
  padding:15px 0 15px 60px;
  align-items:start;
}

.apex-product-gallery{ grid-column:1; grid-row:1 / span 2; }
.apex-product-head{    grid-column:2; grid-row:1; }
.apex-product-buy{     grid-column:2; grid-row:2; }

/* MOBILE ORDER: head -> gallery -> buy (exact request) */
@media (max-width:768px){
  .apex-product-main{
    display:flex !important;
    flex-direction:column !important;
    gap:18px !important;
  }

  .apex-product-head{ order:1 !important; }
  .apex-product-gallery{ order:2 !important; }
  .apex-product-buy{ order:3 !important; }

  .apex-price-actions{ max-width:100% !important; margin:10px 0 14px !important; }
  .apex-price-actions .apex-actions{ grid-template-columns:1fr !important; }
  .apex-product-meta{ justify-content:center !important; flex-wrap:wrap !important; }
  .apex-share-icons{ justify-content:center !important; flex-wrap:wrap !important; }

  .apex-desc-text {
    padding: 14px 14px 14px 16px;
  }

  .apex-desc-text::before {
    display: none;
  }

  .apex-trust-list {
    gap: 5px;
    margin: 6px 0;
  }

  .apex-trust-item {
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    width: 97%;
  }

  .apex-trust-item i {
    font-size: 32px;
    width: 45px;
  }

  .apex-trust-title {
    font-size: 17px;
  }

  .apex-trust-desc {
    font-size: 13px;
  }
}
@media (max-width:768px){

  .apex-product-main{
    padding:15px 20px !important;  /* normal mobile padding */
    column-gap:0 !important;
    row-gap:18px !important;
  }

}
