/* Raymand shop assistant — floating launcher + footer cleanup
   Root-cause notes:
   - widget.css used to load in <head> before Woodmart/Elementor, so later
     theme rules could undo position:fixed. Critical placement is !important
     and also injected last by widget.js.
   - #raymand-clean-footer was a <footer> nested inside footer.wd-footer,
     which makes the HTML parser close the theme footer early and leaves
     the logo strip, empty sections, and leftover copyright in the page flow.
*/

/* ---- Hide leftover demo/partner strip and duplicate Woodmart copyright
   (sources remain in Elementor cms_block 2145 / theme option; not deleted) */
body .elementor-2145 .elementor-element-0731341,
body .elementor-2145 .elementor-element-a62e955,
body .elementor-2145 .elementor-element-912ab9d,
body .elementor-2145 .elementor-element-efd8f77,
body .elementor-2145 .elementor-element-c3915b6,
body .elementor-2145 .elementor-element-d660445,
body .wd-footer .wd-copyrights,
body .copyrights-wrapper {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}
footer.wd-footer.footer-container { flex-direction: revert !important; }
@media screen and (max-width: 768px) {
  #raymand-clean-footer .footer-container { flex-direction: column; text-align: center; }
}

/* Closed sized mega-menu (menu-item-2664 / Elementor 368) is visibility:hidden
   but still an absolutely positioned 4000px+ box, so it extends document
   scroll past the footer on desktop (>=1025px). Collapse it until open. */
.wd-dropdown-menu.wd-design-sized {
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
}
.wd-event-hover:hover > .wd-dropdown-menu.wd-design-sized,
.wd-event-click.wd-opened > .wd-dropdown-menu.wd-design-sized,
.wd-dropdown-menu.wd-design-sized.wd-opened {
  height: auto !important;
  min-height: 0 !important;
  max-height: min(80vh, 720px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Leftover light-grey band under the green border is .footer-sidebar
   padding-block:40px plus 10px padding-bottom on the Elementor widget wrap. */
footer.wd-footer .footer-sidebar { padding-bottom: 0 !important; }
footer.wd-footer .elementor-2145 .elementor-widget-wrap { padding-bottom: 0 !important; }

/* Tighten the ~60px white gap inside the boxed footer (desktop only so
   stacked mobile columns keep their 40px spacing). */
@media (min-width: 769px) {
  #raymand-clean-footer .footer-col { margin-bottom: 0 !important; }
}
#raymand-clean-footer .copyright-bar { margin-top: 12px !important; }

/* ---- Launcher: viewport-fixed, no document-flow space, above scroll-top ---- */
.rs-ai-root {
  font-family: Vazirmatn, IRANSans, "IRANSansX", Tahoma, sans-serif;
  box-sizing: border-box;
  direction: rtl;
  text-align: right;
  color: #1b1f24;
  position: fixed !important;
  left: 20px !important;
  right: auto !important;
  inset-inline-start: 20px !important;
  inset-inline-end: auto !important;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 100050 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
  perspective: none !important;
  will-change: auto !important;
  pointer-events: none;
}

.rs-ai-root *,
.rs-ai-root *::before,
.rs-ai-root *::after { box-sizing: border-box; }

.rs-ai-fab {
  pointer-events: auto;
  position: relative !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #10233f;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px 11px 14px;
  box-shadow: 0 8px 28px rgba(16, 35, 63, 0.38);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1;
  letter-spacing: 0;
  z-index: 100051;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.rs-ai-fab:hover { background: #163056; box-shadow: 0 10px 32px rgba(16, 35, 63, 0.46); }
.rs-ai-fab:focus-visible { outline: 3px solid #0d6efd; outline-offset: 3px; }
.rs-ai-fab svg { width: 20px; height: 20px; flex: 0 0 auto; }
.rs-ai-fab-label { white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }

.rs-ai-fab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
  flex: 0 0 auto;
}

.rs-ai-panel {
  pointer-events: auto;
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  bottom: calc(100% + 12px) !important;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 160px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100052;
  border: 1px solid #e7eaf0;
  transform: none !important;
}
.rs-ai-panel[hidden] { display: none !important; }

.rs-ai-head {
  background: #10233f;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.rs-ai-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}
.rs-ai-head p {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.9;
  font-weight: 400;
  line-height: 1.4;
}
.rs-ai-head-text { flex: 1; min-width: 0; }
.rs-ai-close {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.rs-ai-close:hover { background: rgba(255,255,255,0.15); }

.rs-ai-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  background: #f6f8fb;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rs-ai-msg {
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.rs-ai-msg.bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e7eaf0;
  border-bottom-right-radius: 4px;
}
.rs-ai-msg.user {
  align-self: flex-end;
  background: #0d6efd;
  color: #fff;
  border-bottom-left-radius: 4px;
}
.rs-ai-msg.err { background: #fff4f4; border-color: #f1c5c5; color: #8a1c1c; }

.rs-ai-cards { display: flex; flex-direction: column; gap: 8px; }
.rs-ai-card {
  background: #fff;
  border: 1px solid #e7eaf0;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: start;
}
.rs-ai-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #f3f5f8;
  border-radius: 8px;
}
.rs-ai-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.rs-ai-card h3 a { color: inherit; text-decoration: none; }
.rs-ai-card h3 a:hover { color: #0d6efd; }
.rs-ai-price { font-size: 13px; font-weight: 800; color: #0b5ed7; margin: 0 0 6px; }
.rs-ai-order { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-ai-order a, .rs-ai-order button {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  color: #fff;
}
.rs-ai-wa { background: #25d366; }
.rs-ai-eitaa { background: #e65100; }
.rs-ai-bale { background: #55a51c; }
.rs-ai-cart { background: #0d6efd; }
.rs-ai-product { background: #3d4a5c; }
.rs-ai-copy { background: #5c6673; }

.rs-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
  background: #f6f8fb;
  flex: 0 0 auto;
}
.rs-ai-chip {
  font: inherit;
  font-size: 12px;
  background: #fff;
  border: 1px solid #d5dce6;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  color: #1b1f24;
}
.rs-ai-chip:hover { border-color: #0d6efd; color: #0d6efd; }

.rs-ai-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e7eaf0;
  background: #fff;
  flex: 0 0 auto;
}
.rs-ai-form input[type="text"] {
  flex: 1;
  font: inherit;
  font-size: 13px;
  border: 1px solid #d5dce6;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
.rs-ai-form input[type="text"]:focus { outline: 2px solid #9ec5fe; border-color: #0d6efd; }
.rs-ai-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.rs-ai-send {
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  background: #0d6efd;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.rs-ai-send:disabled { opacity: 0.6; cursor: default; }

.rs-ai-foot {
  font-size: 11px;
  color: #5c6673;
  text-align: center;
  padding: 0 12px 10px;
  background: #fff;
  line-height: 1.6;
}
.rs-ai-foot a { color: #0d6efd; text-decoration: none; font-weight: 700; }

.rs-ai-typing { font-size: 12px; color: #5c6673; padding: 0 4px; }

/* Mobile: sit above Woodmart toolbar (55px) and scroll-to-top (40px at bottom:67px) */
@media (max-width: 1024px) {
  body.sticky-toolbar-on .rs-ai-root {
    left: 12px !important;
    inset-inline-start: 12px !important;
    bottom: calc(117px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body:not(.sticky-toolbar-on) .rs-ai-root {
    left: 12px !important;
    inset-inline-start: 12px !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 480px) {
  .rs-ai-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw;
    height: min(85vh, 100dvh);
    border-radius: 16px 16px 0 0;
  }
  body.sticky-toolbar-on .rs-ai-panel {
    bottom: calc(55px + env(safe-area-inset-bottom, 0px)) !important;
    height: min(85vh, calc(100dvh - 55px - env(safe-area-inset-bottom, 0px)));
  }
  .rs-ai-fab-label { display: none; }
  .rs-ai-fab { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .rs-ai-fab, .rs-ai-panel { transition: none; }
}


/* ---- Header category browser («مرور دسته‌ها») ---- */
.wd-header-cats {
  overflow: visible !important;
  z-index: 420;
}
.wd-header-cats .menu-opener:focus-visible {
  outline: 2px solid #10233f;
  outline-offset: 3px;
  border-radius: 6px;
}
.wd-header-cats .wd-dropdown-cats {
  min-width: 300px;
  padding: 8px 0 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 18px 44px rgba(16, 35, 63, 0.18) !important;
  border: 1px solid rgba(16, 35, 63, 0.08) !important;
  overflow: visible !important;
  z-index: 421;
}
.wd-header-cats:hover .wd-dropdown-cats,
.wd-header-cats:focus-within .wd-dropdown-cats,
.wd-header-cats.rs-cats-open .wd-dropdown-cats {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  pointer-events: auto !important;
}
.wd-header-cats .wd-nav-vertical > li > a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 14px !important;
  font-size: 13.5px !important;
  font-weight: 600;
  color: #1b1f24 !important;
  line-height: 1.35;
  text-decoration: none;
  background: transparent !important;
}
.wd-header-cats .wd-nav-vertical > li > a .nav-link-text {
  flex: 1 1 auto;
  text-align: start;
}
.wd-header-cats .rs-cat-count {
  flex: 0 0 auto;
  min-width: 1.6em;
  margin-inline-start: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f4f8;
  color: #5b6573;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.wd-header-cats .wd-nav-vertical > li:hover > a,
.wd-header-cats .wd-nav-vertical > li:focus-within > a {
  background: #f4f7fb !important;
  color: #10233f !important;
}
.wd-header-cats .wd-nav-vertical > li.menu-item-has-children > a::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: 4px;
  border-inline-end: 2px solid #8a93a0;
  border-bottom: 2px solid #8a93a0;
  transform: rotate(-45deg);
  /* RTL: chevron should point toward the flyout; adjusted with from-* classes */
}
.wd-header-cats.rs-cats-from-end .wd-nav-vertical > li.menu-item-has-children > a::after {
  transform: rotate(45deg);
}
.wd-header-cats.rs-cats-from-start .wd-nav-vertical > li.menu-item-has-children > a::after {
  transform: rotate(-135deg);
}
.wd-header-cats .wd-nav-vertical > li > a::before {
  content: "";
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: #eef2f7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.wd-header-cats .rs-cat-314 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='13' rx='1.6'/%3E%3Cpath d='M2 19h20'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-96 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Crect x='6' y='3' width='12' height='8' rx='1'/%3E%3Cpath d='M4 11h16v7H4zM8 15h8'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-316 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='7' y='7' width='10' height='10' rx='1'/%3E%3Cpath d='M12 3v4M12 17v4M3 12h4M17 12h4'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-315 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='13' rx='1.5'/%3E%3Cpath d='M8 21h8M12 17v4'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-85 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='M8 8v8M16 8v8M5 11v2M19 11v2M8 10h8M8 14h8'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-240 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='M3 7h12l6-3v16l-6-3H3z'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-317 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E"); }
.wd-header-cats .rs-cat-15 > a::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2310233f' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M6 19a6 6 0 0 1 12 0'/%3E%3Cpath d='M18 8a3 3 0 0 0-1.2-2.4'/%3E%3C/svg%3E"); }

@media (min-width: 1025px) {
  .wd-header-cats .wd-nav-vertical > li { position: relative; }
  .wd-header-cats .wd-nav-vertical > li > .wd-dropdown-menu,
  .wd-header-cats .wd-nav-vertical > li > .wd-dropdown {
    top: 0 !important;
    margin-top: 0 !important;
    min-width: 280px;
    max-width: 360px;
    max-height: min(70vh, 560px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 8px 0 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 18px 44px rgba(16, 35, 63, 0.18) !important;
    border: 1px solid rgba(16, 35, 63, 0.08) !important;
    z-index: 422;
  }
  /* from-end = menu on the inline-start / visual right in RTL: open toward the page (left). */
  .wd-header-cats.rs-cats-from-end .wd-nav-vertical > li > .wd-dropdown-menu,
  .wd-header-cats.rs-cats-from-end .wd-nav-vertical > li > .wd-dropdown {
    inset-inline-start: calc(100% + 6px) !important;
    inset-inline-end: auto !important;
    right: 100% !important;
    left: auto !important;
    margin-right: 6px !important;
    margin-left: 0 !important;
  }
  .wd-header-cats.rs-cats-from-start .wd-nav-vertical > li > .wd-dropdown-menu,
  .wd-header-cats.rs-cats-from-start .wd-nav-vertical > li > .wd-dropdown {
    inset-inline-end: calc(100% + 6px) !important;
    inset-inline-start: auto !important;
    left: 100% !important;
    right: auto !important;
    margin-left: 6px !important;
    margin-right: 0 !important;
  }
  .wd-header-cats .wd-nav-vertical > li:hover > .wd-dropdown,
  .wd-header-cats .wd-nav-vertical > li:focus-within > .wd-dropdown,
  .wd-header-cats .wd-nav-vertical > li.wd-opened > .wd-dropdown {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .wd-header-cats .wd-sub-menu a,
  .wd-header-cats .wd-dropdown-menu a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 18px !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #2a3140 !important;
    border-radius: 0;
  }
  .wd-header-cats .wd-sub-menu a:hover,
  .wd-header-cats .wd-sub-menu a:focus,
  .wd-header-cats .wd-dropdown-menu a:hover,
  .wd-header-cats .wd-dropdown-menu a:focus {
    background: #f4f7fb !important;
    color: #10233f !important;
  }
  .wd-header-cats .rs-cat-all > a,
  .wd-header-cats li.rs-cat-all a {
    margin-top: 4px;
    border-top: 1px solid #edf0f4;
    font-weight: 700 !important;
    color: #0b5ed7 !important;
  }
}

/* Mobile drawer: catalog tree sits under «مرور دسته‌ها» */
.mobile-nav .rs-cat-mobile-root > a {
  font-weight: 800 !important;
}
.mobile-nav .rs-cat-count {
  margin-inline-start: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #5b6573;
  font-size: 11px;
  font-weight: 700;
}
.mobile-nav .rs-cat-all > a {
  font-weight: 700 !important;
  color: #0b5ed7 !important;
}
