html {
  font-size: 12px;
}

/* Critical: Ensure header and navbar are always visible */
header,
header *,
.navbar,
.navbar * {
  box-sizing: border-box;
}

@media (min-width: 768px) {
  html {
    font-size: 13px;
  }
}

body {
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: start;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-control, .form-select {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  text-align: start;
}

.btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

.table {
  font-size: 0.85rem;
}

.table th, .table td {
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
  text-align: start;
}

.card {
  margin-bottom: 0.75rem;
}

.card-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.card-body {
  padding: 0.75rem;
}

.container {
  padding-inline-end: 0.75rem;
  padding-inline-start: 0.75rem;
  max-width: 100%;
}

@media (max-width: 576px) {
  .container {
    padding-inline-end: 0.5rem;
    padding-inline-start: 0.5rem;
  }
}

.row {
  margin-inline-end: -0.25rem;
  margin-inline-start: -0.25rem;
}

.row > * {
  padding-inline-end: 0.25rem;
  padding-inline-start: 0.25rem;
}

.g-3 {
  --bs-gutter-y: 0.5rem;
  --bs-gutter-x: 0.5rem;
}

/* Dropdown arrow on the trailing edge (right in LTR, left in RTL) */
.form-select {
  background-position: right 0.75rem center !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  padding-inline-end: 2.5rem !important;
  padding-inline-start: 0.75rem !important;
  text-align: start !important;
  background-repeat: no-repeat;
  background-size: 16px 12px;
}

html[dir="rtl"] .form-select {
  background-position: left 0.75rem center !important;
}

.form-select:focus {
  background-position: right 0.75rem center !important;
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

html[dir="rtl"] .form-select:focus {
  background-position: left 0.75rem center !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Remove border radius from all elements */
* {
  border-radius: 0 !important;
}

.btn,
.form-control,
.form-select,
.input-group,
.card,
.modal-content,
.dropdown-menu,
.alert,
.badge,
.navbar,
.table,
.img-thumbnail,
.pagination,
.page-link,
.list-group-item,
.breadcrumb,
.breadcrumb-item,
.progress,
.progress-bar,
.tooltip,
.popover,
.tag-item,
.tags-input-container {
  border-radius: 0 !important;
}

/* RTL: reverse input-group so the leading control sits on the right */
html[dir="rtl"] .input-group {
  flex-direction: row-reverse;
}

.input-group > .form-control,
.input-group > .form-select {
  text-align: start;
}

.navbar-nav {
}

.navbar-nav .nav-link {
  text-align: start;
}

html[dir="rtl"] .btn-group {
  flex-direction: row-reverse;
}

.card-header,
.card-body {
  text-align: start;
}

.form-label {
  text-align: start;
}

textarea.form-control {
  text-align: start;
}

/* Select2 RTL and styling */
.select2-container {
  text-align: start;
}

.select2-container--bootstrap-5 .select2-selection {
  border-radius: 0 !important;
  border: 1px solid #ced4da;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
}

.select2-container--bootstrap-5 .select2-selection--single {
  height: auto;
  line-height: 1.5;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-inline-start: 2.5rem !important;
  padding-inline-end: 0.75rem !important;
  text-align: start !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  inset-inline-start: auto !important;
  inset-inline-end: 0.75rem !important;
  height: 100%;
}

/* Clear button on the trailing edge (left in RTL, right in LTR) */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear {
  float: inline-end !important;
  margin-inline-end: 0.5rem !important;
  margin-inline-start: 0 !important;
  inset-inline-start: auto !important;
  inset-inline-end: 0.5rem !important;
  position: absolute !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-inline-start: 2.5rem !important;
  padding-inline-end: 2rem !important; /* Add space for clear button on left */
  text-align: start !important;
}

.select2-dropdown {
  border-radius: 0 !important;
  border: 1px solid #ced4da;
  text-align: start;
}

.select2-search--dropdown .select2-search__field {
  border-radius: 0 !important;
  border: 1px solid #ced4da;
  padding: 0.35rem 0.5rem;
  text-align: start;
}

.select2-results__option {
  text-align: start;
  padding: 0.5rem 0.75rem;
}

.select2-results__option--highlighted {
  background-color: #0d6efd;
  color: white;
}

/* Tags input container - ensure correct order: select, input, button */
.tags-input-container .input-group {
  flex-direction: row !important;
}

/* Professional Navbar Styling */
.custom-navbar {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  padding: 0.6rem 1rem;
  border-bottom: 3px solid rgba(255, 255, 255, 0.15);
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  position: relative;
  width: 100%;
  z-index: 1030;
  min-height: 56px;
  overflow-x: auto;
  overflow-y: hidden;
}

/* قائمة إحصائيات - قائمة مخصصة بأولوية طبقية عالية */
.custom-navbar .nav-item-stats-dropdown {
  position: relative;
}
.custom-navbar .stats-dropdown-menu {
  display: none;
  position: fixed;
  min-width: 200px;
  background: #2d3748;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  padding: 0.5rem 0;
  z-index: 9999 !important;
  list-style: none;
}
.custom-navbar .nav-item-stats-dropdown.open .stats-dropdown-menu {
  display: block !important;
}
.custom-navbar .stats-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: rgba(255,255,255,0.9) !important;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  text-align: start;
}
.custom-navbar .stats-dropdown-item:hover {
  background: rgba(255,255,255,0.15);
  color: #fff !important;
}
.custom-navbar .stats-dropdown-item.active {
  background: rgba(255,255,255,0.2);
  font-weight: 600;
}
.custom-navbar .stats-arrow {
  font-size: 0.65rem;
  margin-inline-start: 0.25rem;
  transition: transform 0.2s;
}
.custom-navbar .nav-item-stats-dropdown.open .stats-arrow {
  transform: rotate(180deg);
}
.custom-navbar .navbar-collapse.show {
  overflow: visible !important;
}

.custom-navbar .navbar-brand {
  font-size: 1.2rem;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  transition: all 0.3s ease;
  border-radius: 6px;
  margin-inline-start: 0.75rem;
}

.custom-navbar .navbar-brand:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.custom-navbar .brand-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.custom-navbar .brand-text {
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-navbar .navbar-nav {
  gap: 0.3rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.custom-navbar .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.5rem 0.8rem !important;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  margin: 0 0.1rem;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.custom-navbar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.custom-navbar .nav-link.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.custom-navbar .nav-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.custom-navbar .nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
  border-radius: 4px 0 0 4px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.custom-navbar .nav-icon {
  font-size: 1rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s ease;
  line-height: 1;
  flex-shrink: 0;
}

.custom-navbar .nav-link:hover .nav-icon,
.custom-navbar .nav-link.active .nav-icon {
  transform: scale(1.1);
}

.custom-navbar .nav-text {
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
}

.custom-navbar .navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (min-width: 992px) {
  .custom-navbar .navbar-toggler {
    display: none !important;
  }
}

.custom-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.custom-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5em;
  height: 1.5em;
  display: block;
}

/* Desktop navbar layout */
@media (min-width: 992px) {
  .custom-navbar .navbar-nav {
    display: inline-flex;
    flex-direction: row;
    justify-content: flex-start;
    width: auto;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  
  .custom-navbar .navbar-nav:last-child {
    margin-inline-end: auto;
    justify-content: flex-end;
    flex-shrink: 0;
  }
  
  .custom-navbar .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    overflow: visible;
  }
  
  .custom-navbar .navbar-collapse {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100%;
    overflow: visible;
  }
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .custom-navbar {
    flex-wrap: wrap;
  }
  
  .custom-navbar .container-fluid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }
  
  .custom-navbar .navbar-brand {
    margin-inline-start: auto;
    margin-inline-end: 0;
  }
  
  .custom-navbar .navbar-toggler {
    margin-inline-end: 0.5rem;
    order: 2;
  }
  
  .custom-navbar .navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: stretch;
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .custom-navbar .navbar-collapse:not(.show) {
    display: none;
  }
  
  .custom-navbar .navbar-collapse.show {
    display: flex !important;
    flex-direction: column;
  }
  
  .custom-navbar .navbar-collapse.collapsing {
    display: flex !important;
    flex-direction: column;
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
  }
  
  .custom-navbar .navbar-nav {
    margin-top: 0;
    gap: 0.25rem;
    flex-direction: column;
    width: 100%;
  }
  
  .custom-navbar .nav-link {
    padding: 0.65rem 0.9rem !important;
    margin: 0.2rem 0;
    width: 100%;
    justify-content: flex-start;
    font-size: 0.85rem;
  }
  
  .custom-navbar .nav-icon {
    font-size: 1rem;
  }
  
  .custom-navbar .nav-text {
    font-size: 0.8rem;
  }
}

/* Mobile specific styles */
@media (max-width: 576px) {
  .container {
    padding-inline-end: 0.5rem;
    padding-inline-start: 0.5rem;
  }
  
  .custom-navbar {
    padding: 0.5rem 0.75rem;
    display: flex !important;
    visibility: visible !important;
  }
  
  .custom-navbar .container-fluid {
    display: flex !important;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .custom-navbar .navbar-brand {
    font-size: 1.1rem;
    padding: 0.4rem 0.75rem;
    display: flex !important;
    visibility: visible !important;
  }
  
  .custom-navbar .navbar-toggler {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .custom-navbar .brand-text {
    font-size: 0.9rem;
  }
  
  .custom-navbar .nav-link {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.8rem;
  }
  
  .custom-navbar .nav-icon {
    font-size: 0.95rem;
  }
  
  .custom-navbar .nav-text {
    font-size: 0.75rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  .btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
  
  .table {
    font-size: 0.75rem;
  }
  
  .table th, .table td {
    padding: 0.3rem 0.4rem;
  }
  
  .card-body {
    padding: 0.5rem;
  }
  
  .card-header {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .form-control, .form-select {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
  }
  
  .form-label {
    font-size: 0.8rem;
  }
}

/* Tablet styles */
@media (min-width: 577px) and (max-width: 991px) {
  .container {
    padding-inline-end: 1rem;
    padding-inline-start: 1rem;
  }
  
  .custom-navbar .nav-link {
    padding: 0.55rem 0.85rem !important;
    font-size: 0.85rem;
  }
  
  .custom-navbar .nav-icon {
    font-size: 1rem;
  }
  
  .custom-navbar .nav-text {
    font-size: 0.8rem;
  }
}

/* Ensure tables are responsive */
@media (max-width: 991px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    min-width: 600px;
  }
}

/* Ensure buttons don't wrap on mobile */
@media (max-width: 576px) {
  .btn-group {
    flex-wrap: wrap;
  }
  
  .d-flex.justify-content-between {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .d-flex.justify-content-between > div {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
}

/* Table Header Styling - Match Navbar Colors */
.table-dark,
.table thead.table-dark th,
.table thead th {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  font-weight: 600;
}

.table-dark th,
.table thead.table-dark th {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
  color: #ffffff !important;
}

/* Pagination Styling - Match Navbar Colors */
.pagination .page-link {
  color: #4a5568;
  background-color: #ffffff;
  border-color: #dee2e6;
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-color: #4a5568;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-color: #2d3748;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #ffffff;
  border-color: #dee2e6;
  opacity: 0.6;
}

/* Actions Column Styling - Consistent across all pages */
.table td:first-child,
.table th:first-child,
.table td[data-column="Actions"],
.table th[data-column="Actions"] {
  width: 1% !important;
  white-space: nowrap !important;
  min-width: fit-content !important;
  max-width: none !important;
}

.table td:first-child .btn-group,
.table td[data-column="Actions"] .btn-group {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  width: auto;
}

.table td:first-child .btn,
.table td[data-column="Actions"] .btn {
  white-space: nowrap;
  flex-shrink: 0;
  width: auto;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  line-height: 1.2;
}

/* Override table layout for actions column */
.table {
  table-layout: auto;
}

/* Ensure navbar is always visible and functional */
.navbar {
  position: relative;
  z-index: 1030;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

header {
  display: block !important;
  visibility: visible !important;
}

.custom-navbar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.navbar-collapse {
  flex-basis: 100%;
  flex-grow: 1;
  align-items: center;
}

@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
    flex-wrap: nowrap;
    overflow: visible;
  }
}

/* Force navbar elements to be visible on mobile */
@media (max-width: 991px) {
  .custom-navbar,
  .custom-navbar .container-fluid,
  .custom-navbar .navbar-brand,
  .custom-navbar .navbar-toggler {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .custom-navbar .navbar-toggler {
    display: block !important;
  }
}

/* Profit viability coloring (orange = in viability range) */
.profit-orange {
  color: #fd7e14 !important;
  font-weight: 600;
}

/* Ensure container-fluid works properly on mobile */
.container-fluid {
  padding-inline-end: 0.75rem;
  padding-inline-start: 0.75rem;
}

@media (max-width: 576px) {
  .container-fluid {
    padding-inline-end: 0.5rem;
    padding-inline-start: 0.5rem;
  }
}

/* Sortable table headers - shared across Order, Shipment, FBAShipment, Sale */
.sortable-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-inline-end: 20px !important;
  transition: background-color 0.2s ease;
}

.sortable-header:hover {
  background-color: #3a3f44 !important;
}

.sortable-header::after {
  content: '⇅';
  position: absolute;
  inset-inline-end: 5px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  font-size: 0.8em;
}

.sortable-header.sort-asc::after {
  content: '▲';
  opacity: 1;
  color: #ffc107;
}

.sortable-header.sort-desc::after {
  content: '▼';
  opacity: 1;
  color: #ffc107;
}

/* صفحات التفاصيل — عمود المنتج: سطر الاسم + سطر المعرّفات؛ عرض العمود = عرض سطر المعرّفات فقط (لا نسبة من colgroup) */
.table-responsive table.table-details-product-layout {
  table-layout: auto;
  width: 100%;
}

/* colgroup: عمود المنتج فقط — لا تفرض نسبة مئوية (كانت تسبب عرضاً زائداً) */
table.table-details-product-layout col.col-details-product {
  width: 0 !important;
}

td.details-table-product-col {
  /* width:0 + table layout = أقل عرض ممكن يكفي المحتوى (سطر المعرّفات) دون أخذ فراغ زائد من الجدول */
  width: 0;
  max-width: 96vw;
  min-width: 0;
  vertical-align: top !important;
  white-space: normal !important;
  overflow: hidden;
  box-sizing: border-box;
}

/* مع سطر معرّفات: الحاوية بعرض سطر المعرّفات فقط (في التدفق)؛ الاسم فوقه يُقتطع لنفس العرض */
.details-product-cell--with-meta {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 96vw;
  box-sizing: border-box;
  padding-top: 1.35em;
  min-width: 0;
  vertical-align: top;
}

.details-product-cell--with-meta .details-product-name-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.details-product-cell--with-meta .details-product-meta-line {
  display: block;
  /* العرض المعتمد: عرض نص Barcode | ASIN | SKU | … كسطر واحد */
  width: max-content;
  max-width: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.35;
}

.details-product-cell--with-meta .details-product-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  width: 100%;
  min-width: 0;
  font-weight: 600;
  color: #212529;
}

/* بدون معرّفات: الاسم فقط — حد معقول حتى لا يتمدد العمود بلا حدود */
.details-product-cell--name-only {
  display: block;
  min-width: 0;
  max-width: min(56ch, 96vw);
}

.details-product-cell--name-only .details-product-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  max-width: 100%;
  font-weight: 600;
  color: #212529;
}
/* ===== شريط القوائم بسطرين (2026-09-26): الأول = قوائم الموقع الأصلية (أسود)، الثاني = الصفحات الجديدة ===== */
header { padding: 6px 8px 0; }
.custom-navbar.nav-row-main {
  background: #121418;
  border-bottom: 1px solid #2c323b;
  border-radius: 12px 12px 0 0;
  box-shadow: none;
  margin-bottom: 0 !important;
}
.custom-navbar.nav-row-new {
  background: #2a2f38;
  border-bottom: 3px solid #d4a017;
  border-radius: 0 0 12px 12px;
  min-height: 44px;
  padding: 0.25rem 1rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
.custom-navbar.nav-row-new .nav-link { padding: 0.35rem 0.7rem !important; }
.nav-row-label {
  color: #f0c24b;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  margin-inline-end: 0.6rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(240, 194, 75, 0.45);
  border-radius: 20px;
}
.nav-beta {
  font-size: 0.66rem;
  font-weight: 700;
  background: #f0c24b;
  color: #3b2a00;
  border-radius: 20px;
  padding: 0.05rem 0.5rem;
  margin-inline-start: 0.2rem;
  line-height: 1.5;
}
/* الشاشات الواسعة: التفاف بدل السحب الأفقي */
@media (min-width: 992px) {
  .custom-navbar.nav-row-main, .custom-navbar.nav-row-new { overflow: visible; flex-wrap: wrap; }
  .custom-navbar.nav-row-main .navbar-nav, .custom-navbar.nav-row-new .navbar-nav { flex-wrap: wrap; row-gap: 0.2rem; }
  /* السطر الثاني يلتف داخل عرض الصفحة (كان يتجاوزه عند 1024) */
  .custom-navbar.nav-row-new .container-fluid { min-width: 0; }
  .custom-navbar.nav-row-new .navbar-nav { flex: 1 1 0; min-width: 0; }
}
@media (min-width: 992px) {
  .custom-navbar.nav-row-main .container-fluid,
  .custom-navbar.nav-row-main .navbar-collapse { flex-wrap: wrap; min-width: 0; }
  /* القوائم تلتف داخل مساحتها، وقائمة المستخدم تبقى في طرفها */
  .custom-navbar.nav-row-main .navbar-nav.flex-grow-1 { flex: 1 1 0; min-width: 0; }
  .custom-navbar.nav-row-main .navbar-collapse > .navbar-nav:not(.flex-grow-1) { flex: 0 0 auto; }
}
/* الجوال: السطر الثاني سطر واحد يُسحب جانبياً بدل قائمة طويلة */
@media (max-width: 991.98px) {
  .custom-navbar.nav-row-new .container-fluid { flex-wrap: nowrap; overflow-x: auto; }
  .custom-navbar.nav-row-new .navbar-nav { flex-direction: row !important; flex-wrap: nowrap; }
  .custom-navbar.nav-row-new .nav-link { padding: 0.3rem 0.55rem !important; }
}
/* الشرح المنبثق لصفحات السطر الثاني */
.nav-tip {
  position: fixed; z-index: 10000; max-width: 330px; direction: rtl; text-align: right;
  background: #fbf3e2; color: #3d2f16; border: 1px solid #e6d3a8; border-radius: 12px;
  padding: 0.65rem 0.85rem; font-size: 0.86rem; line-height: 1.7;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.nav-tip.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ===== مربع «ما هذه الصفحة؟» (2026-09-27): شرح كل صفحة جديدة في أعلاها ===== */
.pg-guide {
  direction: rtl; text-align: right; border-radius: 16px; margin: 0 0 .8rem;
  background: #fbf3e2; color: #3d2f16; border: 1px solid #e6d3a8;
}
.pg-guide > summary {
  cursor: pointer; list-style: none; padding: .5rem .85rem; font-weight: 800; font-size: .92rem;
  display: flex; align-items: center; gap: .4rem; user-select: none;
}
.pg-guide > summary::-webkit-details-marker { display: none; }
.pg-guide > summary .pg-hint { font-weight: 500; opacity: .7; font-size: .78rem; }
.pg-body { padding: 0 .85rem .75rem; }
.pg-idea { margin: 0 0 .55rem; line-height: 1.8; font-size: .9rem; }
.pg-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .45rem; }
.pg-part { background: rgba(255,255,255,.6); border: 1px solid #efdfbb; border-radius: 12px; padding: .45rem .6rem; font-size: .83rem; line-height: 1.65; }
.pg-part b { display: block; margin-bottom: .1rem; }
.pg-start { margin: .55rem 0 0; font-size: .86rem; }
/* داخل الشريط الملوّن أعلى الصفحة: شفاف بلون الشريط */
.sb-hero .pg-guide {
  grid-column: 1 / -1; margin: 0; position: relative; z-index: 1;
  /* خلفية داكنة شفافة (لا بيضاء) حتى يبقى النص الأبيض واضحاً حتى فوق الطرف الفاتح من التدرج (ملاحظة المالك 2026-09-28) */
  background: rgba(10,20,30,.42); color: #fff; border-color: rgba(255,255,255,.18);
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.sb-hero .pg-part { background: rgba(0,0,0,.24); border-color: rgba(255,255,255,.14); color: #fff; }
.sb-hero .pg-idea, .sb-hero .pg-start { color: rgba(255,255,255,.95); }
@media (max-width: 576px) { .pg-parts { grid-template-columns: 1fr; } }

/* ===== «🎬 شرح بالفيديو» (2026-09-27): فيديو حي على الصفحة الحقيقية ===== */
.pt-btn { display: inline-flex; align-items: center; gap: .35rem; border: 0; border-radius: 12px; padding: .38rem .9rem; font-weight: 800; font-size: .9rem;
  background: linear-gradient(135deg, #ffcf4d, #f5a300); color: #3a2400; box-shadow: 0 6px 16px rgba(245,163,0,.35); cursor: pointer; }
.pt-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.pt-btn i { font-size: 1.1rem; }
.pt-embed header, .pt-embed .pt-btn, .pt-embed footer { display: none !important; }
.pt-ov { position: fixed; inset: 0; z-index: 10050; background: rgba(12,8,24,.72); display: grid; place-items: center; padding: 16px; }
.pt-ov[hidden] { display: none; }
.pt-box { width: min(1100px, 100%); background: #14101f; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); direction: rtl; }
.pt-top { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; color: #f3ecff; }
.pt-top b { font-size: 1rem; }
.pt-voice { font-size: .75rem; color: #b9a8e6; margin-inline-start: auto; }
.pt-x { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 2rem; height: 2rem; border-radius: 50%; }
.pt-stage { position: relative; aspect-ratio: 16 / 9; background: #fff; overflow: hidden; }
.pt-stage iframe { position: absolute; top: 0; left: 0; width: 1366px; border: 0; transform-origin: top left; pointer-events: none; }
.pt-cap { position: absolute; inset-inline: 4%; bottom: 5%; display: flex; gap: .6rem; align-items: center; background: rgba(20,12,40,.9); color: #fff;
  border-radius: 16px; padding: .7rem 1rem; font-size: clamp(.9rem, 1.6vw, 1.2rem); font-weight: 700; line-height: 1.7; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(12px); transition: opacity .45s, transform .45s; }
.pt-cap.on { opacity: 1; transform: none; }
.pt-emo { font-size: 1.8em; line-height: 1; }
.pt-ctrl { display: flex; align-items: center; gap: .5rem; padding: .55rem .9rem; color: #d8ccf5; }
.pt-ctrl button { border: 0; background: rgba(255,255,255,.1); color: #fff; border-radius: 10px; min-width: 2.3rem; height: 2.1rem; font-size: 1rem; }
.pt-ctrl button:hover { background: rgba(255,255,255,.2); }
.pt-prog { flex: 1; height: 6px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; }
.pt-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffcf4d, #f5a300); }
.pt-n { font-size: .8rem; font-variant-numeric: tabular-nums; min-width: 3rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { .pt-cap { transition: none; } }

/* ===== حجم الخط (تجربة 2026-09-28): 3 أحجام تكبّر محتوى الصفحة كله (الجداول والأرقام معاً) دون شريط القوائم ===== */
html.fzon.fz2 main { zoom: 1.12; }
html.fzon.fz3 main { zoom: 1.25; }
html.fzon.fz4 main { zoom: 1.35; }
/* خط عريض: تسميك موحّد لكل النصوص (يحافظ على فرق العناوين والنص العادي) */
html.fzon.fzb main { -webkit-text-stroke: .35px currentColor; }
.fs-switch { position: fixed; top: 6px; left: 8px; z-index: 2000; display: flex; gap: 2px; background: rgba(255,255,255,.95); border: 1px solid #d8dee6; border-radius: 999px; padding: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.15); direction: rtl; }
.fs-switch button { border: none; background: transparent; width: 24px; height: 22px; border-radius: 999px; font-weight: 800; color: #16324f; cursor: pointer; line-height: 1; padding: 0; }
.fs-switch .fs-b { font-family: Georgia, serif; font-size: 13px; }
.fs-sep { width: 1px; background: #d8dee6; margin: 3px 2px; }
.fs-switch button.on { background: #16324f; color: #fff; }
.fs-switch button:hover:not(.on) { background: #eef3fb; }
@media print { .fs-switch { display: none; } }
