/* ============================================================
   layout.css — Site header, footer, nav, page layouts
   Guangzhou Shimu Electronics Co., Ltd
   ============================================================ */

/* ── Topbar ───────────────────────────────────────────────── */
.topbar { background: #111; height: 36px; overflow: hidden; display: flex; align-items: center; }
.topbar-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker 42s linear infinite;
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 2.25rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #777;
}
.topbar-item strong { color: #fff; }
.topbar-dot         { color: #333; padding-inline: .25rem; }

/* ── Site header ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid #f0f0f0;
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,.08); }

.header-inner {
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

/* Logo */
.hdr-logo img  { height: 38px; display: block; }
.hdr-logo-fb {
  display: none;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.hdr-logo-icon {
  width: 38px; height: 38px;
  background: var(--red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--white);
  flex-shrink: 0;
}
.hdr-logo-text {
  font-family: var(--font-cond);
  font-size: .95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-900);
  line-height: 1.1;
}
.hdr-logo-text small { display: block; font-size: .67rem; color: var(--red); letter-spacing: .08em; }

/* Desktop nav */
.hdr-nav { display: flex; align-items: center; gap: .2rem; margin-left: 1.25rem; }
.hdr-nav a {
  padding: .45rem .875rem;
  font-size: .875rem;
  font-weight: 600;
  color: #666;
  text-decoration: none;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
}
.hdr-nav a:hover, .hdr-nav a.active { background: #f5f5f5; color: #111; }

/* Header actions */
.hdr-actions { margin-left: auto; display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  font-size: 1.05rem;
  position: relative;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.icon-btn:hover { background: #f5f5f5; color: #111; }

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  padding-inline: 3px;
}

.btn-signin {
  height: 36px;
  padding-inline: 1.1rem;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: .825rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background var(--transition);
}
.btn-signin:hover { background: var(--red); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #444;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav — sits outside sticky header, sticks just below it */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: .5rem 0;
  position: sticky;
  top: 64px;          /* matches header height */
  z-index: 99;
  box-shadow: 0 4px 16px rgba(0,0,0,.07);
}
.mobile-nav.open { display: flex; }

/* ── Search box dropdown ─────────────────────────────────── */
.search-box-wrap {
  position: relative;
  margin-left: .5rem;
}
.search-box-wrap.open {
  display: block !important;
}
.search-box-wrap input:focus {
  border-color: #D42B2B;
  outline: none;
}
.mobile-nav a {
  padding: .75rem clamp(1rem, 4vw, 2.5rem);
  font-size: .925rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  justify-content: space-between;
  transition: background var(--transition), color var(--transition);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { background: var(--gray-50); color: var(--red); }

/* ── Cart drawer ──────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.42);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--white);
  z-index: 201;
  box-shadow: -4px 0 32px rgba(0,0,0,.1);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.25,.8,.25,1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.cart-drawer-title {
  font-family: var(--font-cond);
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #111;
}
.cart-x {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.cart-x:hover { background: #f0f0f0; color: #111; }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}
.cart-drawer-foot {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}

/* Cart item row */
.cart-item {
  display: flex;
  gap: 1rem;
  padding: .875rem 0;
  border-bottom: 1px solid #f5f5f5;
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #f7f7f7;
  border: 1px solid #efefef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-family: var(--font-cond);
  font-size: .95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.01em;
  color: #111;
  line-height: 1.1;
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-spec { font-size: .72rem; color: #aaa; font-family: var(--font-mono); }
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .625rem;
}
.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid #e5e5e5;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
}
.cart-qty-btn:hover { border-color: var(--red); color: var(--red); }
.cart-qty-val { font-size: .875rem; font-weight: 700; min-width: 20px; text-align: center; }
.cart-item-remove {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: .8rem;
  transition: color var(--transition);
}
.cart-item-remove:hover { color: var(--red); }
.cart-item-price {
  font-family: var(--font-cond);
  font-size: 1.15rem;
  font-weight: 900;
  color: #111;
  white-space: nowrap;
}

/* Cart totals */
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .875rem;
  padding: .25rem 0;
  color: #666;
}
.cart-total-row.total {
  font-family: var(--font-cond);
  font-size: 1.3rem;
  font-weight: 900;
  color: #111;
  border-top: 2px solid #f0f0f0;
  padding-top: .75rem;
  margin-top: .25rem;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page-wrap {
  min-height: calc(100vh - 64px - 36px);
}

/* ── Page hero (inner pages) ──────────────────────────────── */
.page-hero {
  background: var(--gray-900);
  padding-block: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(-55deg, transparent, transparent 52px,
    rgba(255,255,255,.015) 52px, rgba(255,255,255,.015) 53px);
  pointer-events: none;
}
.page-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}
.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: var(--white);
  margin-bottom: .5rem;
}
.page-hero p { font-size: .95rem; color: #666; }

/* ── Site footer ──────────────────────────────────────────── */
.site-footer { background: #0d0d0d; color: var(--white); }

.footer-upper {
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-desc { font-size: .8rem; color: #555; line-height: 1.8; margin-top: .875rem; }
.footer-socs { display: flex; gap: .5rem; margin-top: 1.25rem; }
.footer-soc {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: #888;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.footer-soc:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.footer-col-title {
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 1.125rem;
}
.footer-links { display: flex; flex-direction: column; gap: .55rem; }
.footer-lnk { font-size: .82rem; color: #555; text-decoration: none; transition: color var(--transition); }
.footer-lnk:hover { color: var(--red); }
.footer-contact { display: flex; flex-direction: column; gap: .65rem; }
.footer-ci { display: flex; align-items: flex-start; gap: .625rem; font-size: .82rem; color: #555; }
.footer-ci-icon { flex-shrink: 0; width: 16px; text-align: center; margin-top: .1rem; }
.footer-ci a { color: #555; text-decoration: none; transition: color var(--transition); }
.footer-ci a:hover { color: var(--red); }

.footer-lower {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 1.375rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1400px;
  margin-inline: auto;
}
.footer-copy { font-size: .75rem; color: #444; }
.footer-pay { display: flex; flex-wrap: wrap; gap: .4rem; }
.footer-pay span {
  padding: .2rem .55rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #555;
}
.footer-legal { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-legal a { font-size: .75rem; color: #444; text-decoration: none; transition: color var(--transition); }
.footer-legal a:hover { color: var(--red); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .footer-upper { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .hdr-nav { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 520px) {
  .footer-upper { grid-template-columns: 1fr; }
  .footer-lower { flex-direction: column; align-items: flex-start; }
}