/* CigarPage Clone - Stylesheet */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #1a1a1a;
  --dark: #222;
  --red: #c8102e;
  --red-dark: #a00d24;
  --gray: #f5f5f5;
  --gray-border: #e0e0e0;
  --text: #333;
  --text-light: #777;
  --white: #fff;
  --green: #2e7d32;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.5;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Top Bar ===== */
.topbar {
  background: var(--black);
  color: var(--white);
  font-size: 12px;
  text-align: center;
  padding: 8px 0;
  letter-spacing: 1px;
}

.topbar span {
  text-transform: uppercase;
}

/* ===== Header ===== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}

.logo {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--black);
  white-space: nowrap;
}

.logo .star {
  color: var(--red);
}

.logo small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-light);
}

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 11px 44px 11px 16px;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--black);
}

.search-box button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.header-action svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Main Nav ===== */
.main-nav {
  background: var(--black);
  border-top: 1px solid #333;
}

.main-nav .container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--white);
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: block;
  transition: background 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--red);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #2b2b2b 0%, #0d0d0d 100%);
  color: var(--white);
  text-align: center;
  padding: 60px 20px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(200,16,46,0.25), transparent 60%);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero p {
  font-size: 17px;
  color: #ccc;
  max-width: 640px;
  margin: 0 auto 24px;
}

.hero .btn {
  background: var(--red);
  color: var(--white);
  padding: 14px 34px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-block;
  border-radius: 2px;
  transition: background 0.15s;
}

.hero .btn:hover {
  background: var(--red-dark);
}

/* ===== Section ===== */
.section {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 30px;
}

.section-title h2 {
  font-size: 26px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title .sub {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.section-title .sub a {
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
}

/* ===== Brands Strip ===== */
.brands-strip {
  background: var(--gray);
  padding: 28px 0;
  text-align: center;
}

.brands-strip .label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  max-width: 1000px;
  margin: 0 auto;
}

.brand-tile {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 3px;
  padding: 16px 8px;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  text-align: center;
}

.brand-tile:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ===== Product Grid ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 3px;
  overflow: hidden;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: #ccc;
}

.product-card .img-wrap {
  position: relative;
  background: #fafafa;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.only-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 2px;
}

.product-card .info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card .title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--text);
  min-height: 38px;
}

.product-card .title:hover {
  color: var(--red);
}

.price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price-now {
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
}

.price-was {
  font-size: 14px;
  color: var(--text-light);
  text-decoration: line-through;
}

.badge-save {
  background: var(--green);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}

/* ===== Instagram Section ===== */
.ig-section {
  background: var(--black);
  color: var(--white);
  padding: 40px 0;
  text-align: center;
}

.ig-section h2 {
  font-size: 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.ig-section .handle {
  color: var(--red);
  font-size: 14px;
  margin-bottom: 24px;
  display: block;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px;
}

.ig-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #333;
}

.ig-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.ig-tile:hover img {
  transform: scale(1.06);
}

.ig-tile .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--white);
  font-size: 12px;
  padding: 10px;
  text-align: center;
}

.ig-tile:hover .overlay {
  opacity: 1;
}

/* ===== Footer ===== */
.site-footer {
  background: #111;
  color: #aaa;
  padding: 40px 0 0;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  padding-bottom: 30px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
  font-size: 13px;
}

.footer-col a:hover {
  color: var(--white);
}

.newsletter input {
  width: 100%;
  padding: 10px;
  background: #222;
  border: 1px solid #333;
  color: var(--white);
  font-size: 13px;
  margin-bottom: 8px;
  border-radius: 2px;
}

.newsletter button {
  width: 100%;
  padding: 10px;
  background: var(--red);
  color: var(--white);
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
}

.newsletter button:hover {
  background: var(--red-dark);
}

.footer-bottom {
  border-top: 1px solid #2a2a2a;
  padding: 18px 0;
  text-align: center;
  font-size: 12px;
  color: #777;
}

/* ===== Page Banner ===== */
.page-banner {
  background: var(--gray);
  padding: 24px 0;
  text-align: center;
  border-bottom: 1px solid var(--gray-border);
}

.page-banner h1 {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Brands List Page ===== */
.brands-list .brand-group {
  margin-bottom: 30px;
}

.brands-list .brand-group h3 {
  font-size: 18px;
  font-weight: 800;
  border-bottom: 2px solid var(--red);
  padding-bottom: 6px;
  margin-bottom: 12px;
  display: inline-block;
}

.brands-list .brand-group ul {
  list-style: none;
  columns: 3;
  column-gap: 24px;
}

.brands-list .brand-group li {
  margin-bottom: 6px;
  font-size: 14px;
}

.brands-list .brand-group a:hover {
  color: var(--red);
}

/* ===== Product Detail ===== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 30px 0;
}

.product-gallery .main-img {
  background: #fafafa;
  border: 1px solid var(--gray-border);
  border-radius: 3px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.product-gallery .main-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 30px;
}

.product-info h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.3;
}

.product-info .brand-link {
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  display: inline-block;
}

.product-info .meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 14px;
}

.product-info .meta span {
  margin-right: 14px;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.detail-price-row .now {
  font-size: 32px;
  font-weight: 900;
  color: var(--red);
}

.detail-price-row .was {
  font-size: 18px;
  color: var(--text-light);
  text-decoration: line-through;
}

.detail-price-row .save {
  background: var(--green);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 2px;
  text-transform: uppercase;
}

.product-info .description {
  font-size: 14px;
  color: #555;
  line-height: 1.65;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--gray);
  border-radius: 3px;
}

.add-cart-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.qty-select {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  overflow: hidden;
}

.qty-select button {
  width: 38px;
  height: 44px;
  background: var(--white);
  border: none;
  font-size: 18px;
  cursor: pointer;
  font-weight: 700;
}

.qty-select button:hover {
  background: var(--gray);
}

.qty-select input {
  width: 50px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--gray-border);
  border-right: 1px solid var(--gray-border);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  outline: none;
}

.btn-cart {
  flex: 1;
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 0 30px;
  height: 44px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}

.btn-cart:hover {
  background: var(--red-dark);
}

.stock-note {
  font-size: 13px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 20px;
}

.stock-note.low {
  color: #d97706;
}

/* Related products */
.related {
  padding: 30px 0 50px;
}

.related h2 {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ===== Cart Page ===== */
.cart-page {
  padding: 30px 0;
}

.cart-page h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 20px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--black);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--gray-border);
  vertical-align: middle;
}

.cart-table .cart-product {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-table .cart-product img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #fafafa;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
}

.cart-table .cart-product .name {
  font-weight: 600;
  font-size: 14px;
}

.cart-table .cart-product .name:hover {
  color: var(--red);
}

.cart-summary {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.summary-box {
  width: 320px;
  background: var(--gray);
  padding: 22px;
  border-radius: 3px;
}

.summary-box .row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.summary-box .total {
  border-top: 1px solid var(--gray-border);
  padding-top: 12px;
  margin-top: 12px;
  font-size: 20px;
  font-weight: 800;
}

.summary-box .total .price {
  color: var(--red);
}

.summary-box .btn-cart {
  width: 100%;
  margin-top: 14px;
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-cart a {
  color: var(--red);
  font-weight: 700;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 18px;
}

.remove-btn:hover {
  color: var(--red);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--black);
  color: var(--white);
  padding: 14px 22px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--green);
}

.toast.error {
  background: var(--red);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-main {
    flex-wrap: wrap;
  }
  .search-box {
    order: 3;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .hero h1 {
    font-size: 30px;
  }
  .main-nav .container {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .main-nav a {
    padding: 12px 14px;
    font-size: 12px;
    white-space: nowrap;
  }
  .product-detail {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .brands-list .brand-group ul {
    columns: 1;
  }
  .cart-table th:nth-child(3),
  .cart-table td:nth-child(3) {
    display: none;
  }
  .summary-box {
    width: 100%;
  }
}

/* ===== Admin Panel ===== */
.admin-login {
  max-width: 380px;
  margin: 60px auto;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 4px;
}

.admin-login h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-login .field {
  margin-bottom: 16px;
}

.admin-login label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text-light);
}

.admin-login input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
}

.admin-login input:focus {
  border-color: var(--black);
}

.admin-login button {
  width: 100%;
  padding: 12px;
  background: var(--black);
  color: var(--white);
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
}

.admin-login button:hover {
  background: var(--red);
}

.admin-login .error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-bottom: 14px;
}

.admin-login .hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 16px;
  padding: 10px;
  background: var(--gray);
  border-radius: 2px;
}

/* Admin layout */
.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--black);
  color: var(--white);
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .brand {
  padding: 0 20px 20px;
  font-size: 20px;
  font-weight: 900;
  border-bottom: 1px solid #333;
  margin-bottom: 12px;
}

.admin-sidebar .brand small {
  display: block;
  font-size: 10px;
  color: var(--red);
  letter-spacing: 1px;
  font-weight: 400;
}

.admin-sidebar a {
  display: block;
  padding: 12px 20px;
  color: #bbb;
  font-size: 14px;
  font-weight: 600;
  border-left: 3px solid transparent;
}

.admin-sidebar a:hover {
  background: #1a1a1a;
  color: var(--white);
}

.admin-sidebar a.active {
  background: #1a1a1a;
  color: var(--white);
  border-left-color: var(--red);
}

.admin-sidebar .logout {
  margin-top: 20px;
  border-top: 1px solid #333;
  padding-top: 12px;
}

.admin-content {
  padding: 24px 28px;
  background: #f0f0f0;
}

.admin-content h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--white);
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--gray-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.stat-card .label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 900;
  color: var(--black);
  margin-top: 6px;
}

.stat-card .value.red { color: var(--red); }
.stat-card .value.green { color: var(--green); }

/* Admin table */
.admin-panel {
  background: var(--white);
  border-radius: 4px;
  border: 1px solid var(--gray-border);
  overflow: hidden;
}

.admin-panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-panel-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.btn-add {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 2px;
}

.btn-add:hover {
  background: var(--red-dark);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gray);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  font-weight: 700;
}

.admin-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-border);
  font-size: 13px;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #fafafa;
}

.admin-table img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
}

.admin-table .row-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: none;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-light);
}

.btn-icon:hover {
  border-color: var(--black);
  color: var(--black);
}

.btn-icon.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Modal/form */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 4px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
}

.modal-body {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field {
  margin-bottom: 0;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 5px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--black);
}

.form-field textarea {
  min-height: 80px;
  resize: vertical;
}

.form-field .checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  font-weight: 400;
}

.form-field .checkbox input {
  width: auto;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 产品表单增强：必填标记 / 图片预览 / 预设图库 / 校验提示 ===== */
.form-grid .req {
  color: var(--red);
  margin-left: 2px;
}

.img-preview {
  margin-top: 8px;
  width: 100%;
  height: 140px;
  border: 1px dashed var(--gray-border);
  border-radius: 2px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.img-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.img-preview .ph {
  color: var(--text-light);
  font-size: 13px;
}

/* 上传区 + 拖拽 */
.upload-zone {
  border: 2px dashed var(--gray-border);
  border-radius: 2px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--red);
  background: #fff5f5;
}

.upload-zone.drag-over {
  background: #fff0f0;
  border-style: solid;
}

.upload-zone-inner {
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
}

.upload-zone-inner svg {
  color: var(--text-light);
  margin-bottom: 4px;
}

.upload-zone-inner span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.upload-zone-inner small {
  font-size: 11px;
  color: var(--text-light);
}

.upload-zone:hover .upload-zone-inner svg,
.upload-zone.drag-over .upload-zone-inner svg {
  color: var(--red);
}

.upload-progress {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
}

.upload-progress.progress {
  background: #eef5ff;
  border: 1px solid #bcd5ff;
  color: #1a5fb4;
}

.upload-progress.success {
  background: #e3f2e3;
  border: 1px solid #a5d6a7;
  color: #2e7d32;
}

.upload-progress.error {
  background: #fff5f5;
  border: 1px solid #ffd5d5;
  color: var(--red);
}

.preset-gallery {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.preset-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.preset-thumb:hover {
  border-color: var(--red);
  transform: scale(1.05);
}

@media (max-width: 700px) {
  .preset-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

.form-msg {
  grid-column: 1 / -1;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 2px;
  display: none;
  min-height: 0;
}

.form-msg.info {
  display: block;
  background: #eef5ff;
  border: 1px solid #bcd5ff;
  color: #1a5fb4;
}

.form-msg.error {
  display: block;
  background: #fff5f5;
  border: 1px solid #ffd5d5;
  color: var(--red);
}

.btn-secondary {
  background: var(--gray);
  color: var(--text);
  border: 1px solid var(--gray-border);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
}

.btn-primary:hover {
  background: var(--red-dark);
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    height: auto;
    position: relative;
  }
  .admin-sidebar a {
    display: inline-block;
    padding: 10px 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Member Auth Pages ===== */
.auth-page {
  max-width: 420px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 32px;
}

.auth-page h1 {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.auth-page .auth-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 22px;
}

.auth-page .field {
  margin-bottom: 16px;
}

.auth-page label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text-light);
}

.auth-page label .req {
  color: var(--red);
}

.auth-page input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.auth-page input:focus {
  border-color: var(--black);
}

.auth-page button {
  width: 100%;
  padding: 12px;
  background: var(--red);
  color: var(--white);
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 2px;
  font-size: 14px;
  margin-top: 6px;
}

.auth-page button:hover {
  background: var(--red-dark);
}

.auth-page .error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-bottom: 14px;
  background: #fff5f5;
  border: 1px solid #ffd5d5;
  padding: 10px;
  border-radius: 2px;
}

.auth-page .auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-border);
}

.auth-page .auth-foot a {
  color: var(--red);
  font-weight: 700;
}

/* ===== Account Page ===== */
.account-page {
  padding: 30px 0 60px;
}

.account-page .acc-status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
  display: inline-block;
}
.account-page .acc-paid { background:#fff3cd; color:#856404; }
.account-page .acc-shipped { background:#cce5ff; color:#004085; }
.account-page .acc-completed { background:#e3f2e3; color:#2e7d32; }
.account-page .acc-cancelled { background:#fce4e4; color:#c62828; }

.account-page h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.account-page .welcome {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.account-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.account-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 22px;
}

.account-card h2 {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 8px;
  display: inline-block;
}

.account-card .field {
  margin-bottom: 14px;
}

.account-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 4px;
}

.account-card .field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
}

.account-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-nav a {
  display: block;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
}

.account-nav a:hover {
  border-color: var(--red);
  color: var(--red);
}

.account-nav a.logout {
  color: var(--red);
}

.empty-orders {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-orders a {
  color: var(--red);
  font-weight: 700;
}

@media (max-width: 768px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 在线客服组件 ===== */
.chat-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 999;
}

.chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  position: relative;
}

.chat-toggle:hover {
  background: var(--red-dark);
  transform: scale(1.06);
}

.chat-toggle svg {
  width: 27px;
  height: 27px;
}

.chat-toggle .chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.chat-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 44px);
  height: 460px;
  max-height: calc(100vh - 130px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--gray-border);
}

.chat-head {
  background: var(--black);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-head strong {
  font-size: 15px;
}

.chat-status {
  display: block;
  font-size: 11px;
  color: #6ec56e;
  margin-top: 2px;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.agent {
  background: #fff;
  border: 1px solid var(--gray-border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-msg.guest {
  background: var(--red);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chat-msg .time {
  display: block;
  font-size: 10px;
  color: #999;
  margin-top: 3px;
}

.chat-msg.guest .time {
  color: rgba(255,255,255,0.8);
}

.chat-form {
  border-top: 1px solid var(--gray-border);
  padding: 12px;
  background: #fff;
}

.chat-intro input {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--gray-border);
  border-radius: 3px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  font-family: inherit;
}

.chat-intro input:focus {
  border-color: var(--black);
}

.chat-intro .btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 13.5px;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 80px;
}

.chat-input-row textarea:focus {
  border-color: var(--black);
}

.chat-input-row button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-input-row button:hover {
  background: var(--red-dark);
}

.chat-input-row svg {
  width: 18px;
  height: 18px;
}

.chat-typing {
  font-size: 12px;
  color: #999;
  align-self: flex-start;
  padding: 4px 8px;
}

@media (max-width: 480px) {
  .chat-panel {
    right: -22px;
    width: calc(100vw);
  }
  .chat-widget {
    bottom: 16px;
    right: 16px;
  }
}

/* ===== 语言切换器 ===== */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  overflow: hidden;
  margin-left: 8px;
  vertical-align: middle;
}

.lang-switch a {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  background: #fff;
  text-decoration: none;
  line-height: 1.4;
}

.lang-switch a.active {
  background: var(--black);
  color: #fff;
}

.lang-switch a:hover:not(.active) {
  background: #f0f0f0;
  color: var(--black);
}


/* ========== CMS 内容页 & 订单查询 ========== */
.static-page {
  max-width: 860px;
  padding: 40px 20px 60px;
}

.static-page .page-head {
  border-bottom: 2px solid var(--black);
  padding-bottom: 14px;
  margin-bottom: 26px;
}

.static-page .page-head h1 {
  font-size: 30px;
  margin-bottom: 6px;
}

.static-page .page-sub {
  color: var(--text-light);
  font-size: 14px;
  margin: 0;
}

.static-page .page-updated {
  font-size: 12px;
  color: var(--text-light);
}

.static-page .page-content {
  font-size: 15px;
  line-height: 1.9;
}

.static-page .page-content h3 {
  font-size: 18px;
  margin: 26px 0 10px;
}

.static-page .page-content p,
.static-page .page-content ul,
.static-page .page-content ol {
  margin-bottom: 12px;
}

.static-page .page-content ul,
.static-page .page-content ol {
  padding-left: 22px;
}

.static-page .page-content li {
  margin-bottom: 6px;
}

.static-page .page-content a {
  color: var(--red);
  font-weight: 700;
}

/* 订单查询表单 */
.lookup-form {
  max-width: 460px;
  background: #fafafa;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 30px;
}

.lookup-form .form-group {
  margin-bottom: 14px;
}

.lookup-form label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.lookup-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 2px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.lookup-form input:focus {
  border-color: var(--black);
}

.lookup-error {
  max-width: 460px;
  background: #fce4e4;
  border: 1px solid #f5c6c6;
  color: var(--red);
  padding: 10px 14px;
  border-radius: 2px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* 查询结果 */
.lookup-result h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

.lookup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lookup-table th {
  width: 120px;
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--gray-border);
  color: var(--text-light);
  font-weight: 700;
  white-space: nowrap;
}

.lookup-table td {
  padding: 10px 12px;
  border: 1px solid var(--gray-border);
}

.lookup-ship-time {
  font-size: 12px;
  color: var(--text-light);
}

.lookup-note {
  margin-top: 14px;
}

.lookup-note a {
  color: var(--red);
  font-weight: 700;
}

/* 全局状态标签（订单查询页复用） */
.status-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-tag.pending { background: #e3f0ff; color: #0d47a1; }
.status-tag.paid { background: #fff3cd; color: #856404; }
.status-tag.shipped { background: #cce5ff; color: #004085; }
.status-tag.completed { background: #e3f2e3; color: #2e7d32; }
.status-tag.cancelled { background: #fce4e4; color: #c62828; }

@media (max-width: 640px) {
  .lookup-table th { width: 88px; }
}


/* ========== 微信客服悬浮按钮 & 弹窗 ========== */
.wechat-fab {
  position: fixed;
  right: 22px;
  bottom: 92px; /* 在线客服按钮（58px + bottom 22px）正上方 */
  z-index: 900;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07C160;
  color: #fff;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(7, 193, 96, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.wechat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(7, 193, 96, 0.55);
}

.wechat-fab svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* 悬停时在按钮左侧显示文字标签 */
.wechat-fab-text {
  display: none;
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: #222;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.wechat-fab-text::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left-color: #222;
}

.wechat-fab:hover .wechat-fab-text {
  display: block;
}

/* 弹窗 */
.wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.wechat-modal-card {
  position: relative;
  background: #fff;
  border-radius: 10px;
  width: min(360px, calc(100vw - 40px));
  padding: 24px 22px 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.wechat-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #999;
  cursor: pointer;
}

.wechat-modal-close:hover { color: #333; }

.wechat-modal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.wechat-modal-head svg { width: 30px; height: 30px; }
.wechat-modal-head strong { font-size: 18px; display: block; text-align: left; }

.wechat-online {
  font-size: 11px;
  color: #07C160;
  font-weight: 700;
}

.wechat-note {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  margin: 0 0 14px;
}

.wechat-qr img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border: 1px solid var(--gray-border, #e5e5e5);
  border-radius: 6px;
  background: #fafafa;
}

.wechat-qr-tip {
  font-size: 12px;
  color: #999;
  margin: 6px 0 12px;
}

.wechat-id-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wechat-id-label { font-size: 13px; color: #888; }

.wechat-id {
  font-family: Consolas, Monaco, monospace;
  font-size: 15px;
  font-weight: 700;
  background: #f2f7f3;
  border: 1px dashed #07C160;
  color: #0a7d40;
  border-radius: 4px;
  padding: 5px 12px;
  user-select: all;
}

.wechat-copy {
  font-size: 13px;
  padding: 7px 16px;
  background: #07C160;
  border: none;
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.wechat-copy:hover { background: #06ad56; }
.wechat-copy:disabled { background: #9fdcb8; cursor: default; }

.wechat-steps {
  text-align: left;
  font-size: 12px;
  color: #999;
  padding-left: 20px;
  margin: 0;
  line-height: 1.9;
  border-top: 1px dashed var(--gray-border, #e5e5e5);
  padding-top: 12px;
}

@media (max-width: 640px) {
  .wechat-fab { right: 16px; bottom: 86px; } /* 在线客服（16px+58px）正上方 */
  .wechat-fab-text { display: none; }
}


/* 微信客服弹窗：进入对话按钮 & 打开微信 */
.wechat-enter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #07C160;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 14px;
  transition: background 0.15s;
}

.wechat-enter-btn:hover { background: #06ad56; }
.wechat-enter-btn:visited { color: #fff; }
.wechat-enter-icon { width: 20px; height: 20px; fill: currentColor; }

.wechat-open {
  background: #07C160;
}

.wechat-open:hover { background: #06ad56; }

.wechat-open-tip {
  font-size: 12px;
  color: #07C160;
  background: #f0faf4;
  border: 1px solid #bfe8cf;
  border-radius: 4px;
  padding: 7px 10px;
  margin: 0 0 12px;
  line-height: 1.6;
}

/* ========== 移动端适配补丁（手机端排版优化） ========== */
@media (max-width: 900px) {
  /* 后台栅格：1fr 改 minmax(0,1fr)，防止内容 min-width 撑破轨道（修复手机端后台横向溢出 308px） */
  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-content {
    min-width: 0;
    overflow-x: auto;
  }
  .status-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  /* 顶栏：允许换行，避免长文案挤压 */
  .topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 10px;
    padding: 6px 10px;
    font-size: 11px;
  }
  /* 顶部：压缩 logo 与操作区宽度，避免首行溢出 */
  .header-main {
    gap: 12px;
    padding: 10px 0;
  }
  .logo {
    font-size: 20px;
  }
  .logo small {
    font-size: 9px;
    letter-spacing: 1.5px;
  }
  .header-actions {
    gap: 12px;
  }
  /* 购物车角标 right:-4px 会超出贴边图标 4px 导致页面横向溢出 */
  .cart-link {
    margin-right: 6px;
  }
  .header-action {
    font-size: 10px;
  }
  .header-action svg {
    width: 20px;
    height: 20px;
  }
  /* 首屏与区块间距收紧 */
  .hero {
    padding: 40px 16px;
  }
  .hero h1 {
    font-size: 26px;
  }
  .hero p {
    font-size: 15px;
  }
  .section {
    padding: 28px 0;
  }
  .section-title h2 {
    font-size: 21px;
  }
  /* Instagram 图墙：手机固定 2 列，避免单列过大 */
  .ig-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* 商品详情：加购行允许换行，按钮占满剩余宽度 */
  .add-cart-row {
    flex-wrap: wrap;
  }
  .add-cart-row .btn-cart {
    flex: 1 1 auto;
  }
  .product-gallery .main-img img {
    padding: 16px;
  }
  /* 购物车表格：容器内横向滚动，不撑破页面 */
  .cart-page {
    overflow-x: auto;
  }
  .cart-table {
    min-width: 560px;
  }
  .cart-table .cart-product img {
    width: 54px;
    height: 54px;
  }
  /* 后台表格：面板内横向滚动 */
  .admin-panel {
    overflow-x: auto;
  }
  .admin-table {
    min-width: 640px;
  }
  .admin-panel-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  /* 订单查询结果表 */
  .lookup-result {
    overflow-x: auto;
  }
  /* 提示浮层：小屏两侧留边 */
  .toast {
    left: 16px;
    right: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  /* 商品栅格：小屏 2 列更紧凑（原 minmax(240px) 在手机上只有 1 列且图过大） */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-card .img-wrap img {
    padding: 8px;
  }
  .brand-tile {
    min-height: 50px;
    padding: 10px 4px;
    font-size: 12px;
  }
  .product-info h1 {
    font-size: 20px;
  }
  .detail-price-row .now {
    font-size: 26px;
  }
  .cart-page h1 {
    font-size: 22px;
  }
  .static-page .page-head h1 {
    font-size: 24px;
  }
  .auth-page {
    margin: 20px 12px;
    padding: 24px 18px;
  }
}

/* ========== 手机版：首页顶栏与操作区整体右移补丁 ========== */
@media (max-width: 768px) {
  /* 顶栏：欢迎文本靠左，语言切换器贴到最右 */
  .topbar {
    justify-content: space-between;
    text-align: left;
  }
  .topbar > span:first-child {
    flex: 1 1 auto;
  }
  .topbar .lang-switch {
    margin-left: 0;
  }

  /* 头部主行：压缩 logo 占比，header-actions 整块贴右（覆盖 justify-content: space-between 下的默认分配） */
  .header-main {
    justify-content: flex-start;
  }
  .header-main .logo {
    flex: 0 0 auto;
    margin-right: auto;
  }
  .header-main .header-actions {
    margin-left: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  /* 小屏进一步收紧顶栏内边距，保证右侧贴边无浪费 */
  .topbar {
    padding: 5px 8px;
    gap: 2px 6px;
  }
  .header-main {
    padding: 8px 0;
  }
  .header-actions {
    gap: 10px;
  }
}

/* ========== 手机版二次补丁：立即注册排到购物车之后，语言切换器对齐到"立即注册"正上方 ========== */
@media (max-width: 768px) {
  /* 1) header-actions 内用 flex order 重排（不改 DOM）：品牌 → 购物车 → 立即注册/登录 */
  .header-actions .header-action:nth-child(2) { order: 1; } /* 品牌 */
  .header-actions .cart-link { order: 2; }                   /* 我的购物车 */
  .header-actions .header-action:nth-child(1) { order: 3; } /* 立即注册/登录 → 最右 */

  /* 2) 顶栏左右内边距与 .container(16px) 对齐，语言切换器右缘 = 立即注册右缘，
        即"中文/EN"正好位于"立即注册"正上方 */
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  /* 小屏保持 16px 水平内边距（覆盖上方补丁的 8px），语言切换器继续对齐注册正上方 */
  .topbar {
    padding: 5px 16px;
  }
}
