.contact-tools { display: inline-flex; position: relative; }
.generated-files-sync-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 8px;
  background: #fff;
  color: #214b3b;
  cursor: pointer;
  font: inherit;
}
.generated-files-sync-btn:hover { filter: brightness(.96); }
[dir="ltr"] .generated-files-sync-btn {
  right: auto;
  left: 0;
}
.nav-bar { align-items: center; }
.contact-tools, .visitor-count { align-self: center; }
.customer-ai-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: min(260px, calc(100vw - 24px));
  padding: 10px;
  background: #fff;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(0,0,0,.2);
  z-index: 20;
}
.customer-ai-panel.hidden { display: none !important; }
.customer-ai-panel input { width: 100%; box-sizing: border-box; padding: 7px; }
.customer-ai-panel button { margin-top: 6px; padding: 5px 12px; cursor: pointer; }
.customer-ai-panel p { margin: 8px 0 0; font-size: .85em; line-height: 1.5; }
.visitor-count { color: #fff; font-size: .9em; white-space: nowrap; }
.weather-status {
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: .85em;
  white-space: nowrap;
  margin-inline: 4px;
}
.weather-tools { position: relative; display: inline-flex; align-items: center; }
.nav-bar .weather-status,
.nav-bar .weather-status:hover,
.nav-bar .weather-status:focus {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  appearance: none;
}
.weather-tools:hover .weather-status,
.weather-tools:focus-within .weather-status { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.weather-tools:hover .weather-menu,
.weather-tools:focus-within .weather-menu { display: grid; }
.weather-status-compact { max-width: 210px; overflow: hidden; text-overflow: ellipsis; font-size: .85em !important; }
.prayer-library-divider { margin: 18px 0 12px; border-top: 1px solid rgba(255,255,255,.16); }
.prayer-library-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.prayer-library-tab { min-width: 0; height: 34px; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 3px; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; padding: 2px 4px; background: #334155; color: #fff; cursor: pointer; font: inherit; font-size: .82rem; line-height: 1; overflow: hidden; }
.prayer-library-tab span { display: inline-block; width: auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; line-height: 1.1; }
.prayer-library-tab.active, .prayer-library-tab:hover { background: #0e7490; }
.crescent-star-icon { display: inline-flex; align-items: center; color: currentColor; font-size: 1em; line-height: 1; letter-spacing: -0.12em; direction: ltr; }
.crescent-star-star { display: inline-block; margin-inline-start: -0.18em; transform: translate(-0.05em, -0.08em); font-size: .55em; line-height: 1; }
.prayer-library-content { margin-top: 12px; max-height: 38vh; overflow-y: auto; }
#prayer-times-modal .modal-card { width: min(340px, calc(100% - 32px)) !important; max-width: 340px !important; max-height: 75vh; overflow-y: auto; padding: 12px !important; }
#prayer-times-modal #prayer-times-list { margin-top: 10px !important; line-height: 1.55 !important; font-size: 1rem !important; }
#prayer-times-modal .prayer-library-content { max-height: 30vh; }
.prayer-library-content h4 { margin: 8px 0; color: #7dd3fc; }
.prayer-heading-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.prayer-heading-row h3 { margin: 0 !important; }
.adhan-toggle { border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 1.1rem; padding: 3px; }
.adhan-toggle.is-muted { opacity: .45; }
.qibla-tools { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 12px; }
.qibla-compass { position: relative; width: 76px; height: 76px; border: 3px solid #38bdf8; border-radius: 50%; background: radial-gradient(circle, #334155 0 52%, #1e293b 53%); cursor: pointer; transition: transform .25s ease; }
.qibla-compass:hover { transform: scale(1.08); }
.compass-direction { position: absolute; color: #bae6fd; font: bold .65rem sans-serif; }
.compass-north { top: 3px; left: 50%; transform: translateX(-50%); }
.compass-east { right: 5px; top: 50%; transform: translateY(-50%); }
.compass-south { bottom: 3px; left: 50%; transform: translateX(-50%); }
.compass-west { left: 5px; top: 50%; transform: translateY(-50%); }
.compass-needle { position: absolute; left: 50%; top: 15px; width: 2px; height: 42px; background: #ef4444; transform-origin: 50% 23px; transform: translateX(-50%) rotate(0deg); transition: transform .18s linear; box-shadow: 0 0 4px rgba(239,68,68,.8); }
.kaaba-marker { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(0deg) translateY(-27px) rotate(0deg); font-size: 1.15rem; transition: transform .18s linear; z-index: 2; }
.qibla-bearing { color: #cbd5e1; font-size: .75rem; }
.library-empty-state { color: #cbd5e1; text-align: center; margin: 12px 0; }
.library-file-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.library-file-item { min-width: 0; margin: 0; padding: 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; background: rgba(255,255,255,.06); text-align: center; }
.library-file-item .product-media-thumb { width: 100%; height: 100px; object-fit: cover; }
.library-file-item .product-file-preview { display: block; }
.library-file-item { position: relative; }
.library-file-item > .file-expand-btn { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; z-index: 2; }
.library-saved-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: .75rem; }
.library-file-item .product-book { min-height: 100px; }
.library-file-item figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; color: #e2e8f0; }
.master-books-fields { margin: 16px 0; padding: 14px; border: 1px solid rgba(21,94,67,.35); border-radius: 9px; background: rgba(21,94,67,.08); }
.master-books-fields h4 { margin: 0 0 5px; color: #155e43; }
.master-books-fields p { margin: 0 0 12px; font-size: .85rem; }
.book-upload-row { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 10px; margin: 8px 0; }
.book-upload-row { grid-template-columns: minmax(150px, .7fr) minmax(0, 1.1fr) minmax(0, .8fr) 28px; }
.book-upload-row input { min-width: 0; }
.library-files-status { margin-inline-start: 8px; font-size: .85rem; color: #155e43; }
:root {
  --bg-color: #847500; 
  --internal-text-color: #111;
  --header-color: #333;
  --footer-color: #333;
  --card-shadow: rgba(0, 0, 0, 0.15);
}

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-color);
  color: var(--internal-text-color);
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.3s ease;
}

header {
  background: var(--header-color) !important;
  color: #fff !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  flex-wrap: wrap;
  position: relative;
}

.color-customizer {
  position: fixed;
  top: 72px;
  right: 16px;
  left: auto;
  background: rgba(20, 20, 20, 0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px;
  width: min(260px, calc(100vw - 40px));
  box-shadow: 0 8px 22px rgba(0,0,0,0.2);
  z-index: 40;
  cursor: default;
}

.sound-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  right: auto;
  z-index: 42;
  background: rgba(20, 20, 20, 0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 280px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.2);
}

[dir="ltr"] .sound-panel {
  right: auto;
  left: 90px;
}

.sound-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
  color: #fff;
}

.close-sound-panel {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4em;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.sound-option-btn,
#sound-theme-select {
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #2a2a2a;
  color: #fff;
  padding: 8px 10px;
}

.sound-label {
  font-size: 0.8em;
  opacity: 0.9;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.72);
}

.intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
  padding: 24px;
}

.intro-logo {
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 900;
  margin-bottom: 12px;
}

.intro-text {
  font-size: clamp(1rem, 1.8vw, 1.6rem);
  margin: 0;
}

.color-customizer.dragging {
  cursor: grabbing;
  user-select: none;
}

.color-customizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 700;
  cursor: default;
}

.close-color-customizer {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4em;
  cursor: pointer;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
}

.color-swatch.active {
  border-color: #fff;
  transform: scale(1.08);
}

.pattern-label,
.custom-color-label {
  display: block;
  font-size: 0.8em;
  margin: 8px 0 6px;
  color: #f1f1f1;
}

#pattern-select,
#custom-color-input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #2a2a2a;
  color: #fff;
  padding: 8px 10px;
  box-sizing: border-box;
}

#custom-color-input {
  padding: 4px;
  height: 42px;
}

footer {
  background: var(--footer-color) !important;
  color: #fff !important;
  text-align: center;
  padding: 25px 15px;
  font-size: 0.95em;
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer-line {
  margin: 4px 0;
  width: 100%;
}

.logo {
  font-size: 1.5em;
  font-weight: bold;
}

.nav-bar button, .settings button {
  background: transparent;
  border: none;
  color: #fff !important;
  cursor: pointer;
  margin: 5px;
  font-size: 1em;
  transition: transform 0.2s;
}

.settings {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  vertical-align: middle;
}

#prayer-times-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.nav-bar button:hover, .settings button:hover {
  transform: scale(1.1);
}

.library-icon-btn { font-size: 1.35rem !important; padding: 5px !important; }
.library-modal { position: fixed; inset: 0; z-index: 10001; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(0, 0, 0, .68); }
.library-modal.active { display: flex; }
.library-card { position: relative; width: min(760px, 100%); max-height: min(88vh, 720px); overflow-y: auto; padding: 26px; border-radius: 14px; background: #fffdf7; color: #243226; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.library-card h3 { margin: 0 0 18px; color: #155e43; text-align: center; }
.library-intro { margin: 0 0 16px; text-align: center; }
.library-close-btn { position: absolute; top: 10px; left: 14px; border: 0; background: transparent; color: #52605a; font-size: 1.8rem; cursor: pointer; }
.quran-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quran-edition { padding: 16px; border: 1px solid #d8e2d6; border-radius: 10px; background: #f5faf3; }
.quran-edition h4 { margin: 0 0 12px; color: #155e43; }
.book-color-options { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.book-color-option { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 1px solid #cbd5ca; border-radius: 7px; background: #fff; color: #26332b; cursor: pointer; font: inherit; }
.book-color-option.selected { border-color: #155e43; box-shadow: 0 0 0 2px rgba(21, 94, 67, .18); }
.book-color-option span { width: 13px; height: 13px; border-radius: 50%; background: #26834b; }
.book-color-option[data-color="blue"] span { background: #2878bd; }
.book-color-option[data-color="brown"] span { background: #87552e; }
.book-color-option[data-color="red"] span { background: #a83c3c; }
.book-color-option[data-color="gold"] span { background: #c99b28; }
.library-open-btn, .library-book-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; }
.library-open-btn { width: 100%; box-sizing: border-box; justify-content: center; padding: 9px 12px; border-radius: 7px; background: #155e43; color: #fff; }
.book-link-list { display: grid; gap: 12px; }
.library-book-link { padding: 15px; border: 1px solid #d8e2d6; border-radius: 9px; background: #f5faf3; color: #155e43; }
.library-book-link span { font-size: .85rem; color: #68756d; }

@media (max-width: 640px) {
  header { padding: 9px 10px; }
  .logo { width: 100%; justify-content: center; margin-bottom: 5px; font-size: 1.08em; text-align: center; }
  .nav-bar { width: 100%; justify-content: center; gap: 3px; }
  .nav-bar button { margin: 3px 1px; padding: 6px 7px; font-size: .82em; }
  .weather-status, .visitor-count { display: inline-block; font-size: .72em; margin-inline: 2px; }
  .nav-bar { align-items: center; }
  .header-datetime-box { order: 3; width: 100%; margin-top: 5px; }
  .settings { width: 100%; display: inline-flex; justify-content: center; flex-wrap: nowrap; gap: 1px; }
  .settings button { margin: 2px; }
  .library-card { padding: 24px 15px 16px; }
  .quran-type-grid { grid-template-columns: 1fr; }
  .library-book-link { align-items: flex-start; flex-direction: column; gap: 4px; }
  .book-upload-row { grid-template-columns: minmax(100px, .8fr) minmax(0, 1fr) 28px; gap: 4px; }
  .book-upload-row .library-saved-names { grid-column: 1 / -1; grid-row: 2; }
  .library-files-status { display: block; margin: 7px 0 0; }
}

.tabs-container {
  display: flex;
  justify-content: center;
  background: transparent;
  padding: 15px 0;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-link {
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-link.active, .tab-link:hover {
  background: #dfe3e8;
  color: #111;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.tab-link:hover,
.tab-link:focus-visible {
  transform: scale(1.08);
}

.dark-mode .tab-link {
  background: #4a4a4a;
  color: #f3f3f3;
  border-color: rgba(255,255,255,0.2);
}

.dark-mode .tab-link.active,
.dark-mode .tab-link:hover {
  background: #6b6b6b;
  color: #fff;
}

.tab-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
}

.search-section {
  text-align: center;
  padding: 10px;
}

.search-section input,
.tab-search-input {
  width: 80%;
  max-width: 400px;
  padding: 10px 15px;
  border-radius: 20px;
  border: none;
  outline: none;
  font-size: 1em;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: right;
  direction: rtl;
}
.search-section input::placeholder,
.tab-search-input::placeholder {
  text-align: right;
  direction: rtl;
}
html[lang="en"] .search-section input,
html[lang="en"] .tab-search-input {
  text-align: left;
  direction: ltr;
}
html[lang="en"] .search-section input::placeholder,
html[lang="en"] .tab-search-input::placeholder {
  text-align: left;
  direction: ltr;
}

.search-input-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  direction: ltr;
}
.search-input-row.language-left { flex-direction: row-reverse; }
.search-input-row > input { flex: 1 1 auto; }
.voice-search-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  direction: ltr;
}
.voice-search-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.15);
  cursor: pointer;
  font-size: 1.1rem;
}
.voice-search-controls.language-first .voice-search-language { order: 1; }
.voice-search-controls.language-first .voice-search-button { order: 2; }
.voice-search-controls:not(.language-first) .voice-search-button { order: 1; }
.voice-search-controls:not(.language-first) .voice-search-language { order: 2; }
.voice-search-button.is-listening {
  background: #fee2e2;
  box-shadow: 0 0 0 3px rgba(239,68,68,.25);
}
.voice-search-button:disabled { opacity: .55; cursor: not-allowed; }
.voice-recording-player {
  width: 150px;
  height: 28px;
  margin-inline-start: 4px;
}
.voice-search-language {
  width: 14px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(15,23,42,.18);
  border-radius: 4px;
  background: #fff;
  color: transparent;
  cursor: pointer;
  font-size: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #1e293b 50%), linear-gradient(135deg, #1e293b 50%, transparent 50%);
  background-position: calc(50% - 2px) 8px, calc(50% + 2px) 8px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.voice-search-language option { color: #1e293b; font-size: .85rem; }

.global-search-section { position: relative; z-index: 5; }
.global-search-section input { width: min(88vw, 460px); max-width: 460px; }
.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 10%;
  right: 10%;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
  overflow: hidden;
  text-align: start;
}
.search-suggestions.visible { display: flex; flex-direction: column; }
.search-suggestion {
  border: 0;
  border-bottom: 1px solid #eee;
  background: #fff;
  color: #222;
  padding: 9px 12px;
  text-align: inherit;
  cursor: pointer;
}
.search-suggestion:hover, .search-suggestion:focus { background: #f1f5f9; }
.custom-tab-search { position: relative; }
.custom-tab-search .tab-search-input { width: min(100%, 360px); }
.tab-search-suggestions { left: 0; right: 0; max-width: 420px; }
.product-focus {
  outline: 4px solid #ff4757;
  box-shadow: 0 0 0 8px rgba(255,71,87,.22);
}

.tab-search-box {
  text-align: center;
  margin: 0 0 12px;
}

.ad-box {
  background: #ff4757;
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  font-size: 1.1em;
  margin: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-ad-box {
  margin: 0 0 12px;
}

.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

.section-title {
  text-align: center;
  color: #fff;
  font-size: 1.8em;
  margin-bottom: 20px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding: 10px;
}

.product-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 300px;
  max-width: 260px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 4px 15px var(--card-shadow);
  transition: transform 0.3s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.product-card h4 {
  margin: 10px 0 5px 0;
  font-size: 1.2em;
}

.benefits-text {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 10px;
  min-height: 45px;
}

.price-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 3px;
}

.price-text {
  font-weight: bold;
  color: #27ae60;
}

.old-price-text {
  font-size: 0.85em;
  color: #999;
}

/* كلمة الكمية أسفل السعر مباشرة */
.stock-badge {
  display: block;
  font-size: 0.85em;
  color: #2980b9;
  margin-bottom: 8px;
  margin-top: 2px;
}

.product-size, .quantity {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.buy-btn, #confirm-order-btn, #client-submit-btn, #sellerForm button[type="submit"] {
  background: #27ae60;
  color: white;
  border: none;
  padding: 10px;
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.buy-btn:hover, #confirm-order-btn:hover, #client-submit-btn:hover, #sellerForm button[type="submit"]:hover {
  background: #219653;
}

/* 🛍️ تنسيق بوابة البائع وملخص الطلبات */
.seller-panel, .cart-summary, .order-form {
  background: #fff;
  max-width: 520px;
  margin: 30px auto;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  position: relative;
}

.seller-auth-panel {
  max-width: 760px;
  margin: 30px auto;
  padding: 20px;
  position: relative;
}

.auth-card {
  background: rgba(255,255,255,0.96);
  border-radius: 18px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  padding: 25px 20px;
}

.auth-toggle-row {
  display: flex;
  justify-content: center;
  margin: 14px 0 8px;
}

.auth-toggle-link {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #1f2937;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}

.auth-toggle-link:hover {
  background: #f3f4f6;
}

.auth-card h3 {
  text-align: center;
  margin-bottom: 18px;
  color: #1f1f1f;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form label {
  font-weight: 700;
  color: #333;
}

.auth-form input,
.auth-form button,
.profile-form input,
.profile-form select,
.profile-form button,
.seller-product-controls button,
.mini-btn,
.secondary-btn {
  font-family: 'Cairo', sans-serif;
}

.auth-form input,
.profile-form input,
.profile-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.auth-form button,
.secondary-btn,
#seller-login-btn,
#seller-register-btn,
#seller-profile-btn,
#seller-logout-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.auth-form button,
#seller-login-btn,
#seller-register-btn,
#seller-profile-btn {
  background: linear-gradient(135deg, #0d6efd, #0057d9);
  color: #fff;
}

.secondary-btn {
  background: #f1f5f9;
  color: #1f2937;
}

.danger-btn {
  background: #fee2e2;
  color: #991b1b;
}

.auth-divider {
  text-align: center;
  margin: 20px 0 12px;
  border-bottom: 1px solid #ddd;
  position: relative;
}

.auth-divider span {
  background: #fff;
  padding: 0 12px;
  position: relative;
  top: 10px;
  color: #666;
}

.seller-account-header {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 18px;
}

.seller-mini-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 130px;
}

#seller-logout-btn {
  background: #e11d48;
  color: #fff;
}

.seller-product-controls {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}

.seller-product-controls .secondary-btn {
  flex: 1;
}

.seller-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  margin-bottom: 10px;
}

.seller-product-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seller-product-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.seller-edit-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  margin-top: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.seller-edit-panel h5 {
  margin: 0 0 16px;
  font-size: 1.1em;
  text-align: center;
}

.seller-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.custom-tab-toolbar {
  margin-bottom: 12px;
}

.custom-tab-search {
  padding: 0;
  margin: 0 0 10px;
  text-align: center;
}

.custom-tab-search input {
  width: min(100%, 360px);
  max-width: 100%;
}

.dimensions-preview {
  min-height: 1.4em;
  margin-top: 8px;
  color: #444;
  font-weight: 700;
  text-align: center;
}

.mini-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
  background: #dbeafe;
  color: #1d4ed8;
}

.danger-mini-btn {
  background: #fee2e2;
  color: #b91c1c;
}

.hidden-item {
  opacity: 0.7;
  border-style: dashed;
}

.empty-state {
  color: #666;
  text-align: center;
  padding: 15px;
}

.custom-tab {
  border: none;
  position: relative;
}

.custom-tab .tab-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
}

.custom-tab .product-card,
.product-card {
  min-height: 320px;
}

.hidden {
  display: none !important;
}

.field-block {
  width: 100%;
}

.phone-group-right {
  margin-inline-start: 0;
}

.seller-offer-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 16px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.offer-toggle-label {
  font-weight: 700;
  color: #1f2937;
}

.seller-offer-text-wrap {
  margin-bottom: 16px;
}

.seller-product-manager {
  margin-top: 18px;
}

.seller-products-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seller-product-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.seller-product-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.seller-product-main strong {
  color: #111827;
}

.seller-product-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.input-group {
  position: relative;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.field-label {
  display: block;
  font-size: 0.88em;
  font-weight: 700;
  margin-bottom: 8px;
  color: #2d2d2d;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input,
.input-with-icon textarea,
.input-with-icon select,
.input-group input,
.input-group select {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  outline: none;
  box-sizing: border-box;
}

.input-with-icon textarea {
  min-height: 90px;
  resize: vertical;
}

[dir="ltr"] .input-with-icon input,
[dir="ltr"] .input-with-icon textarea,
[dir="ltr"] .input-with-icon select,
[dir="ltr"] .input-group input,
[dir="ltr"] .input-group select {
  padding: 10px 15px 10px 40px;
}

.input-icon {
  position: absolute;
  right: 12px;
  font-size: 1.1em;
  pointer-events: none;
  z-index: 2;
}

[dir="ltr"] .input-icon {
  right: auto;
  left: 12px;
}

.product-detail-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.size-unit-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.price-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.price-row .input-group {
  flex: 1;
  margin-bottom: 0;
}

.half-width {
  flex: 1;
}

.size-selection-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.product-mode-buttons {
  display: flex;
  gap: 6px;
  margin: 6px 0;
}

.product-mode-btn {
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  padding: 6px 12px;
  cursor: pointer;
}

.product-mode-btn.active {
  background: #0d9a6d;
  color: #fff;
}

.mode-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0;
}

.mode-fields input {
  min-width: 0;
}
#sellerHomeRooms,
#sellerHomeBathrooms,
#sellerHomeKitchens,
#sellerHomeLounges,
#editHomeRooms,
#editHomeBathrooms,
#editHomeKitchens,
#editHomeLounges {
  direction: rtl;
  text-align: right;
  padding-inline: 6px;
  font-size: .82rem;
}
#sellerHomeRooms::placeholder,
#sellerHomeBathrooms::placeholder,
#sellerHomeKitchens::placeholder,
#sellerHomeLounges::placeholder,
#editHomeRooms::placeholder,
#editHomeBathrooms::placeholder,
#editHomeKitchens::placeholder,
#editHomeLounges::placeholder {
  direction: rtl;
  text-align: right;
}

.product-media {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 2px;
}

.media-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.media-slots .file-input-wrap {
  min-width: 0;
  padding: 6px;
  position: relative;
}

.clear-media-btn,
.clear-all-media-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.clear-media-btn {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-end: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: #b42318;
  color: #fff;
  font-size: 1rem;
  line-height: 20px;
  z-index: 2;
}

.clear-media-btn:hover,
.clear-media-btn:focus-visible {
  background: #7a1710;
}

.clear-all-media-btn {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 6px 11px;
  border-radius: 5px;
  background: #7a1710;
  color: #fff;
  font-size: .85rem;
}

.clear-all-media-btn:hover,
.clear-all-media-btn:focus-visible {
  background: #54100b;
}

.library-upload-slot {
  position: relative;
}

.clear-library-slot-btn,
.clear-all-library-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.clear-library-slot-btn {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  border-radius: 50%;
  background: #b42318;
  color: #fff;
  font-size: 1rem;
  line-height: 22px;
}

.clear-library-slot-btn:hover,
.clear-library-slot-btn:focus-visible {
  background: #7a1710;
}

.clear-all-library-btn {
  justify-self: end;
  grid-column: 1 / -1;
  padding: 6px 11px;
  border-radius: 5px;
  background: #7a1710;
  color: #fff;
  font-size: .85rem;
}

.clear-all-library-btn:hover,
.clear-all-library-btn:focus-visible {
  background: #54100b;
}

@media (max-width: 640px) {
  .media-slots {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.product-media-thumb {
  width: 72px;
  height: 56px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
}

.product-book {
  width: 100%;
  min-height: 180px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
}

.product-file-preview { position: relative; display: inline-flex; align-items: flex-start; }
.file-expand-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 4px;
  background: rgba(0,0,0,.7);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.product-file-link {
  display: inline-flex;
  align-items: center;
  padding: 6px;
  background: #f1f1f1;
  border-radius: 5px;
  white-space: nowrap;
}

.lightbox-media-preview {
  max-width: 90vw;
  max-height: 85vh;
  width: min(90vw, 900px);
  height: min(85vh, 700px);
  border: 0;
  border-radius: 8px;
  background: #000;
}
.video-lightbox-tools {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 7px;
  width: min(90vw, 900px);
  max-width: 90vw;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  margin-top: 4px;
  padding: 9px;
  border-radius: 9px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
}
.video-lightbox-tools.hidden { display: none; }
.video-lightbox-tools button,
.video-lightbox-tools a,
.video-lightbox-tools select {
  flex: 0 0 auto;
  border: 1px solid #64748b;
  border-radius: 5px;
  background: #1e293b;
  color: #fff;
  padding: 5px 8px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.video-lightbox-tools label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; font-size: .82rem; }
.video-seek-preview {
  position: fixed;
  width: 160px;
  padding: 3px;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: #0f172a;
  pointer-events: none;
  transform: none;
}
.video-seek-preview.hidden { display: none; }
.video-seek-preview canvas { display: block; width: 160px; height: 90px; }
.video-seek-preview span { display: block; color: #fff; font-size: .72rem; text-align: center; }
.lightbox:has(.lightbox-media-preview) { flex-direction: column; }
.lightbox:has(.lightbox-media-preview) .video-lightbox-tools { flex: 0 0 auto; }
.lightbox-media-preview { max-width: min(94vw, 1100px); max-height: 76vh; }
.video-replay-button {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 5;
  width: 62px;
  height: 62px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  font-size: 2rem;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.video-replay-button.hidden { display: none; }
.video-lightbox-stage {
  position: relative;
  display: inline-block;
  max-width: min(94vw, 1100px);
  max-height: 76vh;
  line-height: 0;
}
.video-lightbox-stage .lightbox-media-preview {
  display: block;
}
.video-lightbox-stage .video-replay-button {
  position: absolute;
}
.custom-video-float {
  position: fixed;
  z-index: 2000;
  top: 18px;
  right: 18px;
  width: 320px;
  height: 180px;
  min-width: 180px;
  min-height: 102px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  user-select: none;
  touch-action: none;
}
.custom-video-float.hidden { display: none; }
.custom-video-float video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: none;
  max-height: none;
  background: #000;
  pointer-events: none;
}
.custom-video-float-toggle,
.custom-video-float-mute {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 50%;
  background: rgba(15,23,42,.72);
  color: #fff;
  cursor: pointer;
}
.custom-video-float-toggle {
  inset: 50% auto auto 50%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  transform: translate(-50%, -50%);
}
.custom-video-float-mute {
  right: 8px;
  bottom: 8px;
  width: 32px;
  height: 32px;
  font-size: .9rem;
}
.product-video-preview { position: relative; display: inline-block; max-width: 100%; }
.product-audio-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(100%, 420px);
  gap: 0;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 8px;
  background: #111827;
}
.product-audio-name {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 6px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #1f2937;
  color: #f8fafc;
  font-size: .78rem;
  text-align: center;
}
.product-audio-bar audio {
  display: block;
  width: 100%;
  height: 34px;
}
.video-expand-btn { position: absolute; inset-block-start: 7px; inset-inline-end: 7px; z-index: 3; }

.size-manual,
.size-select-wrap {
  flex: 1;
}

.size-unit-inline {
  min-width: 110px;
}

.size-unit-inline select,
.size-unit-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-size: 0.95em;
  box-sizing: border-box;
}

.size-or-divider {
  min-width: 26px;
  text-align: center;
  font-weight: bold;
  color: #555;
}

.size-selection-group .input-with-icon {
  min-width: 0;
}

.size-selection-group .input-with-icon input,
.size-selection-group .input-with-icon select {
  min-width: 0;
}

.custom-size-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #f5f5f5;
  color: #555;
  cursor: pointer;
  font-weight: bold;
}

.custom-size-icon.active {
  background: #0d9a6d;
  color: #fff;
  border-color: #087653;
}

.custom-size-add {
  font-size: 1.25em;
}

.dimensions-fields {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.dimensions-fields input {
  flex: 1;
  min-width: 0;
}

.product-dimensions {
  margin: 6px 0;
  color: #444;
  font-size: 0.9em;
}

.product-mode-details {
  margin-top: 4px;
  font-size: 0.9em;
}

.mode-tenure {
  display: block;
  color: #b45309;
  margin-top: 4px;
  font-weight: 800;
}

.mode-finishing {
  display: block;
  margin-bottom: 4px;
}

.bed-count-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 0;
}
.bed-count-control > input {
  flex: 1 1 auto;
  min-width: 0;
}
.bed-toggle {
  flex: 0 0 34px;
  border: 1px solid #d97706;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px 4px;
}
.bed-options {
  position: absolute;
  z-index: 30;
  top: 0;
  inset-inline-start: 38px;
  width: 100%;
  min-width: 0;
  height: 34px;
  overflow-y: hidden;
}
.bed-options:not(.hidden) {
  height: 34px;
  overflow: hidden;
  background: var(--surface-color, #fff);
  border: 1px solid #d97706;
}
.bed-options.has-bed-value {
  position: static;
  height: 34px;
  overflow: hidden;
  border-color: #15803d;
  font-weight: 700;
}
.mode-fields.bed-layout-compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.mode-fields.bed-layout-compact > input,
.mode-fields.bed-layout-compact > select,
.mode-fields.bed-layout-compact .bed-count-control > input {
  padding-inline: 6px;
  font-size: .82rem;
}
#sellerHomeFinishing,
#sellerHomeTenure,
#editHomeFinishing,
#editHomeTenure {
  grid-row: 2;
}
#sellerHomeFinishing,
#editHomeFinishing {
  grid-column: 1;
}
#sellerHomeTenure,
#editHomeTenure {
  grid-column: 2;
}

.mode-fields select {
  min-width: 0;
  padding: 8px;
  border: 1px solid #d97706;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .mode-fields {
    grid-template-columns: repeat(2, 1fr);
  }
  .bed-count-control {
    grid-column: 1 / -1;
  }
}

.custom-size-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.custom-size-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fafafa;
  font-size: 0.85em;
}

.custom-size-remove {
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font-weight: bold;
  padding: 0 3px;
}

.file-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 40px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

html[lang="en"] .file-input-wrap {
  padding-left: 12px;
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-browse-button {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
  font-size: 0.9em;
}

.file-button-icon {
  flex: 0 0 1.5em;
  text-align: center;
  font-size: 1.05em;
}

.file-browse-button:hover,
.file-browse-button:focus {
  background: #e8e8e8;
  outline: 2px solid rgba(31, 110, 212, 0.35);
}

.file-status {
  font-size: 0.8em;
  color: #555;
  white-space: nowrap;
}

#editProductSizeCustom::placeholder {
  opacity: 0.5;
}

/* تنسيق دمج تاريخ الإنتاج وتاريخ الإنتهاء بجوار بعضهما مع حرف و */
.dates-shared-container {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
}

.date-box-wrapper {
  flex: 1;
}

.date-conjunction-letter {
  font-weight: bold;
  font-size: 1.1em;
  padding: 0 4px;
  margin-top: 18px;
  color: #333;
}

.m-0 {
  margin-bottom: 0 !important;
}

/* 🔹 تنسيق حاويات حقول التاريخ المتقدمة */
.date-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.date-input-group input[type="text"] {
  padding-inline-start: 35px;
  padding-inline-end: 45px;
}

.hidden-native-date {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.calendar-trigger-btn {
  position: absolute;
  left: 2px;
  top: 2px;
  bottom: 2px;
  width: 40px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-inline-start: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  transition: background 0.2s;
  z-index: 3;
}

[dir="ltr"] .calendar-trigger-btn {
  left: auto;
  right: 2px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  border-inline-start: none;
  border-inline-end: 1px solid rgba(0, 0, 0, 0.1);
}

.calendar-trigger-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* زر الصعود لأعلى */
#scroll-to-top-btn, .scroll-to-top-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #333;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  z-index: 10;
}

/* زر الصعود في بوابة تسجيل الدخول - أسفل اليمين */
.seller-auth-scroll {
  top: auto !important;
  bottom: 12px !important;
  left: auto !important;
  right: 12px !important;
}

/* زر الصعود في السلة وطلب التوصيل - مرتفع قليلاً */
.cart-scroll-btn,
.order-scroll-btn {
  top: 50px !important;
}

[dir="ltr"] #scroll-to-top-btn, [dir="ltr"] .scroll-to-top-btn {
  left: auto;
  right: 12px;
}

/* نافذة عرض الصور (Lightbox) */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  left: 30px;
  color: white;
  font-size: 2.5em;
  cursor: pointer;
}

[dir="ltr"] .close-lightbox {
  left: auto;
  right: 30px;
}

/* نافذة التأكيد المخصصة */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  max-width: 350px;
  width: 90%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 8px 25px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

#modal-yes-btn {
  background: #27ae60;
  color: white;
}

#modal-no-btn {
  background: #e74c3c;
  color: white;
}

/* تنسيق الوضع الليلي العام */
.dark-mode {
  --internal-text-color: #f1f1f1;
  --header-color: #121212;
  --footer-color: #121212;
  --card-shadow: rgba(255, 255, 255, 0.05);
}

.dark-mode .product-card,
.dark-mode .seller-panel,
.dark-mode .cart-summary,
.dark-mode .order-form,
.dark-mode .modal-card,
.dark-mode .auth-card,
.dark-mode .seller-account-header,
.dark-mode .seller-offer-toggle-wrap,
.dark-mode .seller-product-item,
.dark-mode .seller-edit-panel {
  background: var(--card-tab-color, #1f1f1f) !important;
  color: #f5f5f5 !important;
  border-color: #4b5563 !important;
}

.dark-mode .auth-card h3,
.dark-mode .field-label,
.dark-mode .offer-toggle-label,
.dark-mode .seller-product-main strong,
.dark-mode .seller-product-main span,
.dark-mode .seller-product-main small,
.dark-mode .empty-state,
.dark-mode .date-conjunction-letter {
  color: #f5f5f5 !important;
}

.dark-mode .product-card {
  background: #2b2b2b !important;
}

.dark-mode .product-dimensions {
  color: #999 !important;
}

.weather-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 3px;
  min-width: 125px;
  max-height: 105px;
  overflow-y: auto;
  padding: 3px;
  background: #1f2937;
  border: 1px solid #64748b;
  border-radius: 7px;
  box-shadow: 0 5px 16px rgba(0,0,0,.25);
}
.weather-menu.hidden { display: none; }
.weather-tools:hover .weather-menu.hidden,
.weather-tools:focus-within .weather-menu.hidden { display: grid; }
.weather-menu button { border: 0; padding: 2px 5px; background: #334155; color: #fff; text-align: start; cursor: pointer; font: inherit; font-size: .6rem; line-height: 1.1; border-radius: 3px; }
.weather-menu button:hover { background: #0e7490; }
.dark-mode .weather-menu { background: #2b2b2b; }
.dark-mode .weather-menu button { color: #fff; }

.dark-mode .product-mode-details {
  color: #999 !important;
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
  background: #2b2b2b !important;
  color: #fff !important;
  border-color: #5a5a5a !important;
}

.dark-mode .auth-divider {
  border-bottom-color: #4b5563;
}

.dark-mode .auth-divider span {
  background: #1f1f1f;
  color: #f5f5f5;
}

.dark-mode .secondary-btn {
  background: #374151 !important;
  color: #fff !important;
}

.dark-mode .mini-btn {
  background: #1d4ed8 !important;
  color: #dbeafe !important;
}

.dark-mode .danger-mini-btn {
  background: #7f1d1d !important;
  color: #fee2e2 !important;
}


/* 🕒 ساعة الهيدر والتواريخ */
.header-datetime-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.85em;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.clock-display {
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 1px;
  color: #ffeb3b;
  margin-bottom: 2px;
}

.date-row {
  font-size: 0.8em;
  opacity: 0.9;
}

.logo {
  font-size: 1.3em;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-bar button {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95em;
  transition: background 0.2s;
}

.nav-bar button:hover, .nav-bar button.active-nav {
  background: rgba(255, 255, 255, 0.3);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-controls select, .header-controls button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.header-controls select option {
  background: #333;
  color: #fff;
}


/* مساحة الإعلانات فوق العرض الخاص وموازية له تماماً بالطول ومطابقة لعرضه */
.top-ads-space {
  width: calc(100% - 40px);
  max-width: 1200px;
  margin: 10px auto;
  height: 120px; /* متوافقة تماماً مع ارتفاع صور المنتجات */
  background: rgba(255, 255, 255, 0.15);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-ad-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.top-ads-space .ad-link-wrapper { position: relative; display: block; width: 100%; height: 100%; }
.top-ad-video { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.ad-fallback-image { position: absolute; inset: 0; }
.top-ad-mute {
  position: absolute;
  right: 12px;
  bottom: 10px;
  border: 0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,.7);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

/* 📢 شريط الإعلانات المتحرك */
.marquee-container {
  background: #111;
  color: #ffeb3b;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 0.95em;
  font-weight: bold;
  border-bottom: 1px solid rgba(0,0,0,0.2);
}

.dark-mode .marquee-container {
  background: #fff;
  border: 0;
  color: #0b2f6b;
}

.cart-dimensions {
  display: block;
  direction: ltr;
  text-align: center;
  margin-top: 4px;
  font-weight: 700;
}

.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 25s linear infinite;
}

@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

[dir="rtl"] .marquee-content {
  animation: marquee-rtl 25s linear infinite;
  padding-left: 0;
  padding-right: 100%;
}

@keyframes marquee-rtl {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100%, 0); }
}

/* تنسيقات نافذة مواقيت الصلاة المنبثقة */
.modal-overlay {
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

#prayer-times-list p {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 6px 0;
  display: flex;
  justify-content: space-between;
}

/* تنسيقات نافذة مواقيت الصلاة المنبثقة */
.modal-overlay {
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

#prayer-times-list p {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 6px 0;
  display: flex;
  justify-content: space-between;
}


/* تغليف الرابط حول صورة الإعلان للحفاظ على مظهرها الأصلي تماماً */
.ad-link-wrapper {
  display: block;
  width: 100%;
  text-decoration: none;
  outline: none;
  border: none;
}

.ad-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  transition: transform 0.3s ease;
}

/* إلغاء أي تأثير مزعج عند النقر أو التحديد بالمتصفح */
.ad-link-wrapper:focus,
.ad-link-wrapper:active {
  outline: none;
  border: none;
}

/* جعل الرابط يحتضن الصورة كلياً بنفس عرضها وتنسيقها السابق */
.top-ads-space .ad-link-wrapper {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.top-ads-space .top-ad-img {
  display: block;
  width: 100%;
}

/* فرض تمدد الرابط والصورة ليملآ الحيز بالكامل دون أي تقلص */
.top-ads-space {
  width: 100%;
}

.top-ads-space .card.ad-section {
  width: 100%;
  padding: 0;
}

.top-ads-space .ad-link-wrapper {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.top-ads-space .top-ad-img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
}

/* 🔼 تعديل تصميم زر الصعود ليصبح مستطيلاً رفيعاً وشفافاً على لون الفوتر */
#main-footer {
  position: relative; /* لضبط التموضع بداخله */
  padding-top: 30px;  /* مسافة علوية بسيطة لاستيعاب الزر */
}

.scroll-to-top-footer {
  position: absolute;
  top: 0;             /* يلتصق بأعلى الفوتر تماماً */
  left: 0;
  width: 100%;        /* يأخذ عرض الفوتر بالكامل تقريباً */
  height: 24px;       /* مستطيل صغير ورفيع */
  background-color: rgba(0, 0, 0, 0.15); /* لون خلفية شفاف متناسق مع الفوتر */
  color: inherit;     /* يرث لون النص الخاص بالفوتر */
  border: none;
  border-radius: 0;   /* مستطيل حاد بدون حواف دائرية */
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease;
}

.scroll-to-top-footer:hover {
  background-color: rgba(0, 0, 0, 0.25); /* زيادة الشفافية قليلاً عند المرور بالمأشر */
}

/* 🖼️ تحسينات عرض الصور في المنتجات */
.product-img {
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  width: 100%;
  height: 180px;
}

.product-img:hover {
  transform: scale(1.05);
}

.product-card:has(.product-img:hover) .product-img {
  filter: brightness(1.1);
}

/* تحسين lightbox للصور */
.lightbox {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ضمان أن زر الإغلاق يقبل النقر فوق أي طبقات شفافة وطبقات خلفية */
#colorCustomizationModal .close, 
#colorCustomizationModal .close-btn,
.color-modal-close {
  position: relative !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* إذا كان الزر يحتوي على أيقونة أو نص داخلي، امنع تفاعل العناصر الداخلية لكي تصل النقرة للزر مباشرة */
#colorCustomizationModal .close *, 
#colorCustomizationModal .close-btn * {
  pointer-events: none !important;
}

/* ===== تنسيقات جديدة مطلوبة ===== */

/* شريط العروض الخاصة المتحرك */
.special-offers-banner {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  overflow: hidden;
  white-space: nowrap;
  padding: 10px 0;
  font-size: 0.9em;
  font-weight: bold;
  margin: 0 20px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.special-offers-track {
  display: inline-block;
  padding-right: 100%;
  animation: special-marquee 20s linear infinite;
}

@keyframes special-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

[dir="rtl"] .special-offers-track {
  padding-right: 0;
  padding-left: 100%;
  animation: special-marquee-rtl 20s linear infinite;
}

@keyframes special-marquee-rtl {
  0% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* تنسيق عرض خاص على المنتج */
.deal-text {
  background: #ff4757;
  color: white;
  font-size: 0.8em;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  font-weight: bold;
  border: 2px solid #ff2e43;
  box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
}

/* تواريخ المنتج */
.product-dates {
  font-size: 0.7em;
  color: #888;
  text-align: center;
  margin-top: 6px;
  padding: 4px 6px;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  line-height: 1.4;
}

.dark-mode .product-dates {
  color: #aaa;
  background: rgba(255,255,255,0.05);
}

/* كمية المنتج بجوار متوفر */
.qty-display {
  font-size: 0.85em;
  color: #27ae60;
  font-weight: bold;
  margin-left: 4px;
}

/* تنسيق نافذة بيانات الطلب والتوصيل */
.client-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.client-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-form-label {
  font-weight: 700;
  color: #333;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-form input,
.client-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1em;
  font-family: 'Cairo', sans-serif;
  box-sizing: border-box;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.client-form input:focus,
.client-form textarea:focus {
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
  outline: none;
}

.client-form textarea {
  resize: vertical;
  min-height: 80px;
}

.dark-mode .client-form-label {
  color: #f5f5f5;
}

.dark-mode .client-form input,
.dark-mode .client-form textarea {
  background: #2b2b2b;
  border-color: #5a5a5a;
  color: #fff;
}

.dark-mode .client-form input:focus,
.dark-mode .client-form textarea:focus {
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.25);
}

/* تنسيق رأس السلة */
.cart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.clear-all-btn {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: bold;
  transition: background 0.2s;
  margin-top: 40px;
}

.clear-all-btn:hover {
  background: #c0392b;
}

/* تنسيقات إضافية للوحدة الإلزامية */
.size-unit-select:required:invalid {
  border-color: #e74c3c;
  background-color: #fff5f5;
}

.size-unit-select option:first-child {
  color: #999;
}

/* ===== تنسيقات أسهم الوصول للأعلى داخل البطاقات ===== */
.panel-scroll-top {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  right: auto !important;
  bottom: auto !important;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.panel-scroll-top:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

[dir="ltr"] .panel-scroll-top {
  left: auto !important;
  right: 12px !important;
}

/* ===== تنسيقات إطار العرض الخاص الثابت ===== */
.deal-banner-static {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  text-align: center;
  padding: 8px 12px;
  font-weight: bold;
  font-size: 0.9em;
  margin: 8px 0 0 0;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(255, 71, 87, 0.3);
  display: block;
}

.deal-banner-static::before {
  content: "🔥 ";
}

/* The announcement ticker sits directly below the header. */
.marquee-container {
  display: block !important;
  position: relative;
  z-index: 2;
}

/* ===== تنسيقات الحساب السوبر ===== */
.super-admin-badge {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #333;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  margin-right: 8px;
  display: inline-block;
}

[dir="ltr"] .super-admin-badge {
  margin-right: 0;
  margin-left: 8px;
}

/* العروض الخاصة ثابتة أسفل المنتج وليست شريطاً متحركاً */
.special-offers-banner { display: none !important; }
.product-card .deal-text {
  margin-top: 8px;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #fff;
  border: 2px solid #ff2e43;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 3px 8px rgba(255,71,87,.28);
}
[dir="ltr"] .product-card .deal-text { text-align: left; }
/* قائمة العروض الخاصة الثابتة تحت البحث */
.special-offers-list { width:min(92%, 900px); margin:0 auto 16px; display:flex; flex-direction:column; gap:8px; }
.special-offer-item { width:100%; border:0; cursor:pointer; background:#ff4757; color:#fff; padding:11px 14px; border-radius:8px; text-align:center; font-weight:700; box-shadow:0 2px 5px rgba(0,0,0,.14); animation:none !important; position:static !important; }
.special-offer-item { font-size: 1.05rem; transition: transform .2s ease, box-shadow .2s ease; }
.special-offer-item:hover,
.special-offer-item:focus-visible { transform: scale(1.04); box-shadow: 0 4px 10px rgba(0,0,0,.2); }

.section-scroll-arrow {
  align-self: stretch;
  width: 100%;
  height: 42px;
  margin: 0 0 8px;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, .15);
  color: inherit;
  cursor: pointer;
  font-size: 2.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .3s ease;
}

.section-scroll-arrow:hover,
.section-scroll-arrow:focus-visible { background: rgba(0, 0, 0, .25); }

.offer-scroll-arrow { order: -1; }

.library-actions-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.library-actions-row { justify-content: space-between; }
.library-actions-row .clear-all-library-btn { margin: 0; }
.library-actions-row .secondary-btn { margin: 0; }

.seller-settings-btn { margin-inline-start: auto; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: inherit; cursor: pointer; font-size: 1.2rem; }
.seller-settings-btn:hover, .seller-settings-btn:focus-visible { background: rgba(0,0,0,.12); }
.seller-settings-modal { position: fixed; inset: 0; z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.55); }
.seller-settings-card { width: min(100%, 480px); max-height: 90vh; overflow: auto; padding: 18px; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.seller-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.seller-settings-heading h4 { margin: 0; }
.seller-settings-card .profile-form { display: grid; gap: 8px; }
.seller-settings-card .secondary-btn { width: 100%; }
.dark-mode .seller-settings-card,
.dark-mode .seller-accounts-panel { background: #1e293b; color: #f8fafc; border-color: #475569; }
.dark-mode .seller-settings-card input,
.dark-mode .seller-accounts-panel .seller-account-item { background: #0f172a; color: #f8fafc; border-color: #475569; }
.dark-mode .seller-accounts-panel .seller-account-item { color: #f8fafc; }

.seller-accounts-panel {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #c9a227;
  border-radius: 8px;
  background: rgba(255, 248, 220, .75);
}

.seller-accounts-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seller-accounts-list { display: grid; gap: 8px; margin-top: 10px; }
.seller-account-item { padding: 9px; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.seller-account-item strong { display: block; }
.seller-account-item small { display: block; margin-top: 3px; }
.seller-owner-label { display: block; margin-bottom: 5px; color: #7a1710; font-size: .78rem; font-weight: 700; }
.seller-product-item { position: relative; }
.seller-product-main { padding-top: 24px; }
.seller-owner-label { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; margin: 0; }
.seller-product-offer {
  color: #b42318;
  font-weight: 700;
  background: #fff1f2;
  border-radius: 6px;
  padding: 3px 7px;
  width: fit-content;
}

[dir="ltr"] .nav-bar {
  gap: 3px;
}

[dir="ltr"] .nav-bar button {
  margin: 3px 1px;
  padding-inline: 7px;
}

[dir="ltr"] .weather-status {
  max-width: 190px;
  font-size: .78em;
}

[dir="ltr"] .header-datetime-box {
  flex-shrink: 0;
  order: -1;
}

@media (min-width: 641px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo datetime"
      "nav settings";
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
  }

  .logo { grid-area: logo; }
  .nav-bar {
    grid-area: nav;
    min-width: 0;
    gap: 6px;
    justify-content: flex-start;
  }
  .nav-bar button {
    margin: 2px;
    padding: 5px 7px;
  }
  .settings {
    grid-area: settings;
    gap: 4px;
    justify-content: flex-end;
  }
  .settings button {
    margin: 2px;
    padding: 3px;
  }
  .header-datetime-box {
    grid-area: datetime;
    order: initial;
    justify-self: end;
    min-width: max-content;
  }
}
.deal-text { background:#ff4757; color:#fff; font-size:.84em; margin-top:8px; padding:7px 9px; border-radius:7px; text-align:center; }

/* إصلاح العرض الديناميكي وتقليل المسافات */
.dynamic-product-wrapper{display:none!important;}
.dynamic-product-wrapper.active{display:block!important;}
.section-title{margin-top:8px!important;margin-bottom:8px!important;}
.special-offers-list{margin-bottom:6px!important;}
#dynamic-sections-root{margin-top:0!important;}

/* Keep sound panel centered in both languages */
.sound-panel{left:50%!important;right:auto!important;transform:translateX(-50%)!important;text-align:center;}

.sound-panel{top:50%!important;left:50%!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important;}
[dir="ltr"] .sound-panel{left:50%!important;right:auto!important;}

/* 📢 شريط الإعلانات المتحرك */
.marquee-container {
  background: #111;
  color: #ffeb3b;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 0.95em;
  font-weight: bold;
  border-bottom: 1px solid rgba(0,0,0,0.2);
}

.cart-float {
  position: fixed;
  bottom: 25px;
  left: 25px;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  cursor: pointer;
  z-index: 1000;
  transition: transform .2s, background .2s;
}

.dark-mode .marquee-container {
  background: #fff;
  border: 0;
  color: #0b2f6b;
}

@media (max-width: 640px) {
  .global-search-section { padding: 6px 8px; }
  .global-search-section input { width: min(82vw, 360px); padding: 8px 12px; font-size: .9rem; }
  .customer-ai-panel { right: 50%; transform: translateX(50%); padding: 8px; }
  .prayer-library-tab { height: 32px; font-size: .7rem; }
  .prayer-library-tab span { font-size: .62rem; }
}

[dir="ltr"] .cart-float { left: auto; right: 25px; }
.cart-float:hover { transform: scale(1.1); background: #256b29; }
.cart-float.is-dragging,
.cart-summary.cart-modal.is-dragging { cursor: grabbing; user-select: none; }
.cart-float #cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  padding: 3px 6px;
  border-radius: 50%;
  background: #d32f2f;
  color: #fff;
  font-size: .65em;
  font-weight: bold;
  text-align: center;
}

.cart-summary.cart-modal {
  position: fixed !important;
  bottom: 95px;
  left: 25px;
  width: min(340px, calc(100vw - 32px));
  max-height: min(450px, calc(100vh - 120px));
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

[dir="ltr"] .cart-summary.cart-modal { left: auto; right: 25px; }
.cart-summary.cart-modal #cart-items-list { padding: 15px; overflow-y: auto; flex: 1; }
.cart-summary.cart-modal #confirm-order-btn { margin: 0 15px 15px; width: calc(100% - 30px); }
.cart-header-row {
  background: #333;
  color: #fff;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
}
.cart-header-row:active { cursor: grabbing; }
.cart-header-actions { display: flex; align-items: center; gap: 8px; }
.cart-header-row .clear-all-btn,
.close-cart-btn {
  border: 0;
  cursor: pointer;
}
.cart-header-row .clear-all-btn { background: #d32f2f; color: #fff; padding: 6px 9px; border-radius: 6px; }
.close-cart-btn { background: transparent; color: #fff; font-size: 1.5rem; line-height: 1; }
.remove-item-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.cart-item-row > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cart-item-details {
  color: #4b5563;
  font-size: 0.86em;
}

[dir="ltr"] .cart-item-row {
  text-align: left;
}