:root {
  --bg: #f4f1f8;
  --card: rgba(255,255,255,.74);
  --card-strong: #ffffff;
  --text: #17151f;
  --muted: #6f6a7d;
  --line: rgba(99, 84, 140, .15);
  --primary: #a98cff;
  --primary-strong: #8f6fff;
  --shadow: 0 18px 55px rgba(34, 22, 63, 0.08);
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', sans-serif; color: var(--text); background: radial-gradient(circle at top left, #f7f4ff 0, #f3f1f8 38%, #f1eff6 100%); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }
button { cursor: pointer; }
.wrapper { width: min(1380px, calc(100% - 40px)); margin: 0 auto; }
.page-space { padding: 28px 0 56px; }
.eyebrow { font-size: .77rem; letter-spacing: .18em; font-weight: 800; color: #7f7399; }

.site-header { position: sticky; top: 12px; z-index: 30; display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 18px; padding: 14px 18px; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.8); backdrop-filter: blur(14px); border-radius: 999px; box-shadow: var(--shadow); }
.brand-pill { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, #111, #4d3d7e 58%, #b28cff); color: #fff; }
.brand-accent { color: #bb8bff; margin-left: 2px; }
.brand-pill small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.category-pills { display: flex; gap: 12px; overflow: auto; }
.pill-link, .search-pill, .button-primary, .button-secondary, .button-danger { border-radius: 999px; }
.pill-link { white-space: nowrap; padding: 13px 18px; background: rgba(245,242,252,.9); border: 1px solid var(--line); font-weight: 600; }
.pill-link.is-active, .pill-link:hover { background: #fff; box-shadow: 0 10px 24px rgba(80, 64, 120, .08); }
.search-pill { display: flex; align-items: center; gap: 10px; padding: 0 16px; width: min(320px, 100%); height: 54px; background: rgba(246,244,250,.92); border: 1px solid var(--line); }
.search-pill svg { width: 18px; color: var(--muted); }
.search-pill input { flex: 1; border: 0; background: transparent; outline: none; }

.hero-panel, .panel-card, .product-gallery-card, .detail-card, .stat-card, .product-card, .empty-state { background: var(--card); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); border-radius: var(--radius-xl); backdrop-filter: blur(12px); }
.hero-panel { display: grid; grid-template-columns: 1.1fr 1.3fr; gap: 24px; padding: 28px; }
.hero-copy h1, .section-head h1, .section-head h2, .detail-card h1 { margin: 10px 0 10px; line-height: 1.05; }
.hero-copy h1 { font-size: clamp(2.1rem, 4vw, 3.65rem); max-width: 720px; }
.hero-copy p, .section-head p, .detail-description, .product-body p { color: var(--muted); line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; }
.button-primary, .button-secondary, .button-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1px solid transparent; font-weight: 700; }
.button-primary { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff; }
.button-secondary { background: #fff; border-color: var(--line); }
.button-danger { background: #fff4f4; color: #b94c60; border-color: rgba(185, 76, 96, .2); }
.button-full { width: 100%; }
.button-xs { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.text-link { color: #6b54cf; font-weight: 700; }

.hero-grid, .cards-grid { display: grid; gap: 18px; }
.cards-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin: 34px 0 18px; }
.section-head--stacked { margin-top: 6px; }

.product-card { overflow: hidden; display: flex; flex-direction: column; }
.product-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.product-thumb img, .product-gallery-card img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb img { transition: transform .35s ease; }
.product-card:hover .product-thumb img { transform: scale(1.03); }
.product-badge, .discount-chip, .category-chip, .store-chip { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.product-badge { position: absolute; left: 14px; top: 14px; background: rgba(17,17,22,.76); color: #fff; }
.discount-chip { background: rgba(178, 140, 255, .15); color: #6e47e8; }
.product-thumb .discount-chip { position: absolute; right: 14px; top: 14px; background: #fff; }
.product-body { padding: 18px; }
.meta-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.category-chip { background: rgba(17,17,22,.93); color: #fff; }
.store-chip { background: #f0ebff; color: #6f4dea; }
.product-body h3 { margin: 0 0 10px; font-size: 1.26rem; }
.price-row { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-top: 18px; }
.price-old { display: block; color: #9d95af; text-decoration: line-through; font-size: .92rem; }
.price-current { font-size: 1.34rem; }
.price-current--lg { font-size: 2.4rem; }
.empty-state { padding: 30px; text-align: center; color: var(--muted); }

.product-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); gap: 24px; }
.product-gallery-card { overflow: hidden; min-height: 540px; }
.detail-card { padding: 24px; }
.detail-price-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.buy-list { display: grid; gap: 12px; }
.buy-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; background: #fff; border-radius: 18px; border: 1px solid var(--line); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(480px, 100%); padding: 30px; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.9); border-radius: 30px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.login-card label, .form-grid label { display: grid; gap: 8px; font-weight: 600; }
.login-card input, .form-grid input, .form-grid textarea, .form-grid select { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.88); outline: none; }
.form-grid textarea { min-height: 140px; resize: vertical; }

.admin-shell { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.admin-sidebar { padding: 24px; background: rgba(20,17,31,.96); color: #fff; display: flex; flex-direction: column; gap: 26px; }
.admin-brand { font-size: 1.4rem; font-weight: 800; }
.admin-brand span { color: #c8b0ff; }
.admin-sidebar nav { display: grid; gap: 10px; }
.admin-sidebar nav a { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.06); }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.12); }
.admin-main { padding: 28px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-user { background: rgba(255,255,255,.8); padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); }
.stats-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { padding: 22px; }
.stat-card span { color: var(--muted); display: block; margin-bottom: 10px; }
.stat-card strong { font-size: 2rem; }
.panel-card { padding: 22px; margin-top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.actions-row form { margin: 0; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
.checkbox-row { display: flex !important; align-items: center; gap: 12px; }
.checkbox-row input { width: 18px !important; min-height: auto !important; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.affiliate-section { background: rgba(255,255,255,.54); border-radius: 24px; padding: 18px; border: 1px dashed rgba(129, 98, 221, .28); }
.affiliate-row { display: grid; gap: 12px; grid-template-columns: 1fr 1.8fr auto auto; margin-bottom: 12px; align-items: center; }
.radio-inline { display: flex !important; align-items: center; gap: 8px; white-space: nowrap; }
.flash-stack { display: grid; gap: 10px; margin-bottom: 14px; }
.flash { padding: 14px 16px; border-radius: 16px; font-weight: 600; }
.flash-success { background: #eefbf2; color: #187546; }
.flash-danger { background: #fff1f3; color: #b53d62; }
.flash-info { background: #eef5ff; color: #2a5bb9; }
.flash-warning { background: #fff8eb; color: #946a11; }

.gc-widget, .gc-widget-grid { font-family: 'Inter', sans-serif; }
.gc-widget--sidebar { background: rgba(255,255,255,.9); border: 1px solid rgba(99,84,140,.12); border-radius: 24px; padding: 16px; box-shadow: 0 12px 30px rgba(30,24,49,.08); }
.gc-widget-title, .gc-widget-cat { display: block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #7b7090; font-weight: 800; }
.gc-widget-thumb { display: block; overflow: hidden; border-radius: 20px; margin: 12px 0; }
.gc-widget-thumb img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.gc-widget-body h3 { margin: 8px 0; font-size: 1.08rem; }
.gc-widget-body p { color: #6f6a7d; line-height: 1.55; }
.gc-widget-price { font-size: 1.3rem; font-weight: 800; margin: 14px 0; }
.gc-widget-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff; font-weight: 800; }
.gc-widget-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gc-widget-card { overflow: hidden; background: rgba(255,255,255,.95); border: 1px solid rgba(99,84,140,.12); border-radius: 24px; box-shadow: 0 12px 30px rgba(30,24,49,.08); }
.gc-widget-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gc-widget-copy { padding: 16px; }
.gc-widget-copy span { color: #7b7090; font-size: .82rem; font-weight: 700; }
.gc-widget-copy h3 { margin: 8px 0 10px; font-size: 1.1rem; }
.gc-widget-copy a { display: inline-flex; margin-top: 12px; font-weight: 700; color: #6f4dea; }

@media (max-width: 1180px) {
  .site-header { grid-template-columns: 1fr; border-radius: 28px; }
  .hero-panel, .product-layout, .admin-shell { grid-template-columns: 1fr; }
  .cards-grid--4, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid, .cards-grid--3, .gc-widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-sidebar { min-height: auto; }
}
@media (max-width: 760px) {
  .wrapper { width: min(100% - 24px, 100%); }
  .hero-grid, .cards-grid--3, .cards-grid--4, .stats-grid, .form-grid, .affiliate-row, .gc-widget-grid { grid-template-columns: 1fr; }
  .site-header { gap: 14px; }
  .section-head, .admin-topbar, .panel-head, .price-row { flex-direction: column; align-items: stretch; }
  .admin-main { padding: 20px; }
}

.category-nav { display: flex; gap: 16px; }
.category-item { position: relative; }
.subcategory-dropdown { position: absolute; top: 100%; left: 0; background: #111; border-radius: 12px; padding: 10px; display: none; flex-direction: column; min-width: 180px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.subcategory-dropdown a { padding: 8px 10px; border-radius: 8px; color: #fff; }
.subcategory-dropdown a:hover { background: #222; }
.category-item:hover .subcategory-dropdown { display: flex; }

.detail-description-wrap {
  margin-top: 10px;
  margin-bottom: 20px;
}

.detail-description {
  color: #6f6f82;
  font-size: 1.05rem;
  line-height: 1.75;
  transition: all 0.25s ease;
  white-space: pre-line;
}

.detail-description.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(1.75em * 3);
}

.detail-description.is-expanded {
  display: block;
  max-height: none;
}

.description-toggle {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: #6c4cff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}

.description-toggle:hover {
  opacity: 0.85;
}

.buy-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(30, 30, 45, 0.08);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.buy-option:hover {
  transform: translateY(-2px);
  border-color: rgba(108, 76, 255, 0.22);
  box-shadow: 0 14px 28px rgba(33, 24, 74, 0.08);
}

.buy-option-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.buy-store {
  font-size: 1.05rem;
  font-weight: 600;
  color: #222230;
}

.buy-option-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.buy-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #171722;
}

.buy-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6c4cff, #8a6bff);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .buy-option {
    align-items: flex-start;
    flex-direction: column;
  }

  .buy-option-right {
    width: 100%;
    justify-content: space-between;
  }
}