/* ══════════════════════════════════════════
   Mashroie — Language Switcher & Bilingual CSS
   ══════════════════════════════════════════ */

/* ── FLOATING LANGUAGE TOGGLE ── */
.lang-fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
html[dir="ltr"] .lang-fab { left: auto; right: 28px; }

.lang-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg,#0B2D6B,#0EA5A0);
  color: #fff;
  border: 3px solid rgba(255,255,255,0.3);
  font-family: 'Tajawal','Cairo',sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(11,45,107,0.35);
  transition: all 0.25s ease;
  text-decoration: none;
}
.lang-fab-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 30px rgba(11,45,107,0.45);
}
.lang-fab-label {
  background: rgba(11,45,107,0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: 'Tajawal','Cairo',sans-serif;
  backdrop-filter: blur(8px);
}

/* ── INLINE LANG SWITCHER (in nav) ── */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  overflow: hidden;
  height: 34px;
}
.lang-switcher-btn {
  padding: 0 12px;
  height: 34px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-family: 'Tajawal','Cairo',sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-switcher-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lang-switcher-btn.active {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.lang-switcher-divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.2);
}
/* Dark bg version (for light pages) */
.lang-switcher.dark {
  background: rgba(11,45,107,0.08);
  border-color: rgba(11,45,107,0.18);
}
.lang-switcher.dark .lang-switcher-btn { color: #4B5563; }
.lang-switcher.dark .lang-switcher-btn:hover { background: rgba(11,45,107,0.08); color: #0B2D6B; }
.lang-switcher.dark .lang-switcher-btn.active { background: rgba(11,45,107,0.12); color: #0B2D6B; }
.lang-switcher.dark .lang-switcher-divider { background: rgba(11,45,107,0.15); }

/* ── LTR OVERRIDES for English ── */
html[dir="ltr"] body {
  font-family: 'Inter','Segoe UI',sans-serif;
  text-align: left;
}
html[dir="ltr"] .top-nav,
html[dir="ltr"] .nav-actions { flex-direction: row; }
html[dir="ltr"] .nav-brand-sub { text-align: left; }
html[dir="ltr"] .filters-sidebar { order: -1; }
html[dir="ltr"] .cat-count { margin-right: auto; margin-left: 0; }

/* ── RTL specific ── */
html[dir="rtl"] .product-price-old { margin-right: 0; margin-left: 6px; }
html[dir="rtl"] .modal-spec-row { direction: rtl; }
html[dir="ltr"] .modal-spec-row { direction: ltr; }
html[dir="ltr"] .modal-body { direction: ltr; }
html[dir="ltr"] .product-body { text-align: left; }
html[dir="ltr"] .product-supplier { flex-direction: row; }
html[dir="ltr"] .pagination { direction: ltr; }

/* ── PRODUCT DETAIL PAGE ── */
.product-detail-page {
  display: none;
  min-height: 100vh;
  background: var(--gray-50, #F9FAFB);
}
.product-detail-page.show { display: block; }

.detail-breadcrumb {
  background: #fff;
  border-bottom: 1px solid var(--gray-200, #E5E7EB);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500, #6B7280);
}
.detail-breadcrumb a { color: var(--primary, #0B2D6B); text-decoration: none; font-weight: 600; }
.detail-breadcrumb a:hover { text-decoration: underline; }
.detail-breadcrumb .sep { color: var(--gray-300, #D1D5DB); }

.detail-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  align-items: start;
}

/* ── GALLERY ── */
.detail-gallery { position: sticky; top: 80px; }
.detail-main-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid var(--gray-200, #E5E7EB);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}
.detail-main-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}
.detail-img-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
html[dir="ltr"] .detail-img-badge { right: auto; left: 12px; }

.detail-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 2px solid var(--gray-200, #E5E7EB);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 28px;
}
.detail-thumb:hover, .detail-thumb.active {
  border-color: var(--primary, #0B2D6B);
  box-shadow: 0 0 0 3px rgba(11,45,107,0.12);
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── DETAIL INFO ── */
.detail-info {}
.detail-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-bg, #F0FDFC);
  color: var(--teal, #0EA5A0);
  border: 1px solid rgba(14,165,160,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.detail-product-name {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 900;
  color: var(--gray-900, #111827);
  line-height: 1.35;
  margin-bottom: 12px;
}
.detail-supplier-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--gray-500, #6B7280);
  flex-wrap: wrap;
}
.detail-supplier-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ECFDF5;
  color: #059669;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}
.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.detail-stars { color: #F59E0B; font-size: 15px; }
.detail-rating-num { font-size: 16px; font-weight: 800; color: var(--gray-800,#1F2937); }
.detail-reviews { font-size: 13px; color: var(--gray-400,#9CA3AF); }

/* ── PRICE BOX ── */
.detail-price-box {
  background: linear-gradient(135deg,var(--primary-bg,#EFF4FF),#fff);
  border: 1.5px solid rgba(11,45,107,0.12);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.detail-price-main {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary, #0B2D6B);
  line-height: 1;
  margin-bottom: 6px;
}
.detail-price-old {
  font-size: 14px;
  color: var(--gray-400,#9CA3AF);
  text-decoration: line-through;
  margin-left: 8px;
}
html[dir="ltr"] .detail-price-old { margin-left: 0; margin-right: 8px; }
.detail-price-discount {
  display: inline-block;
  background: #FEF2F2;
  color: #EF4444;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.detail-price-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-500,#6B7280);
  margin-top: 10px;
}
.detail-price-meta .chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--gray-200,#E5E7EB);
  padding: 4px 10px;
  border-radius: 8px;
}
.detail-price-meta .chip i { font-size: 11px; }
.chip.green { border-color: #D1FAE5; background: #ECFDF5; color: #059669; }
.chip.blue  { border-color: #DBEAFE; background: #EFF6FF; color: #2563EB; }
.chip.purple{ border-color: #EDE9FE; background: #F5F3FF; color: #7C3AED; }

/* ── 4 ACTION BUTTONS ── */
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.detail-action-btn {
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid transparent;
  font-family: 'Tajawal','Cairo','Inter',sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.22s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.detail-action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.2s;
}
.detail-action-btn:hover::after { opacity: 1; }
.detail-action-btn:active { transform: scale(0.97); }

/* Cart button */
.btn-add-cart {
  background: var(--primary,#0B2D6B);
  color: #fff;
  grid-column: 1 / -1;
}
.btn-add-cart:hover { background: #1a4494; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(11,45,107,0.35); }

/* Buy Now */
.btn-buy-now {
  background: linear-gradient(135deg,#059669,#10B981);
  color: #fff;
}
.btn-buy-now:hover { box-shadow: 0 6px 20px rgba(5,150,105,0.35); transform: translateY(-1px); }

/* RFQ */
.btn-rfq-detail {
  background: #fff;
  color: var(--primary,#0B2D6B);
  border-color: var(--primary,#0B2D6B);
}
.btn-rfq-detail:hover { background: var(--primary-bg,#EFF4FF); transform: translateY(-1px); }

/* Finance */
.btn-finance-detail {
  background: linear-gradient(135deg,#7C3AED,#9333EA);
  color: #fff;
}
.btn-finance-detail:hover { box-shadow: 0 6px 20px rgba(124,58,237,0.35); transform: translateY(-1px); }

/* Wishlist row */
.detail-wishlist-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.btn-wishlist-detail {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200,#E5E7EB);
  background: #fff;
  color: var(--gray-500,#6B7280);
  font-family: 'Tajawal','Cairo','Inter',sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-wishlist-detail:hover { border-color: #EF4444; color: #EF4444; background: #FEF2F2; }
.btn-wishlist-detail.active { border-color: #EF4444; color: #EF4444; background: #FEF2F2; }

.btn-share-detail {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--gray-200,#E5E7EB);
  background: #fff;
  color: var(--gray-500,#6B7280);
  font-family: 'Tajawal','Cairo','Inter',sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-share-detail:hover { border-color: var(--teal,#0EA5A0); color: var(--teal,#0EA5A0); background: var(--teal-bg,#F0FDFC); }

/* ── DETAIL TABS ── */
.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gray-200,#E5E7EB);
  margin-bottom: 24px;
  overflow-x: auto;
}
.detail-tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-family: 'Tajawal','Cairo','Inter',sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-500,#6B7280);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.detail-tab.active { color: var(--primary,#0B2D6B); border-bottom-color: var(--primary,#0B2D6B); }
.detail-tab:hover { color: var(--primary,#0B2D6B); }

.detail-tab-panel { display: none; }
.detail-tab-panel.show { display: block; }

/* Description */
.detail-desc {
  font-size: 14px;
  line-height: 1.9;
  color: var(--gray-700,#374151);
}

/* Specs table */
.detail-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.detail-specs-table tr { border-bottom: 1px solid var(--gray-100,#F3F4F6); }
.detail-specs-table tr:hover { background: var(--gray-50,#F9FAFB); }
.detail-specs-table td { padding: 10px 14px; }
.detail-specs-table td:first-child { color: var(--gray-500,#6B7280); width: 40%; font-weight: 600; }
.detail-specs-table td:last-child { color: var(--gray-800,#1F2937); font-weight: 700; }

/* ── DETAIL BOTTOM — RELATED ── */
.detail-related {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.detail-related-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--gray-800,#1F2937);
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200,#E5E7EB);
}

/* ── CART SIDEBAR (slide-in) ── */
.cart-sidebar {
  position: fixed;
  top: 0;
  left: -420px;
  width: 400px;
  height: 100vh;
  background: #fff;
  z-index: 9998;
  box-shadow: 4px 0 40px rgba(0,0,0,0.15);
  transition: left 0.35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html[dir="rtl"] .cart-sidebar {
  left: auto;
  right: -420px;
  transition: right 0.35s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 40px rgba(0,0,0,0.15);
}
.cart-sidebar.open {
  left: 0;
}
html[dir="rtl"] .cart-sidebar.open {
  left: auto;
  right: 0;
}
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9997;
  display: none;
  backdrop-filter: blur(2px);
}
.cart-overlay.show { display: block; }

.cart-header {
  padding: 20px 20px;
  border-bottom: 1px solid var(--gray-200,#E5E7EB);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary,#0B2D6B);
  color: #fff;
}
.cart-header h3 { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.cart-close { background: rgba(255,255,255,0.2); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.cart-close:hover { background: rgba(255,255,255,0.3); }

.cart-body { flex: 1; overflow-y: auto; padding: 16px; }
.cart-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400,#9CA3AF);
}
.cart-empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.cart-empty-state p { font-size: 15px; font-weight: 600; }

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100,#F3F4F6);
  align-items: start;
}
.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--gray-100,#F3F4F6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 700; color: var(--gray-800,#1F2937); margin-bottom: 4px; line-height: 1.4; }
.cart-item-supplier { font-size: 11px; color: var(--gray-400,#9CA3AF); margin-bottom: 8px; }
.cart-item-price { font-size: 15px; font-weight: 900; color: var(--primary,#0B2D6B); }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--gray-300,#D1D5DB);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.qty-btn:hover { border-color: var(--primary,#0B2D6B); color: var(--primary,#0B2D6B); }
.qty-num { font-size: 14px; font-weight: 800; min-width: 20px; text-align: center; }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--gray-300,#D1D5DB);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  transition: color 0.2s;
}
.cart-item-remove:hover { color: #EF4444; }

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200,#E5E7EB);
  background: var(--gray-50,#F9FAFB);
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--gray-600,#4B5563);
  margin-bottom: 6px;
}
.cart-summary-total {
  font-size: 17px;
  font-weight: 900;
  color: var(--primary,#0B2D6B);
  padding-top: 8px;
  border-top: 1px solid var(--gray-200,#E5E7EB);
  margin-top: 6px;
}
.cart-checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary,#0B2D6B);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Tajawal','Cairo','Inter',sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.cart-checkout-btn:hover { background: #1a4494; transform: translateY(-1px); }
.cart-continue-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--gray-600,#4B5563);
  border: 1.5px solid var(--gray-300,#D1D5DB);
  border-radius: 10px;
  font-family: 'Tajawal','Cairo','Inter',sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}
.cart-continue-btn:hover { border-color: var(--primary,#0B2D6B); color: var(--primary,#0B2D6B); }

/* Cart badge animation */
.cart-badge {
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  animation: none;
}
.cart-badge.bounce {
  animation: cartBounce 0.4s ease;
}
@keyframes cartBounce {
  0%,100%{transform:scale(1)}
  40%{transform:scale(1.4)}
  70%{transform:scale(0.9)}
}

/* ── RESPONSIVE ── */
@media(max-width:900px){
  .detail-layout { grid-template-columns: 1fr; }
  .detail-gallery { position: static; }
  .detail-actions { grid-template-columns: 1fr; }
  .btn-add-cart { grid-column: 1; }
  .lang-fab { bottom: 80px; }
}
@media(max-width:600px){
  .cart-sidebar { width: 100%; }
  .detail-main-img { aspect-ratio: 1/1; }
  .detail-product-name { font-size: 1.3rem; }
}
