/* ── Japan Tools — Custom Styles ── */

:root {
  --red:        #C41E3A;
  --red-dark:   #8B0000;
  --red-mid:    #A0192F;
  --red-light:  #FEF2F2;
  --bg:         #F5F4F1;
  --surface:    #FFFFFF;
  --text:       #111827;
  --text-2:     #6B7280;
  --text-3:     #9CA3AF;
  --border:     #E5E7EB;
  --border-2:   #D1D5DB;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  --radius:     10px;
  --radius-lg:  14px;
  --transition: .18s ease;
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }

/* ── navbar ── */
.site-nav {
  background: #0E0E0E !important;
  border-bottom: 2px solid var(--red);
  padding: .35rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.nav-brand {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  letter-spacing: -.3px;
}
.nav-brand:hover { color: #fff; }
.nav-brand-sub {
  font-size: .6rem;
  color: var(--red);
  letter-spacing: 4px;
  font-weight: 500;
  text-transform: uppercase;
}
.nav-cart-btn {
  color: #ccc;
  text-decoration: none;
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border: 1px solid #333;
  border-radius: 8px;
  transition: all var(--transition);
  background: rgba(255,255,255,.03);
}
.nav-cart-btn:hover { color: #fff; border-color: var(--red); background: rgba(196,30,58,.1); }
.cart-badge {
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.nav-search {
  flex: 1;
  max-width: 360px;
}
.nav-search .form-control {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #fff;
  font-size: .875rem;
  border-radius: 8px 0 0 8px;
  height: 36px;
}
.nav-search .form-control::placeholder { color: #555; }
.nav-search .form-control:focus {
  background: #1e1e1e;
  border-color: var(--red);
  box-shadow: none;
  color: #fff;
}
.nav-search .btn {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  border-radius: 0 8px 8px 0;
  height: 36px;
  width: 40px;
  display: flex; align-items: center; justify-content: center;
}
.nav-search .btn:hover { background: var(--red-mid); }

/* ── navbar auth buttons ── */
.nav-user-btn {
  background: rgba(255,255,255,.05);
  border: 1px solid #333;
  color: #ccc;
  border-radius: 8px;
  padding: .4rem .9rem;
  font-size: .875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .45rem;
  transition: all var(--transition);
}
.nav-user-btn:hover, .nav-user-btn:focus { color: #fff; border-color: var(--red); outline: none; background: rgba(196,30,58,.12); }
.nav-auth-btn {
  color: #ccc;
  text-decoration: none;
  font-size: .85rem;
  padding: .4rem .8rem;
  border: 1px solid #333;
  border-radius: 8px;
  transition: all var(--transition);
  white-space: nowrap;
  background: rgba(255,255,255,.03);
}
.nav-auth-btn:hover { color: #fff; border-color: #555; background: rgba(255,255,255,.07); }
.nav-auth-btn--accent {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.nav-auth-btn--accent:hover {
  background: var(--red-mid);
  border-color: var(--red-mid);
  color: #fff;
}

/* ── nav phone icon (mobile) ── */
.nav-phone-icon {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  color: #dc3545;
  font-size: .85rem;
  background: rgba(255,255,255,.03);
  transition: all var(--transition);
}
.nav-phone-icon:hover { color: #fff; border-color: var(--red); background: rgba(196,30,58,.1); }

/* ── nav phone ── */
.nav-phone {
  color: #ccc;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition);
}
.nav-phone:hover { color: #fff; }

/* ── hero ── */
.hero {
  background: linear-gradient(140deg, #0E0E0E 0%, #1a0505 60%, #1e0808 100%);
  color: #fff;
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid #2a0a0a;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '工具';
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11rem;
  color: rgba(196,30,58,.07);
  font-weight: 900;
  pointer-events: none;
  line-height: 1;
  letter-spacing: -5px;
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: .6rem;
  letter-spacing: -.5px;
  line-height: 1.15;
}
.hero p  { color: #9CA3AF; font-size: 1.05rem; margin: 0; }
.hero-accent { color: var(--red); }

/* ── active filters bar ── */
.active-filters {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #fdf2f4;
  border: 1.5px solid rgba(196,30,58,.25);
  color: var(--red);
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 20px;
}
.active-filter-remove {
  color: var(--red);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  opacity: .7;
  transition: opacity var(--transition);
}
.active-filter-remove:hover { opacity: 1; }
.active-filter-clear {
  font-size: .8rem;
  color: var(--text-2);
  text-decoration: none;
  margin-left: .25rem;
}
.active-filter-clear:hover { color: var(--red); }

/* ── category pills ── */
.cats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.75rem;
  padding-top: .25rem;
}
.cat-pill {
  padding: .35rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .8rem;
  text-decoration: none;
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--transition);
  font-weight: 500;
}
.cat-pill:hover { border-color: var(--red); color: var(--red); }
.cat-pill.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(196,30,58,.25);
}

/* ── product cards ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}
.product-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
  border-color: var(--border-2);
}
.product-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #F3F4F6;
}
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .4s ease;
  background: #fff;
}
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.product-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D1D5DB;
  font-size: 3rem;
}
.product-body {
  padding: 1rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-cat {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red);
  margin-bottom: .3rem;
  font-weight: 600;
}
.product-name {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .4rem;
  line-height: 1.4;
  color: var(--text);
}
.product-desc {
  font-size: .8rem;
  color: var(--text-2);
  line-height: 1.55;
  flex: 1;
  margin-bottom: .8rem;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.product-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -.3px;
  white-space: nowrap;
}

/* ── buttons ── */
.btn-red {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
  letter-spacing: .1px;
}
.btn-red:hover { background: var(--red-mid); border-color: var(--red-mid); color: #fff; box-shadow: 0 3px 10px rgba(196,30,58,.3); }
.btn-red:active { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline-red {
  border: 1.5px solid var(--red);
  color: var(--red);
  background: transparent;
  font-weight: 600;
}
.btn-outline-red:hover { background: var(--red); color: #fff; box-shadow: 0 3px 10px rgba(196,30,58,.25); }
.btn-primary { background: var(--red) !important; border-color: var(--red) !important; }
.btn-primary:hover { background: var(--red-mid) !important; border-color: var(--red-mid) !important; }
.btn-outline-primary { color: var(--red) !important; border-color: var(--red) !important; }
.btn-outline-primary:hover { background: var(--red) !important; color: #fff !important; }
.form-control, .form-select {
  border-color: var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(196,30,58,.12);
}

/* ── qty control ── */
.qty-control { display: flex; align-items: center; gap: .5rem; }
.qty-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: 7px;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  color: var(--text);
}
.qty-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.qty-input {
  width: 50px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: .25rem;
  font-size: .9rem;
  font-weight: 600;
}

/* ── stock badges ── */
.stock-badge {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 600;
  padding: .28em .7em;
  border-radius: 20px;
  letter-spacing: .2px;
  gap: .3em;
}
.stock-ok  { background: #ECFDF5; color: #065F46; }
.stock-low { background: #FFFBEB; color: #92400E; }
.stock-out { background: #FEF2F2; color: #991B1B; }

/* ── order status ── */
.status-badge { font-size: .78rem; padding: .3em .65em; border-radius: 20px; }

/* ── order page ── */
.order-hero {
  background: #0E0E0E;
  color: #fff;
  padding: 2rem;
  border-radius: 12px 12px 0 0;
}
.bank-box {
  background: var(--red-light);
  border: 1px solid rgba(196,30,58,.18);
  border-radius: 10px;
  padding: 1.5rem;
}
.bank-box pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .95rem;
}
.order-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--red);
}

/* ── product detail ── */
.product-detail-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  object-fit: contain;
  box-shadow: var(--shadow-sm);
  display: block;
  background: var(--surface);
}
#productCarousel .carousel-inner { overflow: hidden; }
#productCarousel .carousel-item { height: auto; }
#productCarousel .carousel-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  background: var(--surface);
}
.product-detail-placeholder {
  width: 100%;
  height: 340px;
  background: #F3F4F6;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D1D5DB;
  font-size: 5rem;
}

/* ── cart page ── */
.cart-table thead th { background: #111; color: #fff; }

/* ── checkout page ── */
.checkout-steps {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--text-3);
}
.checkout-steps .step {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 500;
}
.checkout-steps .step.done {
  color: var(--text-2);
  border-color: var(--border-2);
}
.checkout-steps .step.active {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-light);
  font-weight: 600;
}
.checkout-steps .step-arrow { color: var(--border-2); font-size: .75rem; }

.checkout-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.checkout-card-header {
  background: #0E0E0E;
  color: #fff;
  padding: .9rem 1.5rem;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .1px;
}
.checkout-card-body {
  padding: 1.75rem;
}
.checkout-info-block {
  background: #F0FFF4;
  border: 1px solid #BBDEC9;
  border-radius: 8px;
  padding: .9rem 1rem;
  font-size: .875rem;
  line-height: 1.55;
}
.req { color: var(--red); }

.checkout-summary {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-sm);
}
.checkout-summary-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  color: var(--text);
  padding-bottom: .8rem;
  border-bottom: 1.5px solid var(--border);
}
.summary-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .85rem;
}
.summary-thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.summary-thumb-placeholder {
  width: 46px;
  height: 46px;
  background: #F3F4F6;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D1D5DB;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.summary-item-info { flex: 1; min-width: 0; }
.summary-item-name { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-item-qty { font-size: .78rem; color: var(--text-2); margin-top: .1rem; }
.summary-item-price { font-size: .9rem; font-weight: 700; white-space: nowrap; color: var(--text); }
.summary-divider { border: none; border-top: 1.5px solid var(--border); margin: .9rem 0; }
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.summary-total span { font-size: .95rem; font-weight: 600; }
.summary-total-amount { font-size: 1.4rem; font-weight: 800; color: var(--red); }
.summary-note {
  background: #F9F8F6;
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: .78rem;
  color: var(--text-2);
  margin-top: .75rem;
}

/* ── footer ── */
.site-footer {
  background: #0E0E0E;
  color: #9CA3AF;
  padding: 2rem 0;
  margin-top: auto;
  font-size: .85rem;
  border-top: 2px solid var(--red);
}
.site-footer .brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.site-footer .footer-link { color: #9CA3AF; text-decoration: none; display: block; margin-bottom: .3rem; }
.site-footer .footer-link:hover { color: #fff; }

/* ── admin layout ── */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px;
  background: #0E0E0E;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding-top: .5rem;
}
.admin-logo {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid #1e1e1e;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.admin-logo span { color: var(--red); }
.admin-nav { padding: 1rem 0; flex: 1; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  color: #9CA3AF;
  text-decoration: none;
  font-size: .875rem;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav a:hover { background: #1a1a1a; color: #fff; }
.admin-nav a.active { background: #1a1a1a; color: #fff; border-left-color: var(--red); }
.admin-sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid #1e1e1e; }
.admin-sidebar-footer a { color: #9CA3AF; text-decoration: none; font-size: .8rem; }
.admin-sidebar-footer a:hover { color: var(--red); }
.admin-logout-btn { background: none; border: none; padding: 0; color: #9CA3AF; font-size: .8rem; cursor: pointer; }
.admin-logout-btn:hover { color: var(--red); }
.admin-content { flex: 1; padding: 2rem; background: var(--bg); overflow-y: auto; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.admin-topbar h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }

/* ── stat cards ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--red); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-2); margin-top: .3rem; text-transform: uppercase; letter-spacing: .5px; }

/* ── admin tables ── */
.admin-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.admin-card-header {
  background: #0E0E0E;
  color: #fff;
  padding: .8rem 1.25rem;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  background: #1a1a1a;
  color: #9CA3AF;
  padding: .65rem 1rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
  border: none;
}
.admin-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .875rem;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAF9; }

/* ── product thumbnail ── */
.prod-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
  border: 1.5px solid var(--border);
}
.prod-thumb-placeholder {
  width: 48px;
  height: 48px;
  background: #F3F4F6;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D1D5DB;
  font-size: 1.2rem;
}

/* ── admin login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0E0E0E;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo h1 { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.login-logo span { color: var(--red); }

/* ── product form ── */
.image-preview { max-width: 240px; border-radius: 8px; margin-top: .75rem; border: 1.5px solid var(--border); }
.current-image { max-width: 200px; border-radius: 8px; border: 1.5px solid var(--border); }

/* ── order detail ── */
.order-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.info-block {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.info-block h6 {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-2);
  margin-bottom: .75rem;
  font-weight: 600;
}
.info-row { display: flex; gap: .5rem; margin-bottom: .4rem; font-size: .875rem; }
.info-label { color: var(--text-2); min-width: 100px; }

/* ── auth pages ── */
.auth-wrap {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--border);
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo-icon {
  width: 60px;
  height: 60px;
  background: var(--red-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .9rem;
  font-size: 1.75rem;
  border: 1.5px solid rgba(196,30,58,.15);
}
.auth-logo h1 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
  margin: 0;
}
.auth-logo h1 span { color: var(--red); }
.auth-sub { font-size: .875rem; color: var(--text-2); margin-top: .3rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--text-3);
  font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── profile page ── */
.profile-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  position: sticky;
  top: 90px;
  box-shadow: var(--shadow-sm);
}
.profile-avatar {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(196,30,58,.3);
}
.profile-name  { font-size: 1.1rem; font-weight: 700; }
.profile-email { font-size: .8rem; color: var(--text-2); margin-top: .2rem; }
.profile-since { font-size: .75rem; color: var(--text-3); margin-top: .75rem; }

/* ── order row in profile ── */
.order-row {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.order-row:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-2);
  transform: translateY(-2px);
}

/* ── misc ── */
.section-divider { border: none; border-top: 1.5px solid var(--border); margin: 1.5rem 0; }
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-2);
}
.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--border-2);
}
.alert-error {
  background: var(--red-light);
  border: 1.5px solid rgba(196,30,58,.2);
  color: var(--red-dark);
  border-radius: 8px;
  padding: .75rem 1rem;
  font-size: .875rem;
}

/* ── delivery company selector ── */
.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.delivery-option { cursor: pointer; display: block; }
.delivery-option input[type="radio"] { display: none; }
.delivery-option-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  background: var(--surface);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: .25rem;
  user-select: none;
}
.delivery-option-card:hover { border-color: var(--border-2); }
.delivery-option input[type="radio"]:checked + .delivery-option-card {
  border-color: var(--red);
  background: var(--red-light);
  box-shadow: 0 0 0 3px rgba(196,30,58,.1);
}
.delivery-option-logo {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
  margin-bottom: .2rem;
}
.delivery-cdek { background: #00A651; color: #fff; letter-spacing: .5px; font-size: .75rem; }
.delivery-yandex { background: #FC3F1D; color: #fff; font-size: 1.1rem; }
.delivery-option-name { font-weight: 700; font-size: .9rem; color: var(--text); }
.delivery-option-desc { font-size: .78rem; color: var(--text-2); }

/* ── delivery badge in admin ── */
.delivery-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700;
  padding: .2em .65em; border-radius: 6px;
}
.delivery-badge-cdek { background: #E6F7EE; color: #00703A; }
.delivery-badge-yandex { background: #FFF0EE; color: #C0321B; }

/* ── admin product tabs ── */
.prod-tabs {
  display: flex;
  gap: .5rem;
}
.prod-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.prod-tab:hover { border-color: var(--border-2); color: var(--text); }
.prod-tab.active {
  background: #0E0E0E;
  border-color: #0E0E0E;
  color: #fff;
}
.prod-tab-count {
  background: rgba(255,255,255,.15);
  color: inherit;
  font-size: .7rem;
  font-weight: 700;
  padding: .1em .55em;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.prod-tab:not(.active) .prod-tab-count { background: #F3F4F6; color: var(--text-2); }
.prod-tab-count--red { background: var(--red) !important; color: #fff !important; }

/* ── hero inner layout ── */
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.hero-cats {
  display: grid;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: .4rem .75rem;
  flex-shrink: 0;
}
.hero-cat-btn {
  display: block;
  padding: .45rem 1.3rem;
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.05);
  transition: all var(--transition);
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.hero-cat-btn:hover { color: #fff; border-color: var(--red); background: rgba(196,30,58,.2); }
.hero-cat-btn.active { color: #fff; border-color: var(--red); background: var(--red); }

/* ── navbar catalog button ── */
.nav-catalog-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid #333;
  color: #ccc;
  border-radius: 8px;
  padding: .4rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-catalog-btn:hover, .nav-catalog-btn:focus { color: #fff; border-color: var(--red); outline: none; background: rgba(196,30,58,.12); }
.nav-catalog-btn::after { display: none; }

/* ── catalog dropdown ── */
.catalog-dropdown {
  padding: .5rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;
  min-width: 0;
}
.catalog-dropdown-panels {
  display: flex;
  gap: 0;
  padding: .5rem 0 .25rem;
}
.catalog-dropdown-panel {
  padding: 0 1rem;
  min-width: 120px;
}
.catalog-dropdown-divider-v {
  width: 1px;
  background: #f0f0f0;
  align-self: stretch;
  flex-shrink: 0;
}
.catalog-dropdown-header {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--red);
  margin-bottom: .4rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #f0f0f0;
  pointer-events: none;
  white-space: nowrap;
}
.catalog-panel-grid {
  display: grid;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: .05rem .75rem;
  max-width: calc(3 * 110px + 2 * .75rem);
  overflow: hidden;
}

.catalog-col {
    min-width: 110px;
    display: flex;
    flex-direction: column;
}
.catalog-dropdown-item {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  padding: .3rem .5rem .3rem .7rem;
  border-radius: 5px;
  text-decoration: none;
  position: relative;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.catalog-dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--red);
  border-radius: 0 2px 2px 0;
  transition: height var(--transition);
}
.catalog-dropdown-item:hover { background: #fdf2f4; color: var(--red); }
.catalog-dropdown-item:hover::before { height: 60%; }
.catalog-dropdown-all {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  padding: .4rem 1rem;
}
.catalog-dropdown-all:hover { background: #f9fafb; color: var(--text); }

/* ── featured / bestsellers ── */
.featured-section {
  background: linear-gradient(135deg, rgba(196,30,58,.06) 0%, rgba(245,158,11,.05) 100%);
  border: 1.5px solid rgba(196,30,58,.18);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.5rem;
}
.featured-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: #C41E3A;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
}
.featured-header .fa-fire { color: #F59E0B; }
.product-card--featured {
  position: relative;
  border-color: rgba(196,30,58,.3);
}
.product-card--featured:hover {
  border-color: #C41E3A;
}
.featured-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  z-index: 2;
  background: #C41E3A;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: .22em .65em;
  border-radius: 20px;
  pointer-events: none;
}
.featured-badge .fa-star { color: #F59E0B; }

/* ── all products heading ── */
.all-products-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--border);
}
.all-products-header .fa-th-large { color: var(--text-2); font-size: .95rem; }

/* ── lightbox ── */
.lightbox-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.lightbox-main-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: color .15s;
  text-shadow: 0 1px 6px rgba(0,0,0,.7);
}
.lightbox-nav-prev { left: 0; }
.lightbox-nav-next { right: 0; }
.lightbox-nav-btn:hover { color: var(--red); }

/* ── size pills ── */
.size-pill { cursor: pointer; margin: 0; }
.size-pill-label {
  display: inline-block;
  padding: .3em .9em;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.size-pill-label:hover { border-color: var(--red); color: var(--red); }
.size-pill-label.active { border-color: var(--red); background: var(--red); color: #fff; }

/* ── mobile nav toggle ── */
.mobile-nav-toggle {
  background: rgba(255,255,255,.07);
  border: 1px solid #333;
  color: #ccc;
  border-radius: 8px;
  padding: .42rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.mobile-nav-toggle:hover { color: #fff; border-color: var(--red); background: rgba(196,30,58,.12); }

/* ── mobile search bar ── */
.mobile-search-bar {
  background: #111;
  border-bottom: 1px solid #222;
  padding: .5rem 0;
  position: sticky;
  top: 54px;
  z-index: 999;
}
.mobile-search-input {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #fff;
}
.mobile-search-input::placeholder { color: #555; }
.mobile-search-input:focus {
  background: #1e1e1e;
  border-color: var(--red);
  box-shadow: none;
  color: #fff;
}

/* ── mobile offcanvas menu ── */
.mobile-offcanvas {
  background: #111;
  color: #ccc;
  max-width: 300px;
}
.mobile-offcanvas .offcanvas-header {
  background: #0a0a0a;
  border-bottom: 1px solid #222;
  padding: .9rem 1.25rem;
}
.mobile-offcanvas .offcanvas-title { color: #fff; font-weight: 700; font-size: 1rem; }
.mobile-menu-user {
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.mobile-menu-section { }
.mobile-menu-section-title {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red);
  font-weight: 700;
  margin-bottom: .5rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid #222;
}
.mobile-menu-item {
  display: block;
  padding: .48rem .5rem;
  color: #9CA3AF;
  text-decoration: none;
  font-size: .875rem;
  border-radius: 6px;
  transition: all var(--transition);
}
.mobile-menu-item:hover { color: #fff; background: #1a1a1a; }
.mobile-menu-item.active { color: var(--red); font-weight: 600; }

/* ── admin mobile topbar ── */
.admin-mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #0E0E0E;
  z-index: 1100;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
}
.admin-menu-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.15rem;
  padding: .4rem .6rem;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}
.admin-menu-btn:hover { background: #1e1e1e; }
.admin-mobile-logo {
  flex: 1;
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
}
.admin-mobile-icon {
  color: #9CA3AF;
  font-size: 1.1rem;
  text-decoration: none;
  padding: .4rem .5rem;
}
.admin-mobile-icon:hover { color: #fff; }
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1099;
}
.admin-overlay--visible { display: block; }
.admin-sidebar--open {
  display: flex !important;
  transform: translateX(0) !important;
  box-shadow: 4px 0 24px rgba(0,0,0,.45);
}

/* ── responsive ── */
@media (max-width: 768px) {
  .admin-mobile-topbar { display: flex; }
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .admin-wrap { padding-top: 52px; }
  .admin-content { padding: 1rem; }
  .order-info-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .hero { display: none; }
  .hero h1 { font-size: 1.75rem; }
  .hero::before { font-size: 6rem; opacity: .4; right: -1.5rem; }
  .hero-inner { flex-direction: column; gap: 1.25rem; }
  .hero-cats { grid-template-rows: repeat(2, auto); gap: .35rem .5rem; }
  .checkout-steps { gap: .3rem; font-size: .75rem; }
  .checkout-steps .step { padding: .25rem .5rem; }
  /* keep sticky only when side-by-side (≥992px = Bootstrap lg) */
  .admin-card { overflow-x: auto; }
  .admin-table { min-width: 480px; }
  .product-detail-img { max-height: 260px; height: auto; }
  #productCarousel .carousel-inner { max-height: 260px !important; height: auto !important; }
  #productCarousel .carousel-item img { border-radius: 8px; }
  /* prevent iOS Safari from auto-zooming into inputs with font-size < 16px */
  input, select, textarea { font-size: 16px !important; }
  .delivery-options { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .delivery-option-card { padding: .65rem .75rem; }
  .delivery-option-logo { width: 32px; height: 32px; font-size: .7rem; }
  .delivery-option-name { font-size: .82rem; }
  .delivery-option-desc { font-size: .72rem; }
}

/* unstick sidebar cards when columns stack (Bootstrap lg = 992px) */
@media (max-width: 991px) {
  .checkout-summary { position: static; top: auto; margin-top: 1.5rem; }
  .profile-card { position: static; top: auto; margin-bottom: 1.5rem; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
  .product-body { padding: .75rem; }
  .product-name { font-size: .88rem; }
  .product-price { font-size: 1.05rem; }
  .hero { display: none; }
  .hero-cat-btn { text-align: center; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .checkout-card-body { padding: 1.25rem; }
  .order-hero { padding: 1.25rem; }
  .order-amount { font-size: 1.8rem; }
  .bank-box { padding: 1rem; }
  .section-divider { margin: 1rem 0; }
}

.product-brand-model {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  margin-bottom: .3rem;
  font-size: .8rem;
}
.product-brand-link {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.product-brand-link:hover { text-decoration: underline; }
.product-model {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.product-desc-block,
.brand-desc-block {
  background: var(--card-bg);
  border: 1px solid rgba(196,30,58,.22);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.brand-desc-icon {
  width: 40px;
  height: 40px;
  background: rgba(196,30,58,.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--red);
  font-size: 1.1rem;
}
.brand-desc-body {
  flex: 1;
  min-width: 0;
}
.brand-desc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}
.brand-desc-text {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: .9rem;
  white-space: pre-line;
  margin: 0;
}
.brand-models {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.brand-model-pill {
  display: inline-block;
  padding: .45rem 1.3rem;
  border: 1.5px solid rgba(196,30,58,.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--red);
  background: rgba(196,30,58,.06);
  transition: all var(--transition);
  white-space: nowrap;
}
.brand-model-pill:hover { color: #fff; border-color: var(--red); background: rgba(196,30,58,.7); }
.brand-model-pill.active { color: #fff; border-color: var(--red); background: var(--red); }
