:root {
  --primary: #19bfd3;
  --accent: #ff5333;
  --ink: #0c0f14;
  --border: #e5e7eb;
  --bg: #fff;
  --shadow-1: 0 8px 24px rgba(2, 6, 23, 0.06);
  --shadow-2: 0 12px 32px rgba(2, 6, 23, 0.08);
  --radius: 14px;
}
.page {
  max-width: 1200px;
  margin-inline: auto;
  padding: 24px 16px;
  direction: rtl;
  text-align: right;
}
.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-areas: "gallery" "buybox";
  }
  .gallery {
    grid-area: gallery;
  }
  .buy-box {
    grid-area: buybox;
  }
  /* Ensure full-height viewport and safe space for footer under fixed toast */
  .page {
    min-height: 100svh;
    padding-bottom: 120px; /* room so footer isn't overlapped by toast */
  }
  /* Readability tweaks on mobile */
  .buy-box .sub {
    font-size: 18px;
  }
  .chips .chip {
    font-size: 18px;
    padding: 10px 16px;
  }
  .price-inline strong,
  #price-now {
    font-size: 24px;
  }
  .qty {
    font-size: 18px;
  }
  .seller-card .seller-name {
    font-size: 18px;
  }
  .seller-card .seller-desc {
    font-size: 16px;
    line-height: 1.9;
  }
}
/* Swap columns in RTL and keep them on the same row */
@media (min-width: 981px) {
  .grid {
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-areas: "gallery buybox";
  }
  .gallery {
    grid-area: gallery;
  }
  .buy-box {
    grid-area: buybox;
  }
}

/* Gallery (kept) */
.gallery {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-1);
}
.gallery-main img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* Buy box */
.buy-box {
  display: grid;
  gap: 14px;
  align-content: start;
}
.title {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 2px 0;
}
.sub {
  color: #6b7280;
  font-size: 14px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: rgba(25, 191, 211, 0.08);
}
.chip:hover:not([disabled]) {
  border-color: var(--primary);
  background: rgba(25, 191, 211, 0.04);
}
.chip[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.qty-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.qty {
  width: 92px;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
/* inline label + control rows */
.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-2);
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.12s ease;
}
.btn-buy:hover {
  background: #ff3a14;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.12);
  transform: translateY(-1px);
}
.btn-buy:active {
  transform: translateY(0);
}

/* Seller card */
.seller-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-1);
  margin-top: 16px; /* extra spacing from the button above */
}
.seller-card .seller-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.seller-card .seller-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.seller-card .logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #fff;
}
.seller-card .seller-name {
  font-weight: 900;
  color: var(--ink);
}
.seller-card .seller-desc {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.6;
}
.seller-card .title-line {
  margin-bottom: 6px;
}
.seller-card .seller-desc + .seller-desc {
  margin-top: 6px;
}
.btn-seller {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.06s ease;
}
.btn-seller:hover {
  background: rgba(25, 191, 211, 0.06);
}
/* Place the seller button on its own line and full width */
.seller-card .btn-seller {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
}

/* Toast */
.alert-box {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 1000;
  min-width: 280px;
  max-width: 92vw;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-2);
  overflow: hidden;
  display: none;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.alert-box.show {
  display: block;
  transform: translateX(0);
  opacity: 1;
}
.alert-head {
  height: 3px;
  background: #10b981;
  border-radius: 12px 12px 0 0;
}
.alert-body {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: center;
}
.alert-close {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #f9fafb;
  color: #6b7280;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.06s ease;
}
.alert-close:hover {
  background: #f3f4f6;
  color: var(--ink);
  border-color: #d1d5db;
}
.alert-close:active {
  transform: scale(0.96);
}
.alert-close svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Sticky buy (optional on mobile) */
@media (max-width: 980px) {
  .sticky-buy {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(1.2) blur(6px);
    border-top: 1px solid var(--border);
    padding: 10px;
  }
}

/* Tabs under gallery */
.pd-tabs {
  margin-top: 16px;
  grid-column: 1 / -1;
}
.pd-tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.pd-tab-nav a {
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  color: #374151;
  text-decoration: none;
}
.pd-tab-nav a[aria-current="page"] {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-color: #fff;
}
.pd-tab-pane {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  padding: 16px;
  box-shadow: var(--shadow-1);
}
/* Product specs */
.specs {
  margin-top: 4px;
  border-radius: 10px;
}
.specs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
}
.specs-row:last-child {
  border-bottom: 0;
}
.specs-key {
  color: #6b7280;
  font-weight: 700;
  text-align: right;
}
.specs-val {
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}
