/* =========================================================
   Vendor Products / Product Edit / Product Modal / Variant Modal
   Organized + Mobile-friendly
   ========================================================= */

/* =========================
   1) Root Variables
   ========================= */
:root {
  --card-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-main: #0f172a;
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: #ddd;
  --shadow: 0 8px 30px rgba(2, 6, 23, 0.35);
  --radius: 14px;
  --glass-blur: 8px;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-color: #10b981;
  --error-color: #ef4444;
}

/* =========================
   2) Utilities
   ========================= */
.loading {
  text-align: center;
  margin-top: 1rem;
  color: #666;
}

.option {
  color: #000;
}

.content {
  padding: 0;
}

.muted {
  font-size: 14px;
  font-weight: 400 !important;
  color: var(--danger-color);
}

.above-index {
  z-index: 10000;
}

.small {
  font-size: 14px;
}

/* =========================
   3) Layout
   ========================= */
.row-flex-container {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 5px;
  margin-bottom: 15px;
}

.main-container {
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 5px 0;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.left-column,
.right-column {
  min-width: 0;
  box-sizing: border-box;
}

.left-column {
  flex: 1 1 320px;
  background-color: #e6f7ff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.right-column {
  flex: 1 1 420px;
  background-color: #fffbe6;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

/* =========================
   4) Sections / Cards
   ========================= */
.sales-section {
  background: var(--card, #fff);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.sales-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color, #111);
}

.sales-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  box-sizing: border-box;
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card h4 {
  color: #4f46e5;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.card p {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111;
}

/* =========================
   5) Product title card
   ========================= */
.ptitle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ptitle-container:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ptitle-container .pright-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ptitle-container .pright-column a {
  color: #0f172a;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s;
  overflow-wrap: anywhere;
}

.ptitle-container .pright-column a:hover {
  color: #2563eb;
}

.ptitle-container .pright-column .code {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.ptitle-container .pleft-column {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ptitle-container .pleft-column img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.ptitle-container .pleft-column img:hover {
  transform: scale(1.05);
  border-color: #3b82f6;
}

/* =========================
   6) Sale card / badges
   ========================= */
.sale-card {
  max-width: 100%;
  background: linear-gradient(145deg, #f9fafb, #eef2ff);
  border-radius: 16px;
  padding: 1.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s, box-shadow 0.25s;
  box-sizing: border-box;
}

.sale-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.sale-card h4 {
  color: #4f46e5;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.sale-card .code {
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.sale-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.sale-info span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: #333;
}

.sale-info strong {
  color: #111;
}

.status {
  align-self: flex-start;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
}

.status.best {
  background: #dcfce7;
  color: #166534;
}

.status.medium {
  background: #fef9c3;
  color: #92400e;
}

.status.low {
  background: #fee2e2;
  color: #991b1b;
}

.status.none {
  background: #f1f5f9;
  color: #475569;
}

.stock-badge {
  width: 75%;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  text-align: center;
  color: white;
}

.stock-badge.out {
  background: #dc2626;
}

.stock-badge.low {
  background: #ea580c;
}

.stock-badge.medium {
  background: #2563eb;
}

.stock-badge.high {
  background: #16a34a;
}

.status-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  text-transform: capitalize;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.badge-success {
  background-color: #16a34a;
}

.badge-danger {
  background-color: #dc2626;
}

.badge-warning {
  background-color: #f59e0b;
}

.badge-secondary {
  background-color: #6b7280;
}

.product-badges {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.badge-featured {
  background-color: var(--danger-color);
}

.badge-best-selling {
  background-color: var(--warning-color);
}

.badge-new {
  background-color: var(--success-color);
}

.listed_price {
  color: var(--primary-color) !important;
  font-size: 16px;
}

/* =========================
   7) Stock info
   ========================= */
.stock-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.95rem;
}

.stock-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e3e6e8;
}

.stock-item span {
  color: #555;
  font-weight: 500;
}

.stock-item strong {
  color: #000;
  font-weight: 700;
}

/* =========================
   8) Form
   ========================= */
.container {
  background: var(--light-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.4s ease;
}

form#productForm {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.rowcolumns {
  display: flex !important;
  gap: 15px;
  flex-direction: row !important;
  flex-wrap: nowrap;
  width: 100%;
}

.full-row {
  grid-column: 1 / -1;
}

.image-content {
  width: 100%;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.form-group label {
  white-space: nowrap;
  flex-shrink: 0;
}

label {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
}

input[type="text"],
input[type="number"],
select,
textarea {
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
  color: var(--accent);
  font-size: 0.95rem;
  min-height: 38px;
  transition: all 0.3s ease;
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

.form-group:focus-within label {
  color: #667eea;
}

/* =========================
   9) Buttons
   ========================= */
.action-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  flex-wrap: wrap;
}

.action-buttons>* {
  min-width: 0;
  box-sizing: border-box;
}

.action-btn {
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
  box-sizing: border-box;
}

.action-btn.edit {
  background: rgba(255, 193, 7, 0.15);
  color: #ff9800;
}

.action-btn.edit:hover {
  background: #ff9800;
  color: #fff;
}

.action-btn.delete {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.action-btn.delete:hover {
  background: #f44336;
  color: #fff;
}

.action-btn.save {
  background: rgba(244, 67, 54, 0.15);
  color: var(--main-color);
}

.action-btn.save:hover {
  background: var(--main-color);
  color: #fff;
}

.btn-choose,
.btn-ghost {
  box-sizing: border-box;
  max-width: 100%;
}

.btn-choose {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-choose:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border-radius: 0.8rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: none;
  color: var(--main-color);
  white-space: nowrap;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.delete-btn,
.btn-success,
.btn-details {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gray-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-btn {
  color: #dc3545;
  background: none;
}

.delete-btn:hover {
  background: var(--danger-color);
  color: #fff;
  transform: scale(1.1);
}

.btn-success,
.btn-details {
  background: none;
  color: var(--dark-color);
}

.btn-success:hover {
  transform: scale(1.1);
  background-color: var(--gray-color);
}

.btn-details:hover {
  transform: scale(1.1);
  background-color: var(--gray-color);
  color: var(--main-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* =========================
   10) Image previews / upload
   ========================= */
.image-preview-container {
  display: inline-block;
  max-width: 100%;
}

.main-image-preview,
.image-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
  border: 2px dashed rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.main-image-preview {
  width: min(320px, 100%);
  aspect-ratio: 1 / 1;
}

.image-preview {
  width: min(200px, 100%);
  aspect-ratio: 1 / 1;
}

.main-image-preview:hover,
.image-preview:hover {
  border-color: rgba(102, 126, 234, 0.3);
}

.main-image-preview img,
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
}

.upload-btn {
  position: absolute;
  bottom: 8px;
  padding: 0 !important;
  width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  max-height: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  z-index: 5;
  transition: 0.2s;
  backdrop-filter: blur(5px);
}

html[lang="en"] .upload-btn {
  left: 8px;
}

html[lang="ar"] .upload-btn {
  right: 8px;
}

.upload-btn i {
  font-size: 18px;
  color: #fff;
}

.upload-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* =========================
   11) Tables
   ========================= */
.table-responsive {
  width: 100%;
  max-width: 100%;
  margin-top: 20px;
  border-radius: 10px;
  overflow-y: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.table {
  width: 100%;
  /* min-width: 640px; */
  border-collapse: collapse;
  background: #fff;
}

.table thead th,
.selecthead {
  font-weight: 600;
  background: #333;
  color: #fff;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.table thead th {
  padding: 12px 15px;
  border: 1px solid #ddd;
}

.selecthead {
  min-width: 120px;
  max-width: 150px;
  padding: 0;
  margin: 0;
}

.table td {
  padding: 12px 15px;
  border: 1px solid #ddd;
  text-align: center;
  vertical-align: middle;
  max-width: 500px;
}

.table td img {
  min-width: 80px;
  min-height: 80px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.variants-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: var(--input-bg);
  border-radius: 10px;
  overflow: hidden;
}

.variants-table th {
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
  font-weight: 600;
  color: var(--accent);
}

.variants-table td {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
}

.variant-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

/* =========================
   12) Product specs
   ========================= */
.product-specifications-section {
  margin-top: 20px;
}

.spec-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
  min-width: 0;
}

.spec-form select,
.spec-form input {
  flex: 1;
  min-width: 0;
  padding: 8px;
}

/* =========================
   13) Overlay / status
   ========================= */
.breadcrumb-wrap {
  background-color: var(--light-color);
  border-radius: 10px;
  position: relative;
  z-index: 1000;
}

.navbar {
  z-index: 20001;
}

.bottom-bar,
.site-footer {
  position: relative;
  z-index: 2000;
}

.page-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: all;
}

.disabled-section {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
}

.reviewed-msg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--danger-color);
  background: rgba(255, 255, 255, 0.9);
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  z-index: 200;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  max-width: min(80%, 500px);
  line-height: 1.6;
}

/* =========================
   14) Animations
   ========================= */
@keyframes fadeIn {
  from {
    transform: scale(0.93);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeContent {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   15) Product Modal
   ========================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 15000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #333;
  color: #fff;
  border-radius: 12px;
  width: min(100%, 900px);
  max-width: 100%;
  max-height: min(95vh, 100%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease;
  position: relative;
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal.show {
  transform: scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  flex-direction: row !important;
  direction: ltr !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-light);
  background: rgba(0, 0, 0, 0.1);
}

.modal-header .btn:hover,
.modal-header button:hover {
  color: var(--main-color);
}

.modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-main {
  flex: 1;
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
  background: #f8f9fa;
  pointer-events: auto;
}

.modal-tabs {
  width: 300px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.01), transparent);
  transition: all 0.3s;
  font-size: 16px;
  font-weight: 600;
  overflow-x: auto;
}

html[dir="ltr"] .modal-tabs {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

html[dir="rtl"] .modal-tabs {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.tabs-list {
  display: flex;
  width: 100%;
  flex-direction: row;
  gap: 8px;
  min-width: 0;
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 10px;
  border-radius: var(--border-radius);
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text-light);
  transition: all 0.2s ease-in-out;
  text-align: center;
  min-width: 0;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: var(--main-color);
  color: var(--light-color);
  border-color: var(--accent-color);
}

.tab-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.tab-content {
  display: none;
  animation: fadeContent 0.3s ease;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 0 !important;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

.tab-content h3 {
  color: var(--danger-color);
}

.product-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 10px;
  transition: background 0.2s;
}

.product-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.product-row img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.product-meta {
  flex: 1;
  min-width: 0;
  color: var(--text-light);
}

.modalpricing {
  margin-top: 12px;
  display: flex;
  align-self: center;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.hfont {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--danger-color);
  z-index: 1000;
}

.order-box {
  text-align: center;
}

.tracking-input {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  background: var(--light-color);
  color: var(--text-dark);
  font-size: 14px;
  transition: all 0.3s ease;
}

.tracking-input:focus {
  border-color: var(--main-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.2);
}

.modalflex-container {
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.modal-relative {
  border-radius: 12px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column !important;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease;
  position: relative;
}

html[dir="rtl"] .modal {
  direction: rtl;
}

html[dir="rtl"] .tabs-list .tab-btn,
html[dir="rtl"] .form-group label {
  text-align: right;
}

/* =========================
   16) Variant Modal
   ========================= */
.variant-modal-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 0.25s ease;
  position: fixed;
  inset: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20000 !important;
}

.variant-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.variant-modal {
  transform: scale(0.85);
  opacity: 0;
  transition: 0.25s ease;
  background: #333;
  color: #fff;
  border-radius: 12px;
  width: min(100%, 900px);
  max-width: 100%;
  max-height: min(95vh, 100%);
  overflow: hidden;
  position: relative;
  z-index: 20001 !important;
}

.variant-modal.show {
  transform: scale(1);
  opacity: 1;
}

.variant-modal-relative {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s ease;
  position: relative;
}

.variant-modal-main {
  background: #f8f9fa;
  width: 100%;
  height: auto;
  padding: 20px;
  overflow-y: auto;
  pointer-events: auto !important;
  box-sizing: border-box;
}

#variantModalOverlay .modal-main {
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* =========================
   17) Responsive
   ========================= */
@media (max-width: 991px) {

  .modal,
  .variant-modal {
    width: 100%;
    max-width: 100%;
  }

  .modal-body {
    flex-direction: column;
  }

  .modal-tabs {
    width: 100%;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-direction: row;
    padding: 8px;
    overflow-x: auto;
  }

  .tabs-list {
    flex-direction: row;
    flex-wrap: nowrap;
    min-width: max-content;
  }

  .tab-btn {
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  form#productForm {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .main-image-preview {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .row-flex-container {
    flex-direction: column;
    gap: 16px;
  }

  .row-flex-container,
  .content,
  .form-control {
    inline-size: 100%;
    max-inline-size: 500px;
    margin-inline: 0;
    overflow: hidden;
  }

  .main-container {
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
  }

  .left-column,
  .right-column {
    flex: 1 1 100%;
    min-width: 100%;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  }

  .ptitle-container {
    flex-direction: column-reverse;
    align-items: stretch;
    text-align: center;
  }

  .ptitle-container .pleft-column {
    justify-content: center;
  }

  form#productForm {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .rowcolumns,
  .spec-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .form-group {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group label {
    margin-bottom: 4px;
    white-space: normal;
  }

  .variant-image img,
  .main-image-preview {
    width: 100%;
    height: auto;
    max-height: 280px;
  }

  .image-preview-container {
    display: block;
    margin: 0 auto 10px;
    max-width: 100%;
  }

  .modal-overlay,
  .variant-modal-overlay {
    padding: 0;
  }

  .modal,
  .variant-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-main,
  .variant-modal-main {
    padding: 14px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    width: 100%;
  }

  .action-btn,
  .btn-choose,
  .btn-ghost {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .btn-choose,
  .btn-ghost {
    white-space: normal;
  }

  .upload-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 560px;
  }

  .table th,
  .table td {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .product-row {
    align-items: flex-start;
  }

  .product-row img {
    width: 52px;
    height: 52px;
  }

  .modalpricing {
    gap: 12px;
  }

  .hfont {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {

  .container,
  .card,
  .left-column,
  .right-column {
    padding: 12px;
  }

  .action-buttons {
    gap: 6px;
  }

  .action-btn {
    inline-size: 100%;
    justify-content: center;
  }

  .table {
    min-width: 520px;
  }

  .reviewed-msg {
    width: calc(100% - 24px);
    max-width: 100%;
    padding: 14px 16px;
    font-size: 14px;
  }

  .card-title {
    font-size: 1rem;
  }

  .sales-cards-container {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-main: #f8fafc;
    --accent: #e2e8f0;
    --input-bg: rgba(255, 255, 255, 0.05);
  }
}