:root { --ease: cubic-bezier(.2,.7,.2,1); }
body { background: var(--paper); color: var(--ink); overflow-x: hidden; }
main, header, footer, .catalog, .newsdesk { overflow-x: clip; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- scroll reveal: content enters from the right ---------- */
[data-reveal] { opacity: 0; translate: 54px 0; transition: opacity .72s var(--ease), translate .78s var(--ease); transition-delay: var(--delay, 0ms); }
[data-reveal="up"] { translate: 0 22px; }
[data-reveal="left"] { translate: -44px 0; }
[data-reveal="scale"] { translate: 0 16px; scale: .965; transition: opacity .72s var(--ease), translate .78s var(--ease), scale .78s var(--ease); }
[data-reveal].is-in { opacity: 1; translate: 0 0; scale: 1; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; translate: none; scale: none; transition: none; }
}

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 100; background: var(--y); border-bottom: 1px solid rgba(16,16,20,.14); transition: box-shadow .25s; }
.head-in { height: 66px; display: flex; align-items: center; gap: 28px; }
.brand { display: block; flex: none; }
.brand img { height: 36px; width: auto; display: block; }
.nav { display: flex; gap: 24px; margin-left: 4px; }
.nav a { font-size: 13.5px; color: rgba(16,16,20,.74); position: relative; padding: 5px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--ink); transition: width .25s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

.head-search { flex: 1; max-width: 500px; margin: 0 auto; }
.search-pill { display: flex; align-items: center; gap: 10px; height: 46px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; padding: 0 16px; transition: box-shadow .25s, border-color .25s; }
.search-pill > svg { width: 18px; height: 18px; color: #8B8576; flex: none; }
.search-pill input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 13.5px; color: var(--ink); }
.search-pill input::placeholder { color: #96907F; }
.search-pill:focus-within { border-color: var(--y-deep); box-shadow: 0 0 0 4px rgba(255,212,0,.30); }

.head-actions { display: flex; align-items: center; gap: 6px; }
.cart-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 10px; color: var(--ink); cursor: pointer; transition: background .2s; }
.cart-btn:hover { background: rgba(16,16,20,.09); }
.cart-btn svg { width: 21px; height: 21px; }
.cart-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--y); border: 1.5px solid #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.cart-count.pop { animation: pop .42s var(--ease); }
@keyframes pop { 0% { scale: 1; } 40% { scale: 1.45; } 100% { scale: 1; } }
.login { font-size: 13.5px; padding: 10px; color: var(--ink); }
.login:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-signup { height: 42px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: var(--y); font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 18px rgba(255,190,30,.28); transition: translate .2s var(--ease), box-shadow .2s; }
.btn-signup:hover { translate: 0 -1px; box-shadow: 0 12px 22px rgba(16,16,20,.24); }

[id] { scroll-margin-top: 78px; }
html.reveal-off [data-reveal] { opacity: 1 !important; translate: none !important; }

/* ---------- catalog ---------- */
.catalog { padding: 8px 0 48px; }
.catalog-layout { display: grid; grid-template-columns: 236px 1fr; gap: 40px; align-items: start; }
.side { align-self: stretch; }
.side-inner { position: sticky; top: 80px; }
.side h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 12px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; transition: background .2s, translate .2s; }
.cat-item:hover { background: #FFF4C7; translate: 2px 0; }
.cat-item.is-active { background: var(--y); }
.cat-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.cat-ico svg { width: 15px; height: 15px; }
.cat-name { flex: 1; font-size: 13.5px; color: var(--ink); }
.cat-count { font-size: 11.5px; color: #8B8576; }
.cat-item.is-active .cat-count { color: #3E3A2A; }

.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.results-head h1 { font-family: var(--font-display); font-size: clamp(19px, 1.8vw, 22px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.results-count { display: block; margin-top: 3px; font-size: 11px; color: var(--mut); }
.sell-link { font-size: 13px; border-bottom: 1px solid var(--ink); padding-bottom: 2px; white-space: nowrap; }
.sell-link:hover { background: var(--y); border-color: transparent; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (min-width: 1560px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }
.prod-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid #EFE6D1; border-radius: 14px; overflow: hidden; transition: translate .3s var(--ease), box-shadow .3s, border-color .3s; }
.prod-card[hidden] { display: none; }
.prod-card:hover { translate: 0 -4px; box-shadow: 0 18px 36px rgba(64,48,8,.10); border-color: #EAD9A8; }
.prod-media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; --media-h: 100%; background: linear-gradient(180deg, #E4DFD9 0%, #DCD7D1 55%, #D7D2CB 100%); }
.prod-media .prod-img { position: relative; width: 100%; height: var(--media-h); object-fit: contain; display: block; transition: transform .65s var(--ease); }

.prod-card:hover .prod-media .prod-img { transform: scale(1.03); }
.prod-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.38) 50%, transparent 60%); translate: -120% 0; transition: translate .8s var(--ease); pointer-events: none; }
.prod-card:hover .prod-media::after { translate: 120% 0; }
.prod-tag { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.93); border: 1px solid rgba(0,0,0,.12); border-radius: 999px; padding: 3px 8px; font-size: 10px; color: #3D3A31; }
.prod-fav { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; opacity: 0; translate: 0 8px; transition: opacity .25s, translate .25s, background .2s, color .2s; border: 1px solid rgba(0,0,0,.14); background: rgba(255,255,255,.94); color: var(--ink); }
.prod-fav svg { width: 14px; height: 14px; }
.prod-fav:hover { background: #FFF4C9; }
.prod-fav.saved { color: #DF9F00; background: #FFF6D8; }
.prod-fav.saved svg { fill: currentColor; }
.prod-card:hover .prod-fav, .prod-fav:focus-visible { opacity: 1; translate: 0 0; }
.prod-body { display: flex; flex-direction: column; flex: 1; padding: 9px 12px 11px; }
.prod-cat { font-size: 10.5px; color: #8B8576; }
.prod-body h3 { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 1px 0 4px; line-height: 1.25; }
.prod-price { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.prod-qty { display: block; margin-top: 3px; font-size: 11px; color: #8B8576; }
.prod-seller { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: 6px 0 8px; font-size: 11.5px; color: #4A4639; border-bottom: 1px solid #D8D1BE; padding-bottom: 1px; }
.prod-seller:hover { color: var(--ink); border-color: var(--y-deep); }
.prod-seller svg { width: 11px; height: 11px; color: #8B8576; }
.prod-cart { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; height: 32px; margin-top: auto; border: 1px solid var(--ink); border-radius: 9px; background: var(--ink); color: var(--y); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.prod-cart svg { width: 13px; height: 13px; }
.prod-cart:hover { background: var(--y); border-color: var(--y-deep); color: var(--ink); }
.prod-cart.done { background: var(--y); border-color: var(--y-deep); color: var(--ink); }

.empty { display: none; padding: 54px 24px; text-align: center; border: 1px dashed #E4D6AF; border-radius: 16px; }
.empty.show { display: block; }
.empty h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.empty p { font-size: 13px; color: var(--mut); margin: 6px auto 16px; max-width: 360px; line-height: 1.6; }
.empty .btn { display: inline-flex; }

/* ---------- news desk ---------- */
.newsdesk { padding: 46px 0 58px; border-top: 1px solid var(--line); }
.nd-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.nd-eyebrow { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #8B8576; }
.nd-viewport { overflow: hidden; touch-action: pan-y; }
.nd-track { display: flex; transition: transform .7s cubic-bezier(.65,.02,.22,1); will-change: transform; }
.nd-track.is-drag { transition: none; }
.nd-slide { flex: 0 0 100%; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 48px); align-items: center; padding: 2px 0; }
.nd-slide--flip .nd-copy { order: 2; }
.nd-slide--flip .nd-media { order: 1; }
.nd-copy { padding: 0 4px; }
.nd-cat { display: inline-block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: #4A4430; background: #FFF4C7; border: 1px solid #F3E3A8; border-radius: 999px; padding: 3px 10px; }
.nd-copy h3 { font-family: var(--font-display); font-size: clamp(19px, 1.75vw, 26px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin: 13px 0 10px; }
.nd-copy h3 a:hover { background: linear-gradient(transparent 62%, #FFE86B 62%); }
.nd-copy p { font-size: 13.5px; line-height: 1.68; color: #6F6A5B; max-width: 520px; }
.nd-foot { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.nd-meta { font-size: 10.5px; color: #6B6659; letter-spacing: .01em; }
.nd-more { margin-left: auto; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--ink); padding-bottom: 1px; white-space: nowrap; }
.nd-more:hover { background: var(--y); border-color: transparent; }
.nd-media { margin: 0; border-radius: 14px; overflow: hidden; background: #DED9D3; }
.nd-media .nd-img { width: 100%; height: clamp(190px, 21vw, 288px); object-fit: contain; display: block; transition: transform .6s var(--ease); }
.nd-slide:hover .nd-media .nd-img { transform: scale(1.03); }

/* ---------- stats ---------- */
.stats { background: #0F0F12; color: #F4F2E9; border-top: 1px solid #1E1E23; }
.stats-in { display: grid; grid-template-columns: repeat(4, 1fr); padding: 30px 0; }
.stat { padding: 0 26px; border-left: 1px solid #2A2A30; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(24px, 2.2vw, 32px); color: var(--y); letter-spacing: -.02em; line-height: 1; }
.stat span { display: block; margin-top: 6px; font-size: 12px; color: #9E9A8E; }

/* ---------- sell ---------- */
.sell { background: var(--y); }
.sell-in { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; padding: 44px 0; }
.sell h2 { font-family: var(--font-display); font-size: clamp(26px, 2.8vw, 36px); font-weight: 600; letter-spacing: -.02em; line-height: 1.08; }
.sell p { font-size: 13.5px; line-height: 1.65; color: #37321F; max-width: 540px; margin-top: 10px; }
.sell-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.08); transition: translate .2s var(--ease), background .2s, color .2s; }
.btn:hover { translate: 0 -2px; }
.btn-black { background: var(--ink); color: var(--y); }
.btn-black:hover { background: #26262C; }

/* ---------- newsletter ---------- */
.newsletter { background: var(--paper-2); border-top: 1px solid var(--line); }
.news-in { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px 0; }
.news-in h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.news-in p { font-size: 12px; color: var(--mut); margin-top: 3px; }
.news-form { display: flex; width: 380px; max-width: 42vw; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px; transition: box-shadow .25s, border-color .25s; }
.news-form:focus-within { box-shadow: 0 0 0 4px rgba(255,212,0,.25); border-color: var(--y-deep); }
.news-form input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; padding: 0 14px; font-size: 13px; }
.news-form button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--y); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.news-form button:hover { background: var(--ink); color: var(--y); }

/* ---------- footer ---------- */
footer { background: #0C0C0F; color: #EFECDF; padding-bottom: 74px; }
.foot-grid { display: grid; grid-template-columns: 1.55fr 1fr 1fr 1fr; gap: 32px; padding: 52px 0 36px; }
footer .brand img { height: 31px; }
.foot-brand p { font-size: 12.5px; line-height: 1.72; color: #A9A59A; max-width: 340px; margin-top: 14px; }
.socials { display: flex; gap: 8px; margin-top: 18px; }
.socials a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #303038; border-radius: 50%; color: #D6D2C7; transition: background .2s, border-color .2s, color .2s; }
.socials svg { width: 14px; height: 14px; }
.socials a:hover { background: var(--y); border-color: var(--y); color: #111; }
.foot-follow { display: inline-block; margin-top: 18px; font-size: 12px; color: #EDEAE0; border-bottom: 1px solid #45454E; padding-bottom: 2px; }
.foot-follow:hover { color: var(--y); border-color: var(--y); }
.foot-col h4 { font-size: 10.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: #77776F; margin-bottom: 14px; }
.foot-col a { display: block; font-size: 12.5px; color: #D5D1C6; padding: 5px 0; }
.foot-col a:hover { color: var(--y); }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 0 20px; border-top: 1px solid #22222A; font-size: 11px; color: #85817A; }
.back-top { display: inline-flex; align-items: center; gap: 6px; color: #CFCBBF; white-space: nowrap; }
.back-top:hover { color: var(--y); }
.back-top svg { width: 12px; height: 12px; }

/* ---------- toast ---------- */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--paper); font-size: 12.5px; padding: 12px 18px; border-radius: 999px; opacity: 0; translate: 0 10px; pointer-events: none; transition: opacity .3s, translate .3s var(--ease); }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--y); }
.toast.show { opacity: 1; translate: 0 0; }

@media (max-width: 1180px) {
  .nav { gap: 16px; }
  .head-search { max-width: 380px; }
}
@media (max-width: 1024px) {
  .nav { display: none; }
  .head-search { max-width: none; margin: 0 10px; }
  /* minmax(0,…) stops the horizontal category strip from stretching the track */
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .side, .side-inner, .catalog-main, .cat-list { min-width: 0; }
  .side-inner { position: static; }
  .side h3 { margin-bottom: 10px; }
  .cat-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: none; }
  .cat-list::-webkit-scrollbar { display: none; }
  .cat-item { flex: none; width: auto; border: 1px solid var(--line); background: #fff; padding: 7px 12px; }
  .cat-count { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .site-head { position: static; }
  [id] { scroll-margin-top: 12px; }
  .head-in { height: 64px; gap: 12px; }
  .brand img { height: 27px; }
  .login { display: none; }

  .nd-slide, .nd-slide--flip { grid-template-columns: 1fr; gap: 16px; }
  .nd-slide--flip .nd-copy { order: 1; }
  .nd-slide--flip .nd-media { order: 2; }
  
  .nd-copy { padding: 2px; }
  .foot-bottom { grid-template-columns: 1fr; gap: 8px; }
  .catalog { padding: 24px 0 46px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prod-media { --media-h: clamp(78px, 44vw, 124px); }
.prod-tag { top: 6px; left: 6px; font-size: 8.5px; padding: 2px 6px; }
.prod-fav { width: 26px; height: 26px; top: 6px; right: 6px; opacity: 1; translate: 0 0; }
.prod-fav svg { width: 12px; height: 12px; }
.prod-body { padding: 9px 10px 10px; }
.prod-cat { font-size: 9px; letter-spacing: .01em; }
.prod-body h3 { font-size: 13px; margin: 1px 0 3px; line-height: 1.22; }
.prod-price { font-size: 15.5px; }
.prod-qty { font-size: 9.5px; margin-top: 1px; }
.prod-seller { font-size: 9.5px; gap: 3px; margin: 4px 0 7px; }
.prod-seller svg { width: 9px; height: 9px; }
.prod-cart { height: 30px; font-size: 10.5px; gap: 4px; border-radius: 8px; }
.prod-cart svg { width: 11px; height: 11px; }
  .stats-in { grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 24px 0; }
  .stat { border-left: 0; padding: 0; }
  .sell-in { grid-template-columns: 1fr; padding: 34px 0; }
  .news-in { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 0; }
  .news-form { width: 100%; max-width: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; padding: 34px 0 26px; }
}
/* two-row header on small phones: brand + actions, then the search bar */
@media (max-width: 600px) {
  .head-in { height: auto; padding: 10px 0 12px; flex-wrap: wrap; gap: 8px 12px; }
  .head-search { order: 3; flex: 1 0 100%; margin: 0; }
  .head-actions { gap: 4px; margin-left: auto; }
  .btn-signup { height: 38px; padding: 0 15px; font-size: 12.5px; }
  .cart-btn { width: 38px; height: 38px; }
  .search-pill { height: 42px; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .prod-body { padding: 8px 9px 9px; }
}
/* short laptop windows: trim card body so two full rows stay above the fold */
@media (max-height: 680px) {
  .catalog { padding-top: 6px; }
  .prod-cat { display: none; }
  .prod-body { padding: 8px 11px 9px; }
  .prod-body h3 { font-size: 14px; margin: 0 0 3px; }
  .prod-price { font-size: 16px; }
  .prod-qty { font-size: 10.5px; margin-top: 2px; }
  .prod-seller { margin: 5px 0 7px; font-size: 11px; }
  .prod-cart { height: 30px; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .prod-card, .prod-media img, .prod-media::after { transition: none; }
  .cart-count.pop { animation: none; }
}

/* auth: .btn-signup can be an <a>, not only a <button> */
.btn-signup { display: inline-flex; align-items: center; justify-content: center; }


/* product cards link to the detail template */
.prod-link { display: block; }
.prod-body h3 a { color: inherit; }
.prod-body h3 a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* mobile keeps the original uncropped image, desktop fills the frame */
@media (max-width: 899px) { .prod-media .prod-img { object-fit: contain; } }
.prod-media .prod-img { object-fit: contain; }

/* footer: fits one screen and carries a quiet wordmark */
footer { position: relative; overflow: hidden; isolation: isolate; }
footer::before {
  content: "PAKROBOTS";
  position: absolute;
  left: 50%;
  bottom: -.16em;
  transform: translateX(-50%);
  font-family: var(--font-head, inherit);
  font-size: clamp(84px, 16vw, 280px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .78;
  white-space: nowrap;
  color: rgba(255,255,255,.055);
  pointer-events: none;
  z-index: 0;
}
footer > * { position: relative; z-index: 1; }
.foot-grid { padding: 30px 0 20px; gap: 26px; }
.foot-brand p { font-size: 12.5px; line-height: 1.55; }
.foot-col a, footer a { font-size: 13px; }
.foot-grid ul { gap: 4px; }

/* photos letterbox inside their frame: never cropped on any screen */
.prod-media { position: relative; }
.prod-media .prod-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
