:root {
  --black: #0a0a0a;
  --dark: #111111;
  --card-dark: #1a1a1a;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-pale: #f5e6b8;
  --white: #ffffff;
  --gray: #888888;
  --light-gray: #f5f5f5;
  --red: #e63946;
  --green: #2ecc71;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; background: #f8f8f8; color: #222; }

/* HEADER */
.header {
  background: var(--black);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px; max-width: 1400px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 180px; }
.logo-icon { color: var(--gold); font-size: 20px; }
.logo-text { color: var(--white); font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.logo-badge {
  background: var(--gold); color: var(--black);
  font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; letter-spacing: 1px;
}
.search-bar { flex: 1; display: flex; gap: 0; }
.search-bar input {
  flex: 1; padding: 10px 16px; border: 2px solid #333; border-right: none;
  border-radius: var(--radius) 0 0 var(--radius); background: #1a1a1a; color: var(--white);
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--gold); }
.search-bar button {
  padding: 10px 18px; background: var(--gold); border: none; cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 16px;
}
.header-right { display: flex; align-items: center; gap: 16px; }
.card-badge {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  border: 1px solid var(--gold); border-radius: 10px; padding: 8px 14px;
  transition: all 0.2s;
}
.card-badge:hover { background: linear-gradient(135deg, #2a2a2a, #333); transform: translateY(-1px); }
.card-chip { font-size: 22px; }
.card-label { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.card-limit { color: var(--white); font-size: 13px; font-weight: 700; }
.cart-btn {
  background: var(--gold); border: none; padding: 10px 18px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; cursor: pointer; color: var(--black); transition: all 0.2s;
}
.cart-btn:hover { background: var(--gold-light); transform: translateY(-1px); }
#cartCount {
  background: var(--red); color: white; border-radius: 50%; padding: 1px 6px; font-size: 11px; margin-left: 4px;
}

/* CATEGORY NAV */
.category-nav {
  display: flex; gap: 4px; padding: 10px 24px;
  max-width: 1400px; margin: 0 auto; overflow-x: auto;
}
.cat-btn {
  background: transparent; color: #aaa; border: 1px solid #333; border-radius: 20px;
  padding: 6px 18px; cursor: pointer; font-size: 13px; white-space: nowrap; transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active { background: var(--gold); color: var(--black); border-color: var(--gold); font-weight: 700; }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--black) 0%, #1a0a00 50%, #0a0a1a 100%);
  padding: 60px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 40px; max-width: 1400px; margin: 0 auto;
}
.hero-content { flex: 1; }
.hero-sub { color: var(--gold); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 12px; }
.hero-title { color: var(--white); font-size: 48px; font-weight: 900; line-height: 1.2; margin-bottom: 16px; }
.hero-desc { color: #aaa; font-size: 16px; margin-bottom: 24px; }
.hero-perks { display: flex; gap: 20px; flex-wrap: wrap; }
.hero-perks span {
  background: rgba(201,168,76,0.1); border: 1px solid var(--gold);
  color: var(--gold-light); padding: 8px 16px; border-radius: 20px; font-size: 13px;
}

/* CREDIT CARD */
.hero-card-wrap { flex-shrink: 0; }
.credit-card {
  width: 340px; height: 210px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 40%, #1a1a1a 100%);
  border-radius: 20px; padding: 28px; cursor: pointer;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px rgba(201,168,76,0.2);
  border: 1px solid rgba(201,168,76,0.4); position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.credit-card::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 200px; height: 200px; background: rgba(201,168,76,0.05); border-radius: 50%;
}
.credit-card:hover { transform: rotateY(-5deg) rotateX(3deg) translateY(-8px); box-shadow: 0 30px 80px rgba(0,0,0,0.9), 0 0 60px rgba(201,168,76,0.3); }
.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cc-brand { color: var(--gold); font-size: 16px; font-weight: 800; letter-spacing: 1px; }
.cc-type { color: #666; font-size: 11px; letter-spacing: 2px; }
.cc-chip { color: var(--gold); font-size: 28px; margin-bottom: 16px; }
.cc-number { color: var(--white); font-size: 18px; letter-spacing: 4px; margin-bottom: 20px; font-family: monospace; }
.cc-bottom { display: flex; align-items: flex-end; gap: 20px; }
.cc-label { color: #666; font-size: 8px; letter-spacing: 1px; margin-bottom: 2px; }
.cc-value { color: var(--white); font-size: 13px; font-weight: 600; }
.cc-network { color: var(--gold); font-size: 22px; margin-left: auto; }

/* FLASH SECTION */
.flash-section { background: var(--black); padding: 20px 24px; max-width: 1400px; margin: 0 auto; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { color: var(--white); font-size: 20px; }
.countdown { color: var(--gold); font-size: 22px; font-weight: 800; font-family: monospace; }
.flash-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.flash-strip::-webkit-scrollbar { height: 4px; }
.flash-strip::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }
.flash-item {
  flex-shrink: 0; width: 160px; background: var(--card-dark); border-radius: 12px;
  overflow: hidden; cursor: pointer; border: 1px solid #222; transition: transform 0.2s;
}
.flash-item:hover { transform: translateY(-4px); border-color: var(--gold); }
.flash-thumb { width: 100%; height: 100px; object-fit: cover; font-size: 40px; display: flex; align-items: center; justify-content: center; background: #222; }
.flash-info { padding: 10px; }
.flash-name { color: var(--white); font-size: 12px; margin-bottom: 4px; }
.flash-price { color: var(--gold); font-weight: 700; font-size: 14px; }
.flash-discount { background: var(--red); color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }

/* MAIN */
.main-content { max-width: 1400px; margin: 0 auto; padding: 32px 24px; }
.products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.products-header h2 { font-size: 22px; font-weight: 800; }
.sort-options select {
  padding: 8px 14px; border: 1px solid #ddd; border-radius: 8px;
  background: white; font-size: 13px; cursor: pointer;
}

/* PRODUCT GRID */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card {
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: all 0.3s; cursor: pointer; position: relative;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 16px 48px rgba(0,0,0,0.2); }
.product-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--red); color: white; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
.product-badge.gold { background: var(--gold); color: var(--black); }
.product-thumb {
  position: relative; width: 100%; height: 200px; overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}
.product-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.5s ease;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}
.product-card:hover .product-img { transform: scale(1.08); }
.product-thumb-emoji {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: white; border-radius: 50%; width: 44px; height: 44px;
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35); border: 1.5px solid var(--gold);
}
.product-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}
.product-info { padding: 16px; }
.product-brand { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.product-name { font-size: 15px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.product-rating { color: #f4a200; font-size: 13px; margin-bottom: 8px; }
.product-rating span { color: #666; font-size: 12px; }
.product-price-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.product-price { font-size: 20px; font-weight: 900; color: var(--black); }
.product-original { font-size: 13px; color: #aaa; text-decoration: line-through; }
.product-discount { color: var(--red); font-size: 13px; font-weight: 700; }
.product-shipping { font-size: 12px; color: var(--green); margin-bottom: 12px; }
.product-actions { display: flex; gap: 8px; }
.btn-cart {
  flex: 1; padding: 10px; background: var(--black); color: var(--white);
  border: none; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; transition: background 0.2s;
}
.btn-cart:hover { background: #333; }
.btn-buy {
  flex: 1; padding: 10px; background: var(--gold); color: var(--black);
  border: none; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; transition: background 0.2s;
}
.btn-buy:hover { background: var(--gold-light); }

/* LOAD MORE */
.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 0 20px; }
.load-more-info { color: #888; font-size: 13px; font-weight: 600; }
.load-more-btn {
  background: var(--black); color: var(--gold); border: 2px solid var(--gold);
  padding: 14px 48px; border-radius: 30px; font-size: 15px; font-weight: 800;
  cursor: pointer; transition: all 0.2s; letter-spacing: 1px;
}
.load-more-btn:hover { background: var(--gold); color: var(--black); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,0.3); }
.load-more-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* CART SIDEBAR */
.cart-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; }
.cart-overlay.open { display: block; }
.cart-sidebar {
  position: fixed; right: -420px; top: 0; bottom: 0; width: 420px;
  background: white; z-index: 201; transition: right 0.3s ease; display: flex; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.2);
}
.cart-sidebar.open { right: 0; }
.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid #eee; background: var(--black); color: white;
}
.cart-header h3 { font-size: 18px; }
.cart-header button { background: transparent; border: none; color: white; font-size: 20px; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; align-items: center;
}
.cart-item-emoji { font-size: 36px; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { color: var(--gold); font-weight: 700; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn {
  width: 24px; height: 24px; background: #f0f0f0; border: none; border-radius: 4px;
  cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.cart-item-remove { color: var(--red); cursor: pointer; font-size: 18px; padding: 4px; }
.cart-footer { padding: 20px 24px; border-top: 1px solid #eee; background: #fafafa; }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.checkout-btn {
  width: 100%; padding: 16px; background: var(--black); color: var(--gold);
  border: none; border-radius: var(--radius); font-size: 16px; font-weight: 800; cursor: pointer;
  letter-spacing: 1px; transition: all 0.2s;
}
.checkout-btn:hover { background: #222; transform: translateY(-2px); }

/* MODALS */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 300; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 20px; padding: 40px; max-width: 480px; width: 90%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* CHECKOUT MODAL */
.checkout-modal h2 { font-size: 22px; margin-bottom: 20px; text-align: center; }
.checkout-card-preview { margin-bottom: 24px; }
.mini-card {
  background: linear-gradient(135deg, var(--black), #333);
  color: var(--gold); border-radius: 12px; padding: 16px 20px;
  border: 1px solid var(--gold); font-size: 13px;
}
.mini-card-num { font-family: monospace; font-size: 16px; letter-spacing: 3px; margin-top: 8px; color: white; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #555; }
.form-group input {
  width: 100%; padding: 12px 16px; border: 2px solid #eee; border-radius: 10px;
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--gold); }
.checkout-summary { background: #f8f8f8; border-radius: 12px; padding: 16px; margin-bottom: 20px; font-size: 14px; }
.checkout-summary-item { display: flex; justify-content: space-between; padding: 4px 0; }
.checkout-actions { display: flex; gap: 12px; }
.cancel-btn {
  flex: 1; padding: 14px; background: #f0f0f0; border: none; border-radius: 10px;
  cursor: pointer; font-size: 15px; font-weight: 700;
}
.confirm-btn {
  flex: 2; padding: 14px; background: var(--black); color: var(--gold);
  border: none; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 800;
}

/* SUCCESS MODAL */
.success-modal { text-align: center; }
.success-icon { font-size: 60px; margin-bottom: 16px; }
.success-modal h2 { font-size: 26px; margin-bottom: 8px; }
.success-modal p { color: #666; margin-bottom: 20px; }
.order-id-box {
  background: #f8f8f8; border-radius: 10px; padding: 14px; font-size: 14px; margin-bottom: 20px;
}
.track-btn {
  width: 100%; padding: 14px; background: var(--gold); border: none; border-radius: 10px;
  cursor: pointer; font-size: 15px; font-weight: 800; color: var(--black); margin-bottom: 10px;
}

/* BLACK CARD MODAL */
.card-modal { background: var(--black); color: var(--white); max-width: 420px; position: relative; }
.modal-close {
  position: absolute; top: 16px; right: 16px; background: #333; border: none;
  color: white; font-size: 16px; cursor: pointer; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.big-card {
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-radius: 20px; padding: 32px; border: 1px solid var(--gold);
  box-shadow: 0 0 40px rgba(201,168,76,0.2); margin-bottom: 28px;
}
.bc-top { display: flex; justify-content: space-between; margin-bottom: 20px; }
.bc-brand { color: var(--gold); font-size: 18px; font-weight: 800; }
.bc-type { color: #555; font-size: 12px; letter-spacing: 2px; }
.bc-chip { color: var(--gold); font-size: 32px; margin-bottom: 18px; }
.bc-number { color: white; font-size: 20px; letter-spacing: 6px; margin-bottom: 24px; font-family: monospace; }
.bc-bottom { display: flex; align-items: flex-end; gap: 24px; }
.bc-label { color: #555; font-size: 8px; letter-spacing: 1px; margin-bottom: 3px; }
.bc-value { color: white; font-size: 14px; font-weight: 700; }
.bc-net { color: var(--gold); font-size: 20px; margin-left: auto; }
.card-benefits h3 { color: var(--gold); margin-bottom: 16px; font-size: 16px; letter-spacing: 1px; }
.card-benefits ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.card-benefits li { color: #ccc; font-size: 14px; padding-left: 4px; }
.card-benefits li strong { color: var(--gold); }

/* TRACKING PAGE */
.tracking-page {
  position: fixed; inset: 0; background: var(--light-gray); z-index: 400;
  overflow-y: auto;
}
.tracking-page.hidden { display: none; }
.tracking-inner { max-width: 700px; margin: 0 auto; padding: 32px 24px; }
.back-btn {
  background: var(--black); color: var(--gold); border: none; padding: 10px 20px;
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 700; margin-bottom: 24px;
}
.tracking-inner h2 { font-size: 26px; font-weight: 800; margin-bottom: 20px; }
.tracking-order-info {
  background: var(--black); color: var(--white); border-radius: 16px; padding: 20px; margin-bottom: 28px;
  border-left: 4px solid var(--gold);
}
.tracking-order-info p { margin: 4px 0; font-size: 14px; color: #ccc; }
.tracking-order-info p strong { color: var(--gold); }

/* TIMELINE */
.tracking-timeline { background: white; border-radius: 16px; padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.timeline-item { display: flex; gap: 16px; padding: 12px 0; position: relative; }
.timeline-item:not(:last-child)::after {
  content: ''; position: absolute; left: 18px; top: 44px; bottom: -12px;
  width: 2px; background: #eee;
}
.timeline-item.done:not(:last-child)::after { background: var(--gold); }
.timeline-dot {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: #f0f0f0; border: 2px solid #ddd; position: relative; z-index: 1;
}
.timeline-item.done .timeline-dot { background: var(--gold); border-color: var(--gold); }
.timeline-item.current .timeline-dot { background: var(--gold); border-color: var(--gold-light); box-shadow: 0 0 12px rgba(201,168,76,0.5); }
.timeline-info { flex: 1; padding-top: 4px; }
.timeline-label { font-size: 15px; font-weight: 700; color: #aaa; }
.timeline-item.done .timeline-label, .timeline-item.current .timeline-label { color: var(--black); }
.timeline-item.current .timeline-label { color: var(--gold); }
.timeline-time { font-size: 12px; color: #aaa; margin-top: 2px; }
.timeline-current-badge {
  background: var(--gold); color: var(--black); font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 10px; margin-left: 8px;
}

/* TRACKING ITEMS */
.tracking-items { background: white; border-radius: 16px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.tracking-items h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.tracking-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; align-items: center; }
.tracking-item:last-child { border-bottom: none; }
.tracking-item-emoji { font-size: 28px; }
.tracking-item-name { flex: 1; font-size: 14px; font-weight: 600; }
.tracking-item-price { color: var(--gold); font-weight: 700; font-size: 14px; }

.refresh-btn {
  width: 100%; padding: 14px; background: white; border: 2px solid var(--gold);
  color: var(--gold); border-radius: 12px; cursor: pointer; font-size: 15px; font-weight: 700;
}

/* TRACKING MAP */
.tracking-map-wrap { background: white; border-radius: 16px; padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.tracking-map-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.tracking-map-header h3 { font-size: 16px; font-weight: 800; }
.map-legend { color: #888; font-size: 11px; }
.tracking-map {
  width: 100%; height: 360px; border-radius: 12px; overflow: hidden;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
}
.tracking-map-info {
  margin-top: 12px; padding: 12px 16px; background: #f8f8f8; border-radius: 10px;
  font-size: 13px; color: #444; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.tracking-map-info strong { color: var(--gold); }
.leaflet-marker-emoji {
  background: white; border-radius: 50%;
  width: 44px; height: 44px; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  border: 2.5px solid var(--gold);
}
.leaflet-marker-emoji.truck {
  background: var(--gold); border-color: var(--black);
  animation: bounce 1.6s ease infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.leaflet-tooltip-custom {
  background: var(--black) !important; color: var(--gold) !important;
  border: 1px solid var(--gold) !important; font-weight: 700 !important;
  border-radius: 8px !important; padding: 4px 10px !important;
  font-size: 12px !important;
}
.leaflet-tooltip-custom::before { border-top-color: var(--black) !important; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero { flex-direction: column; padding: 40px 16px; }
  .hero-title { font-size: 32px; }
  .credit-card { width: 100%; max-width: 340px; }
  .header-inner { flex-wrap: wrap; }
  .cart-sidebar { width: 100%; right: -100%; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
