*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #4f7fff; --blue-dark: #3d68ff; --navy: #07071a;
  --bg: #07071a; --card-bg: #0f1022; --card-bg2: #141830;
  --text: #eeeeff; --muted: rgba(238,238,255,0.5); --border: rgba(255,255,255,0.08);
  --border-hover: rgba(79,127,255,0.4);
  --green: #10d98a; --red: #ff5e5e; --radius: 12px;
}
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: 'Syne', sans-serif; }

/* NAV */
.nav {
  background: rgba(7,7,26,0.9); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 64px; display: flex; align-items: center; position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1280px; margin: 0 auto; gap: 24px; }
.logo { font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--text); text-decoration: none; flex-shrink: 0; letter-spacing: -0.02em; }
.logo-f { color: var(--blue); text-shadow: 0 0 16px rgba(79,127,255,0.5); }
.nav-search { flex: 1; max-width: 480px; position: relative; }
.nav-search input {
  width: 100%; padding: 9px 16px 9px 40px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text); font-family: inherit; font-size: 0.9rem; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus { background: var(--card-bg2); border-color: rgba(79,127,255,0.4); }
.nav-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1rem; pointer-events: none; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.88rem; white-space: nowrap; transition: color 0.2s; }
.nav-link:hover { color: var(--text); }
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--blue); color: #fff;
  border-radius: 8px; text-decoration: none; font-size: 0.88rem; font-weight: 600;
  transition: background 0.2s;
}
.cart-btn:hover { background: var(--blue-dark); }
#cartBadge {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff;
  font-size: 0.7rem; font-weight: 700; width: 18px; height: 18px;
  border-radius: 50%; display: none; align-items: center; justify-content: center;
}
.btn-outline-sm { padding: 7px 14px; border: 1.5px solid var(--border); color: var(--text); border-radius: 8px; text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: all 0.2s; }
.btn-outline-sm:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.06); }

/* PAGE LAYOUT */
.page { max-width: 1280px; margin: 0 auto; padding: 36px 32px; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.page-sub { color: var(--muted); font-size: 0.95rem; }
.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* FILTERS */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.filter-btn {
  padding: 7px 16px; border-radius: 50px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-family: inherit; font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover, .filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.filter-count { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

/* PRODUCT GRID */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.p-card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; cursor: pointer;
}
.p-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.5); transform: translateY(-2px); border-color: var(--border-hover); }
.p-card-img { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--card-bg2); }
.p-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.p-card:hover .p-card-img img { transform: scale(1.04); }
.p-card-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.p-card:hover .p-card-overlay { opacity: 1; }
.p-card-overlay span { color: #fff; font-weight: 700; font-size: 0.9rem; padding: 8px 18px; border: 2px solid rgba(255,255,255,0.8); border-radius: 8px; }
.p-ai-pill { position: absolute; top: 10px; left: 10px; background: var(--blue); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 50px; }
.p-card-body { padding: 14px 16px 16px; }
.p-shop { font-size: 0.78rem; color: var(--blue); font-weight: 600; margin-bottom: 4px; }
.p-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; color: var(--text); }
.p-footer { display: flex; align-items: center; justify-content: space-between; }
.p-price { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.p-stock-low { font-size: 0.75rem; color: var(--red); font-weight: 600; }

/* PRODUCT DETAIL */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.pd-img-wrap { border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: var(--card-bg); border: 1px solid var(--border); }
.pd-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { position: sticky; top: 90px; }
.pd-shop { font-size: 0.85rem; color: var(--blue); font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pd-shop a { color: var(--blue); text-decoration: none; }
.pd-shop a:hover { text-decoration: underline; }
.pd-name { font-size: 1.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 14px; color: var(--text); }
.pd-price { font-size: 2rem; font-weight: 800; color: var(--text); margin-bottom: 20px; }
.pd-desc { color: var(--muted); line-height: 1.7; font-size: 0.95rem; margin-bottom: 24px; }
.pd-category { display: inline-block; background: var(--card-bg); color: var(--muted); border: 1px solid var(--border); font-size: 0.8rem; padding: 4px 12px; border-radius: 50px; margin-bottom: 20px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qty-label { font-size: 0.88rem; font-weight: 600; }
.qty-ctrl { display: flex; align-items: center; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card-bg); }
.qty-ctrl button { width: 36px; height: 36px; border: none; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; transition: background 0.15s; }
.qty-ctrl button:hover { background: var(--card-bg2); }
.qty-ctrl span { min-width: 40px; text-align: center; font-weight: 700; }
.btn-add-cart { width: 100%; padding: 14px; background: var(--blue); color: #fff; border: none; border-radius: 10px; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; margin-bottom: 10px; }
.btn-add-cart:hover { background: var(--blue-dark); box-shadow: 0 6px 20px rgba(79,127,255,0.4); }
.btn-add-cart:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-buy-now { width: 100%; padding: 14px; background: var(--card-bg2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-buy-now:hover { background: var(--card-bg); border-color: rgba(255,255,255,0.2); }
.pd-stock { font-size: 0.85rem; margin-top: 12px; color: var(--muted); }
.pd-related { margin-top: 60px; }
.pd-related h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; color: var(--text); }

/* VENDOR SHOP PAGE */
.boutique-header {
  background: linear-gradient(135deg, #07071a, #0d0a28);
  border-bottom: 1px solid var(--border);
  color: var(--text); padding: 40px 32px;
}
.boutique-header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.boutique-avatar { width: 72px; height: 72px; border-radius: 16px; background: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.boutique-name { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.boutique-desc { color: var(--muted); font-size: 0.9rem; max-width: 560px; }
.boutique-meta { display: flex; gap: 20px; margin-top: 12px; }
.boutique-meta-item { font-size: 0.82rem; color: var(--muted); }
.boutique-meta-item strong { color: var(--text); }

/* CART */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.cart-items { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.cart-item { display: flex; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--card-bg2); flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-shop { font-size: 0.78rem; color: var(--blue); font-weight: 600; margin-bottom: 2px; }
.cart-item-name { font-weight: 600; margin-bottom: 4px; color: var(--text); }
.cart-item-price { font-size: 0.9rem; color: var(--muted); }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cart-item-total { font-size: 1rem; font-weight: 800; color: var(--text); }
.cart-remove { font-size: 0.8rem; color: var(--red); background: none; border: none; cursor: pointer; padding: 0; }
.cart-summary { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; position: sticky; top: 90px; }
.cart-summary h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; color: var(--text); }
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 10px; color: var(--muted); }
.summary-row strong { color: var(--text); }
.summary-row.total { font-size: 1.1rem; font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.btn-checkout { display: block; width: 100%; padding: 14px; background: var(--blue); color: #fff; border: none; border-radius: 10px; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; margin-top: 20px; transition: background 0.2s, box-shadow 0.2s; }
.btn-checkout:hover { background: var(--blue-dark); box-shadow: 0 6px 20px rgba(79,127,255,0.4); }
.cart-empty { text-align: center; padding: 60px 20px; }
.cart-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* CHECKOUT */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: start; }
.checkout-form-card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 28px; }
.checkout-form-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 22px; color: var(--text); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: rgba(238,238,255,0.8); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 0.95rem;
  font-family: inherit; outline: none;
  background: var(--card-bg2); color: var(--text);
  transition: border-color 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(79,127,255,0.5); }
.field select { cursor: pointer; }
.row { display: flex; gap: 14px; }
.flex-1 { flex: 1; }
.order-summary-card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; position: sticky; top: 90px; }
.order-summary-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.order-item-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.order-item-img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--card-bg2); flex-shrink: 0; }
.order-item-info { flex: 1; }
.order-item-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.order-item-qty { font-size: 0.78rem; color: var(--muted); }
.order-item-price { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.btn-place-order { width: 100%; padding: 14px; background: var(--green); color: #07071a; border: none; border-radius: 10px; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s, box-shadow 0.2s; margin-top: 16px; }
.btn-place-order:hover { opacity: 0.9; box-shadow: 0 6px 20px rgba(16,217,138,0.3); }
.btn-place-order:disabled { opacity: 0.5; cursor: not-allowed; }
.trust-row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.trust-chip { font-size: 0.75rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }

/* MISC */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: 14px; opacity: 0.5; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: rgba(16,217,138,0.15); color: var(--green); }
.badge-red { background: rgba(255,94,94,0.15); color: var(--red); }
.success-screen { text-align: center; padding: 60px 20px; max-width: 480px; margin: 0 auto; }
.success-icon { font-size: 4rem; margin-bottom: 20px; }
.success-screen h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.success-screen p { color: var(--muted); line-height: 1.6; margin-bottom: 24px; }

@media (max-width: 900px) {
  .product-detail, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .pd-info { position: static; }
  .cart-summary, .order-summary-card { position: static; }
  .boutique-header-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .page { padding: 24px 16px; }
  .nav { padding: 0 16px; }
  .nav-search { display: none; }
}
