/* ================================================
   VideoMart — TikTok-style shoppable video shop
   Dark theme · Mobile-first · Pink accent
   ================================================ */

:root {
  --bg: #0a0a0a;
  --bg-soft: #161616;
  --bg-card: #1c1c1c;
  --bg-elev: #242424;
  --text: #f5f5f5;
  --text-soft: #a8a8a8;
  --text-dim: #6e6e6e;
  --accent: #ff2d6b;
  --accent-soft: #ff6b9a;
  --accent-bg: rgba(255, 45, 107, 0.12);
  --line-green: #06c755;
  --line-green-dark: #05b34c;
  --yellow: #ffd400;
  --border: #2a2a2a;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --radius-sm: 8px;
  --topbar-h: 52px;
  --tabbar-h: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Prompt', 'Sarabun', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--text-soft); font-size: 12px; }
.hint { color: var(--text-dim); font-size: 11px; margin-top: 6px; }
.hint code { background: var(--bg-elev); padding: 2px 6px; border-radius: 4px; color: var(--accent-soft); }

/* ============ APP SHELL ============ */
#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  max-width: 540px; margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

/* ============ TOP BAR ============ */
#topbar {
  position: relative; z-index: 30;
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: white; font-size: 12px;
  box-shadow: 0 2px 8px rgba(255, 45, 107, 0.4);
}
.brand-name { font-size: 16px; letter-spacing: 0.2px; }
.brand-actions { display: flex; align-items: center; gap: 4px; position: relative; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px; position: relative;
  transition: background 0.15s;
}
.iconbtn:active { background: var(--bg-elev); transform: scale(0.95); }
.iconbtn-phone {
  background: var(--line-green);
  color: white;
  text-decoration: none;
  animation: pulse-phone 2.5s ease-in-out infinite;
}
.iconbtn-phone:active { background: var(--line-green-dark); transform: scale(0.95); }
@keyframes pulse-phone {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 199, 85, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(6, 199, 85, 0); }
}
.cart-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: grid; place-items: center;
  transform: scale(0);
  transition: transform 0.2s;
}
.cart-badge.show { transform: scale(1); }

/* ============ TAB BAR ============ */
#tabbar {
  position: relative; z-index: 20;
  height: var(--tabbar-h);
  flex-shrink: 0;
  display: flex;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1;
  font-size: 13px; font-weight: 500;
  color: var(--text-soft);
  position: relative;
  transition: color 0.15s;
}
.tab.active { color: var(--text); font-weight: 600; }
.tab.active::after {
  content: ''; position: absolute;
  left: 50%; bottom: 6px; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px;
  background: var(--accent);
}
.cart-count {
  display: inline-block;
  font-size: 10px;
  background: var(--accent);
  color: white;
  padding: 0 5px; min-width: 16px;
  height: 16px; line-height: 16px;
  border-radius: 8px; margin-left: 2px;
  vertical-align: middle;
  font-weight: 700;
}
.cart-count:empty, .cart-count[data-zero="true"] { display: none; }

/* ============ MAIN ============ */
#main { flex: 1; overflow: hidden; position: relative; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ============ FEED VIEW (TikTok-style) ============ */
.view-feed { background: #000; }
.feed-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.feed-slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: #000;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.35s;
  opacity: 0; transform: translateY(100%);
  pointer-events: none;
}
.feed-slide.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.feed-slide.prev { transform: translateY(-100%); }
.feed-slide.next { transform: translateY(100%); }

.feed-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
.feed-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.feed-slide video::-webkit-media-controls { display: none; }

/* Gradient overlays for readability */
.feed-grad-top, .feed-grad-bottom {
  position: absolute; left: 0; right: 0;
  pointer-events: none; z-index: 1;
}
.feed-grad-top { top: 0; height: 80px; background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent); }
.feed-grad-bottom { bottom: 0; height: 280px; background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); }

/* Mute button (top right) */
.feed-mute {
  position: absolute; top: 16px; right: 12px;
  z-index: 5;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  color: white; font-size: 16px;
  border: 1px solid rgba(255,255,255,0.15);
}
.feed-mute:active { transform: scale(0.92); }

/* Right side action bar */
.feed-actions {
  position: absolute; right: 8px; bottom: 220px;
  z-index: 5;
  display: flex; flex-direction: column;
  gap: 16px;
  align-items: center;
}
.feed-action {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  color: white;
  font-size: 11px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  transition: transform 0.15s;
}
.feed-action:active { transform: scale(0.85); }
.feed-action .icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  font-size: 22px;
  border: 1.5px solid rgba(255,255,255,0.2);
}
.feed-action .icon.liked { color: var(--accent); border-color: var(--accent); }
.feed-action .count { font-size: 11px; font-weight: 600; min-height: 14px; }

/* Bottom product info */
.feed-info {
  position: absolute; left: 12px; right: 70px; bottom: 16px;
  z-index: 5;
  color: white;
}
.feed-shop {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.feed-shop .verified { color: var(--accent-soft); font-size: 12px; }
.feed-desc {
  font-size: 13px; line-height: 1.4;
  margin-bottom: 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-product {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.feed-product:active { background: rgba(255,255,255,0.18); }
.feed-product img {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.feed-product-info { flex: 1; min-width: 0; }
.feed-product-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-product-price {
  font-size: 14px; font-weight: 700;
  color: var(--yellow);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.feed-product-go {
  font-size: 12px; color: var(--accent-soft);
  font-weight: 600;
}

.feed-buttons {
  display: flex; gap: 6px;
}
.feed-btn {
  flex: 1;
  padding: 9px 4px;
  border-radius: 10px;
  font-size: 12px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none;
  transition: transform 0.15s, filter 0.15s;
  line-height: 1.1;
}
.feed-btn:active { transform: scale(0.95); }
.feed-btn .fb-icon { font-size: 18px; line-height: 1; }
.feed-btn .fb-label { font-size: 11px; }
.feed-btn-cart {
  background: rgba(255,255,255,0.95);
  color: #111;
}
.feed-btn-call {
  background: var(--line-green);
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.45);
  animation: pulse-call 2.5s ease-in-out infinite;
}
@keyframes pulse-call {
  0%, 100% { box-shadow: 0 2px 8px rgba(6, 199, 85, 0.45); }
  50% { box-shadow: 0 2px 14px rgba(6, 199, 85, 0.8); }
}
.feed-btn-web {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.feed-btn-line {
  background: #06c755;
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.35);
}
.feed-btn-affiliate {
  background: linear-gradient(135deg, #ee4d2d 0%, #d73211 100%);
  color: white;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(238, 77, 45, 0.55);
  animation: pulse-affiliate 2.5s ease-in-out infinite;
}
@keyframes pulse-affiliate {
  0%, 100% { box-shadow: 0 2px 12px rgba(238, 77, 45, 0.55); }
  50% { box-shadow: 0 4px 22px rgba(238, 77, 45, 0.9); }
}
.feed-btn-line::before {
  content: ''; width: 18px; height: 18px;
  background: white;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016a.63.63 0 0 1-.629.628.62.62 0 0 1-.504-.252l-2.443-3.317v2.94a.629.629 0 1 1-1.257 0V8.108a.628.628 0 0 1 1.131-.378l2.442 3.317V8.108a.628.628 0 1 1 1.257 0v4.771h.003zm-5.741 0a.629.629 0 1 1-1.257 0V8.108a.629.629 0 1 1 1.257 0v4.771zm-2.466.629H4.917a.624.624 0 0 1-.626-.629V8.108a.625.625 0 1 1 1.249 0v4.141h1.755a.627.627 0 0 1 .629.63.625.625 0 0 1-.629.629zM24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016a.63.63 0 0 1-.629.628.62.62 0 0 1-.504-.252l-2.443-3.317v2.94a.629.629 0 1 1-1.257 0V8.108a.628.628 0 0 1 1.131-.378l2.442 3.317V8.108a.628.628 0 1 1 1.257 0v4.771h.003zm-5.741 0a.629.629 0 1 1-1.257 0V8.108a.629.629 0 1 1 1.257 0v4.771zm-2.466.629H4.917a.624.624 0 0 1-.626-.629V8.108a.625.625 0 1 1 1.249 0v4.141h1.755a.627.627 0 0 1 .629.63.625.625 0 0 1-.629.629zM24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"/></svg>') center/contain no-repeat;
}

.feed-hint {
  position: absolute; left: 50%; bottom: 170px;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  background: rgba(0,0,0,0.5);
  padding: 4px 12px;
  border-radius: 12px;
  pointer-events: none;
  z-index: 6;
  animation: pulse 1.5s ease-in-out infinite;
  white-space: nowrap;
}
.feed-hint.fade { animation: fadeout 0.5s forwards; }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes fadeout { to { opacity: 0; transform: translate(-50%, 10px); } }

/* ============ SHOP VIEW ============ */
.view-shop { background: var(--bg); overflow-y: auto; }
.shop-banner {
  position: relative;
  height: 220px;
  margin: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.banner-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, #ff6b9a 50%, #ff9a5a 100%);
  filter: saturate(1.1);
}
.shop-banner::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.2) 0%, transparent 50%);
}
.banner-content {
  position: absolute; inset: 0;
  padding: 16px 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: white;
}
.banner-shop { font-size: 22px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.banner-tag { font-size: 12px; opacity: 0.95; margin-top: 2px; }
.banner-stats {
  display: flex; gap: 16px;
  margin-top: 8px;
}
.banner-stats > div {
  display: flex; flex-direction: column;
  font-size: 11px;
  background: rgba(0,0,0,0.2);
  padding: 4px 10px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}
.banner-stats b { font-size: 16px; font-weight: 700; line-height: 1.1; }
.btn-line-outline {
  align-self: flex-start;
  background: white;
  color: var(--accent);
  font-size: 13px; font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.btn-line-outline:active { transform: scale(0.97); }
.banner-contact {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.btn-phone {
  background: var(--line-green) !important;
  color: white !important;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(6, 199, 85, 0.4);
}
.btn-line-mini {
  background: white !important;
  color: var(--line-green) !important;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 12px;
}

.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  margin: 12px 14px 0;
  flex-shrink: 0;
}
.searchbar input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px;
}
.searchbar input::placeholder { color: var(--text-dim); }

.categories {
  display: flex; gap: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.cat {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.cat.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.product-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 4px 14px 80px;
}
.product-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
  border: 1px solid var(--border);
}
.product-card:active { transform: scale(0.98); }
.product-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-elev);
}
.product-card-body { padding: 8px 10px 10px; }
.product-card-name {
  font-size: 12px; font-weight: 500;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 31px;
}
.product-card-price-row {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 8px;
}
.product-card-price {
  font-size: 16px; font-weight: 700;
  color: var(--accent);
}
.product-card-original {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: line-through;
}
.product-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.product-card-rating {
  font-size: 11px;
  color: var(--text-soft);
}
.product-card-cart {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  font-size: 14px;
  transition: transform 0.15s;
}
.product-card-cart:active { transform: scale(0.9); }

/* ============ CART VIEW ============ */
.view-cart, .view-orders { background: var(--bg); overflow-y: auto; padding-bottom: 120px; }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 5;
}
.cart-header h2 { font-size: 18px; font-weight: 600; }
.btn-text { color: var(--accent); font-size: 13px; font-weight: 500; }
.btn-text:active { opacity: 0.7; }

.cart-list { padding: 8px 14px; }
.cart-item {
  display: flex; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}
.cart-item img {
  width: 64px; height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13px; font-weight: 500;
  margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--accent); }
.cart-item-original { font-size: 11px; color: var(--text-dim); text-decoration: line-through; margin-left: 4px; }
.cart-item-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.qty-mini {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev);
  border-radius: 16px;
  padding: 2px;
}
.qty-mini button {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  display: grid; place-items: center;
}
.qty-mini button:active { background: var(--accent); color: white; }
.qty-mini span { font-size: 13px; font-weight: 600; min-width: 18px; text-align: center; }
.cart-item-remove {
  font-size: 12px;
  color: var(--text-dim);
}
.cart-item-remove:active { color: var(--accent); }

.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px;
  text-align: center;
}
.big-emoji { font-size: 64px; margin-bottom: 12px; opacity: 0.5; }
.cart-empty p { color: var(--text-soft); margin-bottom: 20px; }

.cart-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 540px; margin: 0 auto;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  gap: 10px;
  z-index: 10;
}
.cart-total {
  display: flex; align-items: baseline; justify-content: space-between;
}
.cart-total-label { font-size: 12px; color: var(--text-soft); }
.cart-total-amount { font-size: 22px; font-weight: 700; color: var(--accent); }
.cart-checkout-btns { display: flex; flex-direction: column; gap: 8px; }
.btn-checkout, .btn-checkout-line, .btn-checkout-call {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  color: white;
  transition: filter 0.15s, transform 0.1s;
  text-align: left;
  text-decoration: none;
  display: flex;
}
.btn-checkout:active, .btn-checkout-line:active, .btn-checkout-call:active { transform: scale(0.98); filter: brightness(0.92); }
.btn-checkout-call {
  background: var(--line-green) !important;
  box-shadow: 0 4px 16px rgba(6, 199, 85, 0.45);
  animation: pulse-call 2.5s ease-in-out infinite;
}
.btn-checkout {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}
.btn-checkout-line {
  background: rgba(6, 199, 85, 0.12);
  color: var(--line-green);
  border: 1.5px solid var(--line-green);
  box-shadow: none;
}
.btn-checkout .btn-icon, .btn-checkout-line .btn-icon { font-size: 24px; }
.btn-checkout .btn-text-wrap, .btn-checkout-line .btn-text-wrap { display: flex; flex-direction: column; gap: 1px; }
.btn-checkout .btn-main, .btn-checkout-line .btn-main { font-size: 14px; font-weight: 700; }
.btn-checkout .btn-sub, .btn-checkout-line .btn-sub { font-size: 11px; opacity: 0.85; font-weight: 400; }

.btn-primary {
  background: var(--accent);
  color: white;
  font-size: 14px; font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: filter 0.15s;
}
.btn-primary:active { filter: brightness(0.9); }

.btn-line-big {
  background: var(--line-green);
  color: white;
  font-size: 14px; font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 12px rgba(6, 199, 85, 0.3);
  transition: filter 0.15s;
}
.btn-line-big:active { filter: brightness(0.9); }
.btn-line-big::before {
  content: ''; width: 18px; height: 18px;
  background: white;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016a.63.63 0 0 1-.629.628.62.62 0 0 1-.504-.252l-2.443-3.317v2.94a.629.629 0 1 1-1.257 0V8.108a.628.628 0 0 1 1.131-.378l2.442 3.317V8.108a.628.628 0 1 1 1.257 0v4.771h.003zm-5.741 0a.629.629 0 1 1-1.257 0V8.108a.629.629 0 1 1 1.257 0v4.771zm-2.466.629H4.917a.624.624 0 0 1-.626-.629V8.108a.625.625 0 1 1 1.249 0v4.141h1.755a.627.627 0 0 1 .629.63.625.625 0 0 1-.629.629zM24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016a.63.63 0 0 1-.629.628.62.62 0 0 1-.504-.252l-2.443-3.317v2.94a.629.629 0 1 1-1.257 0V8.108a.628.628 0 0 1 1.131-.378l2.442 3.317V8.108a.628.628 0 1 1 1.257 0v4.771h.003zm-5.741 0a.629.629 0 1 1-1.257 0V8.108a.629.629 0 1 1 1.257 0v4.771zm-2.466.629H4.917a.624.624 0 0 1-.626-.629V8.108a.625.625 0 1 1 1.249 0v4.141h1.755a.627.627 0 0 1 .629.63.625.625 0 0 1-.629.629zM24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"/></svg>') center/contain no-repeat;
}

/* ============ MODAL ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  animation: fadein 0.2s;
}
.modal-content {
  position: relative;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 540px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: slideup 0.25s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  z-index: 10;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  display: grid; place-items: center;
  font-size: 14px;
  backdrop-filter: blur(4px);
}

/* Product modal */
.modal-product { max-height: 92vh; }
.pm-image-wrap {
  position: relative;
  background: var(--bg-elev);
  flex-shrink: 0;
}
.pm-image-wrap img {
  width: 100%;
  max-height: 50vh;
  object-fit: cover;
  display: block;
}
.pm-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent);
  color: white;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}
.pm-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.pm-body h2 { font-size: 17px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.pm-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.stars { color: var(--yellow); font-size: 13px; }
.rating-count { font-size: 11px; color: var(--text-soft); }
.pm-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.pm-price { font-size: 24px; font-weight: 700; color: var(--accent); }
.pm-price-original { font-size: 13px; color: var(--text-dim); text-decoration: line-through; }
.pm-discount {
  font-size: 11px; font-weight: 700;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 8px; border-radius: 6px;
}
.pm-section { margin-bottom: 14px; }
.pm-section h3 { font-size: 12px; color: var(--text-soft); font-weight: 500; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.pm-section p { font-size: 13px; line-height: 1.5; }
.qty-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-soft);
  border-radius: 22px;
  padding: 4px;
  width: fit-content;
}
.qty-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 18px; font-weight: 600;
  display: grid; place-items: center;
}
.qty-btn:active { background: var(--accent); color: white; }
.qty-row span { font-size: 15px; font-weight: 600; min-width: 28px; text-align: center; }

.pm-footer {
  display: flex; gap: 6px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-cart, .btn-web, .btn-line, .btn-call {
  flex: 1;
  font-size: 12px; font-weight: 600;
  padding: 8px 4px;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  line-height: 1.1;
  text-decoration: none;
}
.btn-cart .btn-sub, .btn-web .btn-sub, .btn-line .btn-sub, .btn-call .btn-sub { font-size: 10px; opacity: 0.9; }
.btn-cart {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-cart:active { background: var(--bg-elev); }
.btn-call {
  background: var(--line-green);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.4);
  animation: pulse-call 2.5s ease-in-out infinite;
}
.btn-call:active { filter: brightness(0.9); }
.btn-web {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}
.btn-web:active { filter: brightness(0.9); }
.btn-line {
  background: var(--line-green);
  color: white;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.3);
}
.btn-line:active { filter: brightness(0.9); }
.btn-affiliate {
  background: linear-gradient(135deg, #ee4d2d 0%, #d73211 100%);
  color: white;
  font-weight: 700;
  text-decoration: none;
  width: 100%;
  padding: 14px 0;
  border-radius: 12px;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(238, 77, 45, 0.4);
  animation: pulse-affiliate 2.5s ease-in-out infinite;
}
.btn-affiliate:active { filter: brightness(0.95); }
.pm-affiliate-banner {
  width: 100%;
  text-align: center;
  padding: 10px 14px 14px;
  background: linear-gradient(135deg, #fff5f0 0%, #ffe8df 100%);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid #ffd0bd;
}
.pm-aff-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ee4d2d 0%, #d73211 100%);
  color: white;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.pm-aff-note {
  font-size: 12px;
  color: #66331f;
  margin: 0;
  line-height: 1.4;
}
.btn-line::before {
  content: ''; width: 18px; height: 18px;
  background: white;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016a.63.63 0 0 1-.629.628.62.62 0 0 1-.504-.252l-2.443-3.317v2.94a.629.629 0 1 1-1.257 0V8.108a.628.628 0 0 1 1.131-.378l2.442 3.317V8.108a.628.628 0 1 1 1.257 0v4.771h.003zm-5.741 0a.629.629 0 1 1-1.257 0V8.108a.629.629 0 1 1 1.257 0v4.771zm-2.466.629H4.917a.624.624 0 0 1-.626-.629V8.108a.625.625 0 1 1 1.249 0v4.141h1.755a.627.627 0 0 1 .629.63.625.625 0 0 1-.629.629zM24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"/></svg>') center/contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.365 9.863c.349 0 .63.285.63.631 0 .345-.281.63-.63.63H17.61v1.125h1.755c.349 0 .63.283.63.63 0 .344-.281.629-.63.629h-2.386c-.345 0-.627-.285-.627-.629V8.108c0-.345.282-.63.63-.63h2.386c.346 0 .627.285.627.63 0 .349-.281.63-.63.63H17.61v1.125h1.755zm-3.855 3.016a.63.63 0 0 1-.629.628.62.62 0 0 1-.504-.252l-2.443-3.317v2.94a.629.629 0 1 1-1.257 0V8.108a.628.628 0 0 1 1.131-.378l2.442 3.317V8.108a.628.628 0 1 1 1.257 0v4.771h.003zm-5.741 0a.629.629 0 1 1-1.257 0V8.108a.629.629 0 1 1 1.257 0v4.771zm-2.466.629H4.917a.624.624 0 0 1-.626-.629V8.108a.625.625 0 1 1 1.249 0v4.141h1.755a.627.627 0 0 1 .629.63.625.625 0 0 1-.629.629zM24 10.314C24 4.943 18.615.572 12 .572S0 4.943 0 10.314c0 4.811 4.27 8.842 10.035 9.608.391.082.923.258 1.058.59.12.301.079.766.038 1.08l-.164 1.02c-.045.301-.24 1.186 1.049.645 1.291-.539 6.916-4.078 9.436-6.975C23.176 14.393 24 12.458 24 10.314"/></svg>') center/contain no-repeat;
}

/* ============ ADMIN MODAL ============ */
.modal-admin {
  padding: 18px 18px 0;
  overflow-y: auto;
}
.modal-admin h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.admin-tabs {
  display: flex; gap: 4px;
  margin: 14px 0 12px;
  border-bottom: 1px solid var(--border);
}
.atab {
  padding: 8px 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.atab.active { color: var(--text); border-bottom-color: var(--accent); }

.admin-panel { padding: 8px 0 16px; }
.admin-panel label {
  display: block;
  font-size: 12px; color: var(--text-soft);
  margin-bottom: 12px;
  font-weight: 500;
}
.admin-panel input[type="text"],
.admin-panel input[type="number"],
.admin-panel textarea,
.admin-panel select {
  display: block;
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  margin-top: 4px;
  outline: none;
  transition: border 0.15s;
}
.admin-panel input:focus, .admin-panel textarea:focus { border-color: var(--accent); }
.color-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.color-row input[type="color"] { width: 50px; height: 36px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--bg-soft); }
#cfgAccentVal { font-family: monospace; font-size: 13px; }

.admin-list { margin-bottom: 12px; }
.admin-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.admin-item img {
  width: 40px; height: 40px;
  border-radius: 6px; object-fit: cover;
  background: var(--bg-elev);
}
.admin-item-info { flex: 1; min-width: 0; }
.admin-item-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-item-meta { font-size: 11px; color: var(--text-soft); }
.admin-item-remove { color: var(--text-dim); font-size: 18px; padding: 4px; }
.admin-item-remove:active { color: var(--accent); }

.admin-footer {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: 100px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.92);
  color: white;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px; font-weight: 500;
  z-index: 200;
  animation: toastin 0.25s, toastout 0.25s 1.8s forwards;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 80%;
  text-align: center;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastout { to { opacity: 0; transform: translate(-50%, 20px); } }

/* ============ CHECKOUT MODAL ============ */
.modal-checkout { max-height: 95vh; }
.checkout-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.checkout-header h2 { font-size: 18px; font-weight: 600; }
.checkout-header p { font-size: 12px; margin-top: 2px; }
.checkout-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 20px;
}
.ck-section {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.ck-section h3 {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.muted-small { font-size: 11px; color: var(--text-soft); font-weight: 400; margin-left: 4px; }

.ck-items { margin-bottom: 10px; }
.ck-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.ck-item:last-child { border-bottom: none; }
.ck-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.ck-item-info { flex: 1; min-width: 0; }
.ck-item-name { font-size: 12px; font-weight: 500; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ck-item-qty { font-size: 10px; color: var(--text-soft); }
.ck-item-price { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.ck-totals { padding-top: 8px; }
.ck-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-soft);
}
.ck-row.ck-grand {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 6px; padding-top: 8px;
}
.ck-row.ck-grand span:last-child { color: var(--accent); }

.ck-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.ck-field { display: flex; flex-direction: column; }
.ck-field-full { grid-column: 1 / -1; }
.ck-field label {
  font-size: 11px; font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.ck-field .req { color: var(--accent); }
.ck-field input, .ck-field textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
  resize: vertical;
}
.ck-field input:focus, .ck-field textarea:focus { border-color: var(--accent); }

.ck-payments { display: flex; flex-direction: column; gap: 8px; }
.ck-pay { cursor: pointer; }
.ck-pay input { position: absolute; opacity: 0; pointer-events: none; }
.ck-pay-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s;
}
.ck-pay input:checked + .ck-pay-card {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.ck-pay-icon { font-size: 24px; }
.ck-pay-title { font-size: 13px; font-weight: 600; }
.ck-pay-desc { font-size: 11px; color: var(--text-soft); }

.checkout-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}
.btn-confirm {
  flex: 1;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  color: white;
  font-size: 15px; font-weight: 700;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
  transition: filter 0.15s, transform 0.1s;
}
.btn-confirm:active { filter: brightness(0.9); transform: scale(0.99); }
.btn-confirm:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ SUCCESS MODAL ============ */
.modal-success {
  text-align: center;
  padding: 28px 20px 20px;
  max-width: 380px;
  margin: 0 auto;
}
.success-icon { font-size: 64px; margin-bottom: 8px; }
.modal-success h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.order-id {
  font-family: monospace; font-size: 18px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-block;
  margin: 8px 0 14px;
  letter-spacing: 0.5px;
}
.order-id-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 8px 0 14px;
}
.order-id-row .order-id { margin: 0; }
.btn-copy {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-elev);
  font-size: 16px;
  display: grid; place-items: center;
  transition: background 0.15s, transform 0.1s;
}
.btn-copy:active { background: var(--accent-bg); transform: scale(0.92); }
.btn-copy.copied { background: var(--line-green); color: white; }
.success-secondary-btns {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 6px;
  font-size: 12px;
}
.success-secondary-btns .dot { color: var(--text-dim); }
.success-call-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--line-green) !important;
  background: rgba(6, 199, 85, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid rgba(6, 199, 85, 0.3);
}
.success-call-link:active { background: rgba(6, 199, 85, 0.2); }
.success-payment {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.success-payment b { color: var(--text); }
.success-payment .pp-number {
  font-family: monospace; font-size: 16px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.success-summary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  text-align: left;
  margin-bottom: 14px;
  max-height: 140px;
  overflow-y: auto;
}
.success-summary .ss-row {
  display: flex; justify-content: space-between;
  padding: 2px 0;
}
.success-summary .ss-grand {
  font-size: 14px; font-weight: 700;
  border-top: 1px solid var(--border);
  margin-top: 4px; padding-top: 6px;
  color: var(--accent);
}
.success-actions {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.success-actions .btn-primary { width: 100%; padding: 12px; }

/* ============ ADMIN ORDERS ============ */
.orders-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.stat-mini {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
}
.stat-mini span {
  display: block;
  font-size: 16px; font-weight: 700;
  color: var(--accent);
}
.stat-mini label {
  font-size: 9px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.admin-order {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.admin-order-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.admin-order-id {
  font-family: monospace; font-size: 11px; font-weight: 600;
  color: var(--text);
}
.admin-order-total { font-size: 14px; font-weight: 700; color: var(--accent); }
.admin-order-meta {
  font-size: 11px; color: var(--text-soft);
  margin-bottom: 6px;
}
.admin-order-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.admin-order-status {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text-soft);
}
.status-pending { background: rgba(255, 212, 0, 0.2); color: #d4a800; }
.status-confirmed { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.status-shipped { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.status-delivered { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.status-cancelled { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.status-btn {
  font-size: 10px; font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.status-btn:active { background: var(--accent); color: white; }

.atab-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 2px;
  vertical-align: middle;
}
.atab-badge[data-zero="true"] { display: none; }

/* ============ ARTICLES VIEW ============ */
.view-articles { background: var(--bg); overflow-y: auto; padding-bottom: 60px; }
.articles-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  padding: 8px 14px;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
}
.article-card:active { transform: scale(0.98); }
.article-card-img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-elev);
}
.article-card-body { padding: 12px 14px 14px; }
.article-card-tags {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.article-tag {
  font-size: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}
.article-card-title {
  font-size: 15px; font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}
.article-card-excerpt {
  font-size: 12px; color: var(--text-soft);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.article-card-meta {
  font-size: 11px; color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}

.article-detail { padding: 8px 14px 60px; }
.article-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px 16px;
  border: 1px solid var(--border);
}
.article-content h1 { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.article-content h2 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; color: var(--accent); }
.article-content h3 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.article-content p { font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.article-content ul, .article-content ol { padding-left: 22px; margin-bottom: 10px; }
.article-content li { font-size: 14px; line-height: 1.7; margin-bottom: 4px; }
.article-content code {
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}
.article-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.article-content th, .article-content td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 13px;
  text-align: left;
}
.article-content th { background: var(--bg-elev); font-weight: 600; }
.article-content strong { color: var(--accent); font-weight: 600; }
.article-content a { color: var(--accent); text-decoration: underline; }

/* ============ PRODUCT MODAL SPECS ============ */
.pm-specs { display: grid; gap: 6px; }
.pm-spec-row {
  display: flex; justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-elev);
  border-radius: 8px;
  font-size: 13px;
}
.pm-spec-k { color: var(--text-soft); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; font-size: 11px; }
.pm-spec-v { color: var(--text); font-weight: 600; }

/* ============ ORDERS VIEW (customer) ============ */
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.order-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.order-card-id { font-family: monospace; font-size: 12px; font-weight: 600; }
.order-card-total { font-size: 15px; font-weight: 700; color: var(--accent); }
.order-card-meta { font-size: 11px; color: var(--text-soft); margin-bottom: 8px; }
.order-card-items { font-size: 12px; line-height: 1.5; padding-top: 8px; border-top: 1px dashed var(--border); }
.order-card-status {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.3px;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 600px) {
  #app { border-radius: 20px; margin-top: 16px; height: calc(100% - 32px); }
}
@media (max-width: 360px) {
  .brand-name { font-size: 14px; }
  .feed-product img { width: 38px; height: 38px; }
  .feed-product-name { font-size: 12px; }
}

/* ============ SEO STATIC PAGES ============ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
}
.site-logo {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 16px;
  color: var(--accent); text-decoration: none;
}
.site-nav { display: flex; gap: 12px; margin-left: 16px; flex: 1; }
.site-nav a {
  color: var(--text-soft); text-decoration: none;
  font-size: 14px; padding: 6px 8px; border-radius: 6px;
  transition: all 0.15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent); background: var(--accent-bg); }
.site-call {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  padding: 8px 12px; border-radius: 8px;
  text-decoration: none; font-size: 14px; font-weight: 600;
}
.site-call:hover { filter: brightness(1.1); }
.site-main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; padding: 32px 16px;
}
.footer-col h4 { font-size: 14px; margin: 0 0 10px; color: var(--accent); }
.footer-col p, .footer-col li { font-size: 13px; color: var(--text-soft); margin: 4px 0; }
.footer-col a { color: var(--text-soft); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px; text-align: center; }
.footer-bottom p { font-size: 12px; color: var(--text-dim); margin: 0; }

.container { max-width: 100%; }

.breadcrumb {
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.bc-sep { color: var(--text-dim); }
.bc-current { color: var(--text); font-weight: 500; }

.page-header { margin-bottom: 32px; padding: 16px 0; }
.page-header h1 { font-size: 32px; font-weight: 800; margin: 0 0 8px; }
.page-subtitle { font-size: 15px; color: var(--text-soft); margin: 0; }

/* === Article Static === */
.article-static { max-width: 760px; margin: 0 auto; }
.article-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article-category {
  display: inline-block;
  background: var(--accent-bg); color: var(--accent);
  padding: 4px 12px; border-radius: 16px;
  font-size: 12px; font-weight: 600;
  margin-bottom: 12px;
}
.article-title { font-size: 36px; line-height: 1.2; font-weight: 800; margin: 0 0 12px; }
.article-excerpt { font-size: 17px; line-height: 1.6; color: var(--text-soft); margin: 0 0 16px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 13px; color: var(--text-dim);
}
.article-meta span { display: inline-flex; align-items: center; gap: 4px; }

.article-cover {
  margin: 0 0 32px;
  border-radius: 12px; overflow: hidden;
  background: var(--bg-elev);
}
.article-cover img { width: 100%; height: auto; display: block; }

.article-body { font-size: 16px; line-height: 1.8; color: var(--text); }
.article-body h1 { font-size: 28px; margin: 32px 0 16px; line-height: 1.3; }
.article-body h2 { font-size: 22px; margin: 28px 0 12px; color: var(--accent); }
.article-body h3 { font-size: 18px; margin: 24px 0 8px; }
.article-body p { margin: 0 0 16px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 0 0 16px; }
.article-body li { margin-bottom: 6px; }
.article-body code {
  background: var(--bg-elev);
  padding: 2px 6px; border-radius: 4px;
  font-family: monospace; font-size: 14px;
}
.article-body pre {
  background: var(--bg-elev);
  padding: 16px; border-radius: 8px;
  overflow-x: auto; margin: 0 0 16px;
}
.article-body pre code { background: none; padding: 0; }
.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0; font-size: 14px;
}
.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 10px 12px; text-align: left;
}
.article-body th { background: var(--bg-elev); font-weight: 600; }
.article-body strong { color: var(--accent); font-weight: 600; }
.article-body a { color: var(--accent); text-decoration: underline; }

.article-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 32px 0;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.article-tag {
  background: var(--accent-bg); color: var(--accent);
  padding: 4px 12px; border-radius: 16px;
  font-size: 12px; font-weight: 500;
  text-decoration: none;
}
.article-tag:hover { filter: brightness(1.1); }

.article-faq {
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 24px;
  margin: 32px 0;
  border: 1px solid var(--line);
}
.article-faq h2 {
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--accent);
}
.faq-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s;
}
.faq-item:hover { border-color: var(--accent); }
.faq-item summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '＋';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: '－';
}
.faq-item .faq-a {
  padding: 0 18px 16px;
  color: var(--text-soft);
  line-height: 1.6;
}
.faq-item .faq-a p { margin: 0; }

.article-cta {
  background: linear-gradient(135deg, var(--accent-bg), var(--bg-elev));
  border-radius: 12px;
  padding: 24px; margin: 32px 0;
  text-align: center;
}
.article-cta h3 { font-size: 20px; margin: 0 0 8px; }
.article-cta p { color: var(--text-soft); margin: 0 0 16px; }
.cta-buttons {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: none; transition: all 0.15s;
  background: var(--bg-elev); color: var(--text);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-call { background: #22c55e; color: #fff; }
.btn-line { background: #06c755; color: #fff; }

.article-related {
  margin-top: 48px;
  padding-top: 32px; border-top: 1px solid var(--border);
}
.article-related h3 { font-size: 20px; margin: 0 0 16px; }
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.related-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  text-decoration: none; color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.related-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.related-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.related-body { padding: 12px; }
.related-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.related-meta { font-size: 11px; color: var(--text-dim); }

/* === Articles List === */
.articles-category { margin-bottom: 40px; }
.articles-category h2 {
  font-size: 22px; font-weight: 700; margin: 0 0 16px;
  color: var(--accent);
}
.articles-grid-static {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.article-card-static {
  display: block; background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--text);
  transition: all 0.2s;
}
.article-card-static:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.article-card-static .article-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.article-card-static .article-card-body { padding: 14px 16px 16px; }
.article-card-static .article-card-title { font-size: 16px; font-weight: 700; line-height: 1.4; margin: 0 0 8px; }
.article-card-static .article-card-excerpt {
  font-size: 13px; line-height: 1.5; color: var(--text-soft);
  margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Products Static === */
.products-grid-static {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.product-card-static {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  position: relative;
}
.product-card-static a { display: block; }
.product-card-static .product-card-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.product-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: #fff;
  padding: 3px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
}
.product-card-body { padding: 12px 14px 14px; }
.product-card-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0 0 6px; }
.product-card-desc { font-size: 12px; color: var(--text-soft); line-height: 1.5; margin: 0 0 8px; }
.product-card-price { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.price-current { font-size: 18px; font-weight: 700; color: var(--accent); }
.price-original { font-size: 13px; color: var(--text-dim); text-decoration: line-through; }
.product-specs-mini {
  list-style: none; padding: 0; margin: 0 0 12px;
  font-size: 12px; color: var(--text-soft);
}
.product-specs-mini li { margin-bottom: 3px; }
.product-card-actions { display: flex; gap: 8px; }
.product-card-actions .btn { flex: 1; justify-content: center; padding: 8px; font-size: 13px; }

.products-cta {
  margin-top: 32px; padding: 20px;
  background: var(--bg-elev); border-radius: 12px;
  text-align: center;
}
.products-cta p { margin: 6px 0; font-size: 14px; }

.error-404 { text-align: center; padding: 60px 16px; }
.error-404 h1 { font-size: 96px; font-weight: 900; color: var(--accent); margin: 0; }
.error-404 h2 { font-size: 24px; margin: 8px 0 16px; }
.error-404 p { color: var(--text-soft); margin: 0 0 24px; }

/* === Mobile === */
@media (max-width: 768px) {
  .site-header-inner { flex-wrap: wrap; gap: 8px; }
  .site-nav { order: 3; width: 100%; margin-left: 0; justify-content: center; }
  .site-call { font-size: 13px; padding: 6px 10px; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 16px; padding: 24px 16px; }
  .article-title { font-size: 26px; }
  .article-excerpt { font-size: 15px; }
  .article-body { font-size: 15px; }
  .related-grid { grid-template-columns: 1fr; }
  .articles-grid-static { grid-template-columns: 1fr; }
  .products-grid-static { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .cta-buttons { flex-direction: column; }
  .cta-buttons .btn { width: 100%; justify-content: center; }
}

/* === Video SEO page === */
.vdo-player-wrap { max-width: 480px; margin: 24px auto; }
.vdo-player { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 9/16; }
.vdo-player-cta { text-align: center; margin-top: 16px; }

.vdo-cta { background: var(--bg-elev); border-radius: var(--radius); padding: 20px; margin: 24px 0; text-align: center; }
.vdo-cta h2 { font-size: 20px; margin: 0 0 12px; color: var(--accent); }
.vdo-cta p { font-size: 15px; margin: 8px 0; }
.vdo-cta a { color: var(--line-green); font-weight: 600; }

.vdo-product { margin: 24px 0; }
.vdo-product h3 { font-size: 18px; margin: 0 0 12px; }
.vdo-product-card { display: flex; gap: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; align-items: center; }
.vdo-product-img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-elev); }
.vdo-product-body { flex: 1; }
.vdo-product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.vdo-product-price { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

.vdo-list-thumb { position: relative; }
.vdo-list-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.6); color: #fff; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.vdo-back { margin: 32px 0; text-align: center; }

@media (max-width: 768px) {
  .vdo-player-wrap { max-width: 100%; margin: 16px 0; }
  .vdo-product-card { flex-direction: column; text-align: center; }
}

/* === Video page enhancements === */
.article-description { font-size: 15px; line-height: 1.7; color: var(--text-soft); margin: 8px 0 16px; }
.vdo-tags { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vdo-transcript { background: var(--bg-soft); border-radius: var(--radius); padding: 16px; margin: 20px 0; }
.vdo-transcript summary { font-size: 14px; font-weight: 600; cursor: pointer; color: var(--accent-soft); user-select: none; }
.vdo-transcript summary:hover { color: var(--accent); }
.vdo-transcript-body { font-size: 14px; line-height: 1.7; color: var(--text-soft); margin-top: 12px; padding: 12px; background: var(--bg-card); border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }

/* === Video editor modal === */
.ve-form { padding: 16px; max-height: 70vh; overflow-y: auto; }
.ve-section { margin-bottom: 20px; }
.ve-section h4 { font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.ve-section label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--text-soft); }
.ve-section label input, .ve-section label select, .ve-section label textarea {
  display: block; width: 100%; margin-top: 4px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 14px; font-family: inherit;
}
.ve-section label input:focus, .ve-section label select:focus, .ve-section label textarea:focus {
  border-color: var(--accent); outline: none;
}
.ve-section label input[readonly] { opacity: 0.6; }
.ve-row { display: flex; gap: 10px; }
.ve-row > label { flex: 1; }
.ve-hint { display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.ve-seo { background: linear-gradient(135deg, var(--accent-bg), transparent); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.ve-seo.good { color: var(--accent); }
.ve-seo.warn { color: #f59e0b; }
.ve-seo.bad { color: var(--text-dim); }
.ve-actions { display: flex; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.ve-slug-status { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.ve-slug-status.error { color: #ef4444; }
.ve-slug-status.ok { color: var(--accent); }
.ve-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ve-header h3 { margin: 0; font-size: 17px; }
.admin-item-edit { background: var(--bg-elev); border: none; color: var(--text); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; margin-right: 4px; }
.admin-item-edit:hover { background: var(--accent); color: #fff; }

/* === Product Page (per-product SEO) === */
.product-page {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 16px 0 32px;
}
.product-page-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .product-page-grid { grid-template-columns: 1fr; }
}
.product-page-image {
  position: relative;
  margin: 0;
  background: var(--bg-elev);
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1/1;
}
.product-page-image img { width: 100%; height: 100%; object-fit: cover; }
.product-page-image .product-badge {
  position: absolute; top: 12px; left: 12px;
  background: #ee4d2d; color: #fff;
  padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700;
}
.product-page-sku { font-size: 12px; color: var(--text-soft); margin-bottom: 4px; }
.product-page-title { font-size: 24px; line-height: 1.3; margin: 0 0 8px; color: var(--text); }
.product-page-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--text-soft); }
.product-page-rating .stars { color: #fbbf24; }
.product-page-rating .rating-num { font-weight: 600; color: var(--text); }
.product-page-desc { color: var(--text-soft); line-height: 1.6; margin: 0 0 20px; }
.product-page-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.product-page-price .pp-current { font-size: 32px; font-weight: 700; color: var(--accent); }
.product-page-price .pp-original { text-decoration: line-through; color: var(--text-soft); font-size: 16px; }
.product-page-price .pp-discount { background: #ee4d2d; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.product-page-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.product-page-cta .btn { flex: 1; min-width: 140px; text-align: center; padding: 12px 20px; }
.btn-affiliate-product {
  display: inline-block; background: linear-gradient(135deg, #ee4d2d 0%, #d73211 100%);
  color: #fff !important; text-decoration: none;
  font-weight: 700; font-size: 15px;
  padding: 14px 24px; border-radius: 10px;
  box-shadow: 0 4px 14px rgba(238,77,45,0.4);
  animation: pulse-affiliate 2.5s ease-in-out infinite;
}
.btn-affiliate-product:hover { filter: brightness(1.05); }
.affiliate-note { font-size: 12px; color: var(--text-soft); margin: 8px 0 0; font-style: italic; }

.pm-specs-section {
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
}
.pm-specs-section h3 { font-size: 16px; margin: 0 0 12px; }
.pm-specs-list .pm-spec-row {
  display: grid; grid-template-columns: 1fr 2fr; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.pm-specs-list .pm-spec-row:last-child { border-bottom: none; }
.pm-specs-list .pm-spec-k { color: var(--text-soft); }
.pm-specs-list .pm-spec-v { color: var(--text); font-weight: 500; }

.product-related {
  margin: 32px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.product-related h3 { font-size: 18px; margin: 0 0 16px; }

/* === Reviews (in product modal + SEO page) === */
.pm-reviews { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.pm-rev { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.pm-rev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.pm-rev-name { font-weight: 600; color: var(--text); font-size: 14px; }
.pm-rev-stars { color: #fbbf24; font-size: 13px; }
.pm-rev-comment { color: var(--text); margin: 0 0 4px; font-size: 14px; line-height: 1.5; }
.pm-rev-date { color: var(--text-soft); font-size: 12px; }
.pm-rev-empty { color: var(--text-soft); font-style: italic; text-align: center; padding: 20px; margin: 0; }

.pm-rev-count { color: var(--text-soft); font-size: 14px; font-weight: 400; }
.pm-rev-form-wrap { margin-top: 10px; }
.pm-rev-form-toggle {
  display: inline-block; cursor: pointer;
  background: var(--bg-elev); color: var(--text);
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 14px; font-weight: 500; user-select: none; list-style: none;
  transition: all 0.2s;
}
.pm-rev-form-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pm-rev-form-toggle::-webkit-details-marker { display: none; }
.pm-rev-form {
  margin-top: 10px; padding: 16px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px; display: flex; flex-direction: column; gap: 10px;
}
.pm-rev-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text-soft); font-weight: 500;
}
.pm-rev-form input, .pm-rev-form textarea {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: inherit;
  background: var(--bg); color: var(--text);
}
.pm-rev-form input:focus, .pm-rev-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.pm-stars-input { display: flex; gap: 4px; font-size: 28px; cursor: pointer; }
.pm-stars-input span { transition: transform 0.1s; user-select: none; line-height: 1; }
.pm-stars-input span:hover { transform: scale(1.2); }
.pm-stars-input span.active { color: #fbbf24; }
.pm-rev-submit {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  align-self: flex-start;
}
.pm-rev-submit:hover { filter: brightness(1.1); }
.pm-rev-note { color: var(--text-soft); font-size: 11px; margin: 4px 0 0; font-style: italic; }

/* === SEO product page reviews === */
.product-page-reviews { margin: 32px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.product-page-reviews h3 { font-size: 18px; margin: 0 0 16px; }
.pp-reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pp-rev { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.pp-rev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.pp-rev-name { font-weight: 600; color: var(--text); font-size: 14px; }
.pp-rev-stars { color: #fbbf24; font-size: 14px; }
.pp-rev-date { color: var(--text-soft); font-size: 12px; margin-left: auto; }
.pp-rev-comment { color: var(--text); margin: 0; font-size: 14px; line-height: 1.5; }
