/* Storefront refresh: clean marketplace layout, thin lines, no emoji, no sliding category bar.
   Loaded after style.css so it only overrides what needs to change. */
:root {
  --brand: #ee4d2d;
  --brand-2: #d43d20;
  --brand-soft: #fff2ee;
  --ink: #222222;
  --ink-2: #555555;
  --muted: #8c8c8c;
  --line: #eaeaea;
  --bg: #f5f5f5;
  --card: #ffffff;
}
html, body { background: var(--bg); }
body { font-size: 14px; color: var(--ink); }
.wrap { max-width: 1240px; padding: 0 16px; margin: 0 auto; }
.cats, .hero, .quickcats { display: none !important; }

/* --- top bar --- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; }
.topbar-inner { max-width: 1240px; }
.logo { color: var(--ink); font-weight: 700; letter-spacing: -.2px; }
.logo .dot, .logo .sub { color: var(--brand); }
.search input, .search { border-color: var(--line); background: #fafafa; }
.btn.primary, .btn:not(.ghost):not(.danger):not(.sm) { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
a.link, a { color: var(--brand); }

/* --- announcement strip --- */
.ann-bar { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 5px; padding: 9px 14px; margin: 14px 0 12px; min-height: 40px; }
.ann-tag { flex: none; font-size: 12px; font-weight: 700; color: var(--brand); border: 1px solid var(--brand);
  border-radius: 3px; padding: 2px 7px; letter-spacing: .3px; }
.ann-list { display: flex; gap: 22px; flex-wrap: wrap; min-width: 0; }
.ann-item { color: var(--ink-2); font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; }
.ann-item:hover { color: var(--brand); }
.ann-item b { font-weight: 600; color: var(--ink); margin-right: 6px; }

/* --- carousel --- */
.carousel { position: relative; height: 288px; border-radius: 6px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; display: flex; align-items: center;
  background: linear-gradient(112deg, #f7f2ec 0%, #f0e5d8 55%, #e8d7c3 100%); }
.slide:nth-child(2) { background: linear-gradient(112deg, #eef3f0 0%, #dfeae3 55%, #cddfd3 100%); }
.slide:nth-child(3) { background: linear-gradient(112deg, #f2f0f6 0%, #e4e0ef 55%, #d3cde4 100%); }
.slide.on { opacity: 1; }
.slide.has-img { background-size: cover; background-position: center; background-color: #eee; }
.slide.has-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(0,0,0,0) 62%); }
.slide-inner { position: relative; z-index: 1; padding: 0 54px; max-width: 620px; }
.slide-inner h2 { font-size: 30px; line-height: 1.28; margin: 0 0 12px; font-weight: 700; color: #2b2b2b; letter-spacing: -.4px; }
.slide-inner p { font-size: 15px; line-height: 1.7; margin: 0 0 20px; color: #555; }
.slide.has-img .slide-inner h2, .slide.has-img .slide-inner p { color: #fff; }
.slide-cta { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff;
  border-radius: 4px; padding: 9px 16px; font-size: 13px; font-weight: 600; text-decoration: none; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 46px; border: 0;
  background: rgba(0,0,0,.24); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3; }
.slide-nav:hover { background: rgba(0,0,0,.4); }
.slide-nav.prev { left: 0; border-radius: 0 4px 4px 0; }
.slide-nav.next { right: 0; border-radius: 4px 0 0 4px; }
.slide-dots { position: absolute; bottom: 14px; left: 54px; display: flex; gap: 7px; z-index: 3; }
.slide-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,.22); cursor: pointer; display: block; }
.slide-dots i.on { background: var(--brand); width: 20px; border-radius: 4px; }

/* --- fixed category grid, no horizontal scrolling --- */
.cat-panel { background: #fff; border: 1px solid var(--line); border-radius: 5px; margin: 14px 0 0; overflow: hidden; }
.cat-panel-hd { padding: 13px 16px 3px; font-size: 15px; font-weight: 700; color: var(--ink); }
.cat-grid { display: grid; grid-template-columns: repeat(var(--cat-cols, 4), minmax(0, 1fr)); gap: 1px; background: var(--line);
  margin: 10px 12px 12px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.cat-cell { background: #fff; padding: 15px 6px 13px; display: flex; flex-direction: column; align-items: center;
  gap: 9px; cursor: pointer; min-height: 92px; justify-content: center; transition: background .16s; }
.cat-cell:hover { background: var(--brand-soft); }
.cat-cell.on { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.cat-ic { width: 34px; height: 34px; border-radius: 50%; background: #faf7f5; color: var(--brand);
  display: flex; align-items: center; justify-content: center; }
.cat-ic svg { width: 18px; height: 18px; }
.cat-tx { font-size: 12.5px; line-height: 1.35; text-align: center; color: var(--ink-2); }
.subcats { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.subcat { border: 1px solid var(--line); background: #fafafa; border-radius: 3px; padding: 5px 11px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.subcat:hover, .subcat.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* --- named product sections --- */
.home-sec { background: #fff; border: 1px solid var(--line); border-radius: 5px; margin-top: 14px; overflow: hidden; }
.sec-head { display: flex; align-items: center; gap: 10px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.sec-head .bar { width: 3px; height: 17px; background: var(--brand); border-radius: 2px; }
.sec-head h2 { font-size: 16px; margin: 0; font-weight: 700; color: var(--ink); }
.sec-head .more { margin-left: auto; color: var(--muted); font-size: 12.5px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.sec-head .more:hover { color: var(--brand); }
.prod-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1px; background: var(--line); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* --- product card: no minimum order, no stock numbers --- */
.card.pcard { background: #fff; border: 0; border-radius: 0; overflow: hidden; position: relative;
  display: flex; flex-direction: column; transition: box-shadow .16s, transform .16s; }
.card.pcard:hover { box-shadow: 0 3px 14px rgba(0,0,0,.11); z-index: 2; transform: translateY(-1px); }
.card.pcard .thumb { background: #fff; border-radius: 0; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.card.pcard .thumb img { width: 100%; height: 100%; object-fit: contain; }
.card.pcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card.pcard .name { font-size: 13px; line-height: 1.45; color: var(--ink); height: 38px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 400; }
.card.pcard .spec { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.pcard .price { color: var(--brand); font-size: 17px; font-weight: 700; margin-top: auto; }
.card.pcard .price .cur { font-size: 12px; margin-right: 1px; }
.card.pcard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.card.pcard .sold { font-size: 11px; color: #aaa; }
.card.pcard .addbtn { width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--brand);
  color: var(--brand); display: flex; align-items: center; justify-content: center; cursor: pointer; background: #fff; }
.card.pcard .addbtn:hover { background: var(--brand); color: #fff; }
.card.pcard .login-price { font-size: 12px; color: var(--muted); margin-top: auto; }

/* --- fixed service rail --- */
.service-rail { position: fixed; right: 8px; top: 44%; transform: translateY(-50%); width: 190px; z-index: 55;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 18px rgba(0,0,0,.09);
  padding: 14px; }
.rail-hd { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rail-hd .ico svg { width: 15px; height: 15px; }
.rail-card { background: var(--brand-soft); border: 1px solid #ffdccf; border-radius: 4px; padding: 10px; margin-bottom: 10px; }
.rail-name { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.rail-line { font-size: 11.5px; color: var(--ink-2); line-height: 1.6; word-break: break-all; }
.rail-btn { display: block; width: 100%; text-align: center; border-radius: 4px; padding: 8px 6px; font-size: 12.5px;
  font-weight: 600; text-decoration: none; cursor: pointer; margin-top: 8px; }
.rail-btn.main { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.rail-btn.sub { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.rail-links { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.rail-links a { font-size: 12px; color: var(--ink-2); text-decoration: none; }
.rail-links a:hover { color: var(--brand); }
.rail-fab { display: none; }

/* --- generic panels / page furniture --- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.section h2 { font-size: 17px; }
.empty { color: var(--muted); }
.site-footer { background: #fff; border-top: 1px solid var(--line); }

/* --- small screens --- */
@media (max-width: 1100px) {
  .service-rail { display: none; }
  .rail-fab { display: flex; position: fixed; right: 14px; bottom: 82px; width: 46px; height: 46px;
    border-radius: 50%; background: var(--brand); color: #fff; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,.22); z-index: 56; cursor: pointer; }
  .rail-fab svg { width: 21px; height: 21px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 10px; }
  .grid, .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-cell { min-height: 78px; padding: 10px 3px; }
  .cat-tx { font-size: 11.5px; }
  .carousel { height: 172px; }
  .slide-inner { padding: 0 24px; }
  .slide-inner h2 { font-size: 20px; margin-bottom: 8px; }
  .slide-inner p { font-size: 12.5px; margin-bottom: 12px; }
  .slide-dots { left: 24px; bottom: 10px; }
  .slide-nav { width: 26px; height: 38px; }
  .ann-bar { margin: 10px 0; padding: 8px 10px; }
  .ann-list { gap: 10px; }
  .ann-item { font-size: 12px; max-width: 100%; }
  .top-actions .lbl-txt { display: none; }
  .sec-head { padding: 12px; }
  .sec-head h2 { font-size: 15px; }
}

/* --- wide screens: one centred column, symmetric gutters, top bar aligned --- */
@media (min-width: 1101px) {
  .wrap, .topbar-inner { max-width: 1240px; padding: 0 40px; }
  .site-footer .footer-inner { max-width: 1240px; padding: 0 40px; }
  /* The rail is a pure overlay. Opening it must never resize or reflow the page. */
}

/* --- collapse control: by default a slim tab in the outer margin --- */
.rail-hd { position: relative; padding-right: 26px; }
.rail-min { position: absolute; right: 0; top: -3px; width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; }
.rail-min:hover { color: var(--brand); border-color: var(--brand); }
.rail-folded { display: none; flex-direction: column; align-items: center; gap: 9px;
  color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.rail-folded span { writing-mode: vertical-rl; letter-spacing: 3px; }
.rail-folded .ico svg { width: 15px; height: 15px; }
.service-rail.collapsed { width: 28px; padding: 9px 4px; min-height: 0; right: 8px; }
.service-rail.collapsed .rail-hd, .service-rail.collapsed .rail-body { display: none; }
.service-rail.collapsed .rail-folded { display: flex; }

/* --- login / register switch and guest cart actions --- */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-tabs button { flex: 1; padding: 10px 0; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 15px; cursor: pointer; }
.auth-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.guest-btns { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.cart-guest { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
