/* =====================================================================
   NOUDRAH • Raed Twig • Mobile-safe v5 • 2026-11-15
   Full replacement for earlier custom CSS, not an append-only patch.
   Keep native Salla navigation, cart, quick buy, logos and brand data.
   Scope is limited to body.theme-raed and opt-in nd-* helpers.
   IMPORTANT: Test in unpublished theme, including product/cart/mobile.
   ===================================================================== */

/* 1. Brand identity: native logo source, no forced CSS image replacement. */
body.theme-raed {
  --nd-burgundy: #542633;
  --nd-burgundy-dark: #371923;
  --nd-ivory: #FAF7F3;
  --nd-cream: #F4EEE8;
  --nd-gold: #D9B77E;
  --nd-taupe: #71554C;
  --nd-ink: #362B2E;
  --nd-muted: #6F5D62;
  --nd-line: #EADFD8;
  --nd-focus: #A86A7C;
  --color-primary: #542633;
  --color-primary-dark: #371923;
  --color-primary-light: #F2E5E8;
  --color-primary-reverse: #FFFFFF;
  color: var(--nd-ink);
  background-color: var(--nd-ivory);
}

/* 2. Header: preserve the theme's mobile menu, stacking and search. */
body.theme-raed .top-navbar {
  background: var(--nd-ivory);
  border-bottom: 1px solid var(--nd-line);
}
body.theme-raed #mainnav,
body.theme-raed .main-nav-container {
  background-color: var(--nd-ivory);
}
body.theme-raed #mainnav a,
body.theme-raed .top-navbar a {
  color: var(--nd-ink);
}
body.theme-raed #mainnav a:hover,
body.theme-raed .top-navbar a:hover { color: var(--nd-burgundy); }
body.theme-raed .navbar-brand img {
  display: block;
  width: auto;
  height: auto;
  max-height: 58px;
  max-width: 94px;
  object-fit: contain;
}
body.theme-raed .header-search input,
body.theme-raed salla-search input,
body.theme-raed .s-search-modal .s-search-input {
  background-color: #fff;
  color: var(--nd-ink);
  border: 1px solid var(--nd-line);
  border-radius: 14px;
}
body.theme-raed .s-search-modal .s-search-input::placeholder { color: #74636A; opacity: 1; }

/* 3. Section titles: native grid layout and positioning remain untouched. */
body.theme-raed .s-block-title h2,
body.theme-raed .s-block__title h2 {
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 1.5;
  font-weight: 700;
  color: var(--nd-ink);
}
body.theme-raed .s-block-title p,
body.theme-raed .s-block__title p { color: var(--nd-muted); }

/* 4. Product cards: do not crop images, hide prices, discount tags or stock. */
body.theme-raed .s-product-card-entry {
  min-width: 0;
  border: 1px solid var(--nd-line);
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(55,25,35,.045);
  transition: box-shadow .2s ease, transform .2s ease;
}
body.theme-raed .s-product-card-content-title,
body.theme-raed .s-product-card-content-title a {
  color: var(--nd-ink);
  line-height: 1.55;
  font-weight: 600;
  overflow-wrap: break-word;
}
body.theme-raed .s-product-card-price,
body.theme-raed .s-product-card-sale-price h4 {
  color: var(--nd-burgundy);
  font-weight: 700;
}
body.theme-raed .s-product-card-wishlist-btn {
  background: #fff;
  border-radius: 50%;
}
@media (hover: hover) and (pointer: fine) {
  body.theme-raed .s-product-card-entry:hover {
    box-shadow: 0 10px 24px rgba(55,25,35,.1);
    transform: translateY(-2px);
  }
}
/* Important: native Salla product image sizing/object-fit is NOT overridden. */

/* 5. Interactive contrast without overriding cart/express-checkout layout. */
body.theme-raed .s-button-primary:not(:disabled):not([aria-disabled="true"]) {
  background-color: var(--nd-burgundy);
  border-color: var(--nd-burgundy);
  color: #fff;
}
body.theme-raed .s-button-primary-outline:not(:disabled) {
  border-color: var(--nd-burgundy);
  color: var(--nd-burgundy);
}
body.theme-raed a:focus-visible,
body.theme-raed button:focus-visible,
body.theme-raed input:focus-visible,
body.theme-raed select:focus-visible,
body.theme-raed textarea:focus-visible {
  outline: 2px solid var(--nd-focus);
  outline-offset: 3px;
}

/* 6. Existing theme banners/categories: cosmetic polish only. */
body.theme-raed .s-block--categories .slide--cat-entry,
body.theme-raed .s-block--banners .banner-entry,
body.theme-raed .s-block--fixed-banner img {
  border-radius: 15px;
}
body.theme-raed .s-block--categories .slide--cat-entry { overflow: hidden; }
body.theme-raed .s-block--categories .slide--cat-entry h2 { line-height: 1.45; }
body.theme-raed .s-block--features .feature { border-radius: 15px; }

/* 7. Native brands section. Use Salla's built-in brand element and true logos.
   JavaScript v5 adds nd-brand-section / nd-brand-link only if found.
   Nothing is created if that section is absent. */
body.theme-raed .nd-brand-section .nd-brand-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--nd-line);
  border-radius: 15px;
  background-color: #fff;
  color: var(--nd-ink);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(55,25,35,.035);
  transition: box-shadow .2s ease, border-color .2s ease;
}
body.theme-raed .nd-brand-section .nd-brand-link img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 62px;
  object-fit: contain;
}
body.theme-raed .nd-brand-section .nd-brand-link:hover {
  border-color: #C8A6AF;
  box-shadow: 0 8px 18px rgba(55,25,35,.08);
}

/* 8. Footer: styling only. No forced columns and no hidden Salla widgets. */
body.theme-raed .store-footer {
  background: var(--nd-burgundy-dark);
  color: #F6EDE8;
}
body.theme-raed .store-footer__inner {
  background: transparent;
  color: #F6EDE8;
}
body.theme-raed .store-footer h3,
body.theme-raed .store-footer .s-contacts-title { color: #fff; }
body.theme-raed .store-footer p,
body.theme-raed .store-footer .max-w-sm { color: #E7D8D2; }
body.theme-raed .store-footer a,
body.theme-raed .store-footer .s-menu-footer-item { color: #F3E7E2; }
body.theme-raed .store-footer a:hover { color: var(--nd-gold); }
body.theme-raed .store-footer salla-payments img,
body.theme-raed .store-footer .s-payments-list-item {
  background: #fff;
  border-radius: 7px;
}
body.theme-raed .store-footer salla-trust-badges {
  background: #fff;
  border-radius: 10px;
}
body.theme-raed .store-footer .copyright-text,
body.theme-raed .store-footer .copyright-text a { color: #E1D0C9; }

/* 9. Existing legacy custom fragments: style only if the HTML exists. */
body.theme-raed .nd3-ft-trust {
  background: var(--nd-cream);
  color: var(--nd-ink);
  border-bottom: 1px solid var(--nd-line);
}
body.theme-raed .nd3-ft-trust .container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
body.theme-raed .nd3-ft-trust .container > div { min-width: 0; }
body.theme-raed .nd3-ft-trust b { color: var(--nd-ink); }
body.theme-raed .nd3-ft-trust span { color: var(--nd-muted); }
body.theme-raed .nd3-ft-wa { background: var(--nd-gold); color: var(--nd-burgundy-dark); border-radius: 999px; }
body.theme-raed .nd3-cat-in {
  background: linear-gradient(115deg, #371923, #653243);
  border-radius: 16px;
  color: #fff;
}
body.theme-raed .nd3-cat-txt h2 { color: #fff; }
body.theme-raed .nd3-cat-txt p { color: #F4E8E4; }
body.theme-raed .nd3-cart {
  background: #FBF7F4;
  border: 1px solid var(--nd-line);
  border-radius: 14px;
}

/* 10. Optional lightweight JS-added 'Back to top' button.
   Hidden by default so no JS = no blank control. */
body.theme-raed .nd-backtop {
  position: fixed;
  inset-inline-end: 16px;
  bottom: 24px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: var(--nd-burgundy);
  color: #fff;
  font-size: 23px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(55,25,35,.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
body.theme-raed .nd-backtop.nd-is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
body.theme-raed .nd-skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--nd-burgundy-dark);
  color: #fff;
  transform: translateY(-180%);
}
body.theme-raed .nd-skip-link:focus { transform: translateY(0); }

/* 11. Responsive refinement. No position/flex overrides to Salla's cart bar. */
@media (max-width: 991px) {
  body.theme-raed .navbar-brand img { max-width: 78px; max-height: 49px; }
  body.theme-raed .nd3-ft-trust .container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  body.theme-raed .navbar-brand img { max-width: 69px; max-height: 44px; }
  body.theme-raed .s-block-title h2,
  body.theme-raed .s-block__title h2 { font-size: 19px; }
  body.theme-raed .s-product-card-content-title,
  body.theme-raed .s-product-card-content-title a { font-size: 14px; }
  body.theme-raed .s-product-card-price,
  body.theme-raed .s-product-card-sale-price h4 { font-size: 15px; }
  body.theme-raed .nd-brand-section .nd-brand-link { min-height: 86px; padding: 10px; }
  body.theme-raed .nd-brand-section .nd-brand-link img { max-height: 48px; }
  body.theme-raed .nd-backtop { width: 40px; height: 40px; bottom: 88px; inset-inline-end: 12px; }
}
@media (max-width: 400px) {
  body.theme-raed .navbar-brand img { max-width: 62px; max-height: 40px; }
  body.theme-raed .nd-backtop { bottom: 92px; }
}
@media (hover: none) {
  body.theme-raed .s-product-card-entry { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body.theme-raed .s-product-card-entry,
  body.theme-raed .nd-brand-section .nd-brand-link,
  body.theme-raed .nd-backtop { transition: none; }
}
/* نُدرة — الماركات في دوائر بصف أفقي واحد */
.s-block--logos-slider > .container > .grid {
  --nd-brand-size: 112px;
  --nd-brand-padding: 18px;

  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: center;
  justify-content: flex-start !important;
  gap: 16px !important;
  overflow-x: auto;
  padding: 6px 6px 12px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 6px;
}

.s-block--logos-slider > .container > .grid > a.brand-item {
  display: grid !important;
  place-items: center;
  flex: 0 0 var(--nd-brand-size) !important;
  box-sizing: border-box;
  width: var(--nd-brand-size) !important;
  height: var(--nd-brand-size) !important;
  min-height: 0 !important;
  padding: var(--nd-brand-padding) !important;
  border: 1px solid #e8d8ce;
  border-radius: 50% !important;
  background: #fff !important;
  scroll-snap-align: start;
}

.s-block--logos-slider > .container > .grid > a.brand-item > img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  object-fit: contain !important;
}

@media (max-width: 767px) {
  .s-block--logos-slider > .container > .grid {
    --nd-brand-size: 84px;
    --nd-brand-padding: 13px;
    gap: 12px !important;
  }
}
/* نُدرة — إصلاح تباين الفوتر فقط */
body.theme-raed .store-footer .store-footer__inner {
  background-color: #3D1A23 !important;
  color: #FFF3E6;
}

/* نص وثيقة العمل الحر يفضل غامقًا فوق البطاقة البيضاء */
body.theme-raed .store-footer .store-footer__inner salla-trust-badges,
body.theme-raed .store-footer .store-footer__inner salla-trust-badges a,
body.theme-raed .store-footer .store-footer__inner salla-trust-badges p,
body.theme-raed .store-footer .store-footer__inner salla-trust-badges span {
  color: #3D1A23 !important;
}