/* РИСМИКС sales-upgrade UI — mobile-first */
:root {
  --rm-ink: #1c1917;
  --rm-paper: #f7f3ee;
  --rm-salmon: #e85d04;
  --rm-salmon-hover: #c2410c;
  --rm-muted: #78716c;
  --rm-line: #e7e5e4;
  --rm-chip: #ffffff;
  --rm-chip-active: #1c1917;
  --rm-ok: #15803d;
}

html { scroll-behavior: smooth; }
body { background: var(--rm-paper) !important; }

.overflow-x-auto { scrollbar-width: none; -ms-overflow-style: none; }
.overflow-x-auto::-webkit-scrollbar { display: none; height: 0; }

.sticky.top-16 {
  top: 3.5rem !important;
  background: rgba(247, 243, 238, 0.94) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rm-line);
  box-shadow: none !important;
  z-index: 30 !important;
}

/* Contacts / sales header */
.rm-contacts {
  margin: 0.5rem 0 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--rm-ink);
  color: #fafaf9;
  border-radius: 1rem;
  display: grid;
  gap: 0.55rem;
}
.rm-contacts a { color: #fdba74; text-decoration: none; font-weight: 600; }
.rm-contacts a:hover { text-decoration: underline; }
.rm-contacts .rm-row { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; align-items: center; font-size: 0.875rem; line-height: 1.35; }
.rm-contacts .rm-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--rm-salmon);
  color: #fff !important;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.rm-contacts .rm-meta { opacity: 0.9; }
.rm-contacts .rm-map {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff !important;
}
.rm-contacts .rm-app {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: #fff;
  color: var(--rm-ink) !important;
  font-weight: 800;
}

/* Mobile: native header hides phone text — force visible */
header a[href^="tel:"] span.hidden {
  display: inline !important;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
header a[href^="tel:"] {
  max-width: none !important;
  gap: 0.35rem !important;
}

/* Native cart FAB: add visible "Корзина" label */
button.fixed.bottom-4.right-4,
button[aria-haspopup="dialog"].fixed {
  width: auto !important;
  min-width: 3.25rem;
  min-height: 3.25rem !important;
  padding: 0 0.85rem 0 0.65rem !important;
  border-radius: 999px !important;
  gap: 0.35rem;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16) !important;
  z-index: 60 !important;
}
button.fixed.bottom-4.right-4::after,
button[aria-haspopup="dialog"].fixed::after {
  content: "Корзина";
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--rm-ink);
  letter-spacing: 0.01em;
}

/* Product card images: stable height, no collapsed strip */
.grid img,
.grid [class*="aspect"] img,
.overflow-hidden img {
  min-height: 10rem;
  object-fit: cover;
  width: 100%;
}

.rm-search-wrap { padding: 0.5rem 0 0.25rem; }
.rm-search {
  width: 100%;
  height: 2.75rem;
  border: 1px solid var(--rm-line);
  border-radius: 999px;
  padding: 0 1rem 0 2.6rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M12 12l3 3'/%3E%3C/svg%3E") 0.9rem 50% no-repeat;
  font-size: 1rem;
  color: var(--rm-ink);
  outline: none;
}
.rm-search:focus { border-color: var(--rm-salmon); }

.rm-groups, .rm-filters, .rm-subcats {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.5rem;
  scrollbar-width: none;
}
.rm-groups::-webkit-scrollbar,
.rm-filters::-webkit-scrollbar,
.rm-subcats::-webkit-scrollbar { display: none; }

.rm-group, .rm-filter {
  flex: 0 0 auto;
  border: 1px solid var(--rm-line);
  background: var(--rm-chip);
  color: var(--rm-ink);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 2.5rem;
}
.rm-group.is-active, .rm-filter.is-active {
  background: var(--rm-chip-active);
  color: #fff;
  border-color: var(--rm-chip-active);
}
.rm-filter.is-active { background: var(--rm-salmon); border-color: var(--rm-salmon); }
.rm-subcats.is-hidden { display: none; }
.rm-subcats button {
  border-radius: 999px !important;
  min-height: 2.35rem;
  font-weight: 600 !important;
}
.rm-subcats button[data-rm-active="1"] {
  background: var(--rm-ink) !important;
  color: #fff !important;
}

.bg-orange-500 { background-color: var(--rm-salmon) !important; }
.hover\:bg-orange-600:hover { background-color: var(--rm-salmon-hover) !important; }

/* Bigger add-to-cart */
button.w-full.bg-orange-500 {
  min-height: 2.85rem !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  border-radius: 0.75rem !important;
}

.grid > .overflow-hidden.h-full,
.grid > div.overflow-hidden {
  background: #fff;
  border: 1px solid var(--rm-line);
  border-radius: 1rem;
  overflow: hidden;
}

img.rm-broken {
  object-fit: cover;
  background: #e7e5e4;
}

/* Order history — bottom-left so it never covers the native cart FAB (bottom-right) */
.rm-history-btn {
  position: fixed;
  left: 0.85rem;
  right: auto;
  bottom: 0.85rem;
  z-index: 55;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 999px;
  background: var(--rm-ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
}
/* Extra clearance if sticky cart bar is shown */
body.rm-has-sticky-cart .rm-history-btn {
  bottom: 4.5rem;
}
.rm-history {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 70;
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border-radius: 1.1rem 1.1rem 0 0;
  padding: 1rem 1rem 1.25rem;
  transform: translateY(110%);
  transition: transform 0.22s ease;
  border-top: 1px solid var(--rm-line);
}
.rm-history.is-open { transform: translateY(0); }
.rm-history h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.rm-history-item {
  border: 1px solid var(--rm-line);
  border-radius: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 0.55rem;
}
.rm-history-item .rm-h-top { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 700; }
.rm-history-item .rm-h-meta { color: var(--rm-muted); font-size: 0.8rem; margin: 0.25rem 0 0.55rem; }
.rm-history-item button {
  min-height: 2.4rem;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--rm-salmon);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.rm-history-empty { color: var(--rm-muted); font-size: 0.95rem; }
.rm-history-close {
  float: right;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--rm-muted);
}
.rm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 65;
  display: none;
}
.rm-backdrop.is-open { display: block; }

.rm-sticky-cart { display: none !important; }
body.rm-cart-open { padding-bottom: 0 !important; }

@media (min-width: 768px) {
  .rm-contacts, .rm-search-wrap, .rm-groups, .rm-filters, .rm-subcats {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
  }
  .rm-history {
    left: auto;
    right: 1rem;
    bottom: 1rem;
    width: 380px;
    max-height: 80vh;
    border-radius: 1rem;
  }
}
