* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0a0a0a;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #fff;
  min-height: 100vh;
  overscroll-behavior: none;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

#app {
  max-width: 430px;
  margin: 0 auto;
  background: #0a0a0a;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* HEADER */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.header-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: #1e1e1e; border: 1px solid #2a2a2a;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
  flex-shrink: 0;
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-name { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.user-handle { font-size: 12px; color: #555; }
.cart-btn {
  position: relative;
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 8px 14px; color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 7px;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.cart-count {
  background: #fff; color: #000; border-radius: 50%;
  width: 18px; height: 18px; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* BUNDLE BANNER */
.bundle-banner {
  margin: 0 12px 16px;
  border: 1px solid #303030; border-radius: 18px;
  padding: 18px; background: #181818;
  box-shadow: 0 4px 28px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
}
.bundle-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 10px; gap: 10px;
}
.bundle-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  color: #666; text-transform: uppercase; margin-bottom: 5px;
}
.bundle-title { font-size: 18px; font-weight: 900; line-height: 1.15; letter-spacing: -0.03em; }
.bundle-buy-btn {
  background: #fff; color: #000; border: none; border-radius: 10px;
  padding: 9px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(255,255,255,.15);
}
.bundle-desc { font-size: 12px; color: #666; margin-bottom: 14px; line-height: 1.55; }
.bundle-price-row { display: flex; align-items: center; gap: 10px; }
.price-old { font-size: 12px; color: #444; text-decoration: line-through; }
.price-new-wrap { position: relative; display: inline-flex; }
.price-new {
  background: #fff; color: #000; border-radius: 8px;
  padding: 6px 14px; font-size: 19px; font-weight: 800; letter-spacing: -0.03em;
}
.fire {
  position: absolute; top: -22px; right: -14px;
  font-size: 28px;
  animation: fireBurn 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fireBurn {
  0%   { transform: rotate(20deg) scale(1) translateY(0); }
  25%  { transform: rotate(15deg) scale(1.1) translateY(-3px); }
  50%  { transform: rotate(25deg) scale(0.95) translateY(1px); }
  75%  { transform: rotate(13deg) scale(1.08) translateY(-2px); }
  100% { transform: rotate(20deg) scale(1) translateY(0); }
}
.bundle-days { font-size: 12px; color: #555; margin-left: auto; }

/* SEARCH */
.search-wrap { margin: 0 12px 16px; position: relative; }
.search-input {
  width: 100%; background: #141414; border: 1px solid #242424;
  border-radius: 12px; padding: 12px 44px 12px 16px; color: #fff;
  font-size: 14px; outline: none; font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.search-input::placeholder { color: #444; }
.search-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: #555;
}

/* GRID */
.grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 0 12px;
}
.card {
  background: #141414; border-radius: 16px; overflow: hidden;
  cursor: pointer; border: 1px solid #222;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  transition: transform .15s;
}
.card:active { transform: scale(.97); }
.card-img {
  position: relative; aspect-ratio: 1/1;
  background: #1a1a1a; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
}
.card-img-placeholder svg { opacity: .3; }
.card-price-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.85); border: 1px solid #333; border-radius: 6px;
  padding: 2px 8px; font-size: 11px; font-weight: 700;
  backdrop-filter: blur(4px); white-space: nowrap;
}
.card-body { padding: 11px 11px 13px; }
.card-prices { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.card-old-price { font-size: 11px; color: #444; text-decoration: line-through; }
.card-new-price { font-size: 14px; font-weight: 800; letter-spacing: -0.02em; }
.card-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.01em; }
.card-days { font-size: 11px; color: #555; margin-bottom: 10px; }
.card-add-btn {
  width: 100%; border-radius: 9px; padding: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; letter-spacing: .01em;
  transition: background .15s, color .15s;
}
.card-add-btn.in-cart {
  background: #3d0d0d; border: 1px solid #6a1a1a; color: #ff5555;
  box-shadow: 0 2px 10px rgba(200,0,0,.2);
}
.card-add-btn.not-cart {
  background: #1a1a1a; border: 1px solid #2a2a2a; color: #ccc;
}

/* BOTTOM BAR */
.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: #161616; border-top: 1px solid #252525;
  padding: 14px 20px; display: flex; align-items: center;
  justify-content: space-between; cursor: pointer; z-index: 10;
  box-shadow: 0 -4px 24px rgba(0,0,0,.7);
}
.bottom-bar-label { font-size: 13px; font-weight: 800; letter-spacing: .1em; }
.bottom-bar-total { font-size: 15px; font-weight: 700; }
.bottom-bar-count {
  background: #fff; color: #000; border-radius: 50%;
  width: 24px; height: 24px; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* MODALS */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  flex-direction: column; justify-content: flex-end;
  background: rgba(0,0,0,.75);
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  position: relative; background: #141414;
  border-radius: 22px 22px 0 0; overflow: hidden;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,.8);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.7); border: 1px solid #333;
  border-radius: 50%; width: 32px; height: 32px; color: #fff;
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-close-sm {
  background: #1e1e1e; border: 1px solid #2a2a2a; border-radius: 50%;
  width: 32px; height: 32px; color: #aaa; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-img-wrap { position: relative; height: 200px; background: #1a1a1a; overflow: hidden; }
.modal-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.modal-img-placeholder {
  width: 100%; height: 100%; background: #181818;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 20px 16px 36px; }
.modal-title { font-size: 21px; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 8px; }
.modal-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.modal-days { font-size: 13px; color: #555; }
.price-badge {
  background: #fff; color: #000; border-radius: 7px;
  padding: 4px 12px; font-size: 14px; font-weight: 800; letter-spacing: -0.02em;
}
.modal-desc { font-size: 14px; color: #888; line-height: 1.65; margin-bottom: 26px; }
.modal-action-btn {
  width: 100%; border: none; border-radius: 13px; padding: 17px;
  font-size: 15px; font-weight: 700; cursor: pointer; letter-spacing: .01em;
  transition: background .15s;
}
.modal-action-btn.add { background: #fff; color: #000; box-shadow: 0 2px 16px rgba(255,255,255,.12); }
.modal-action-btn.remove { background: #3d0d0d; color: #ff5555; box-shadow: 0 2px 12px rgba(200,0,0,.25); }

/* CART MODAL */
.cart-sheet { display: flex; flex-direction: column; max-height: 80vh; }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 18px 16px; flex-shrink: 0;
}
.cart-title { font-size: 21px; font-weight: 900; letter-spacing: -0.03em; }
.cart-items { overflow-y: auto; flex: 1; padding: 0 16px; }
.cart-item {
  background: #1a1a1a; border: 1px solid #252525; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.cart-item-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; letter-spacing: -0.01em; }
.cart-item-meta { font-size: 12px; color: #555; }
.cart-item-remove {
  background: #1f1111; border: 1px solid #3a1a1a; border-radius: 8px;
  width: 30px; height: 30px; color: #e04444; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cart-footer { padding: 18px; border-top: 1px solid #1e1e1e; flex-shrink: 0; }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 16px; }
.cart-total-label { font-size: 15px; color: #666; }
.cart-total { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.pay-btn {
  width: 100%; background: #fff; color: #000; border: none;
  border-radius: 13px; padding: 17px; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 16px rgba(255,255,255,.12); letter-spacing: .01em;
}

/* PAYMENT MODAL */
.payment-sheet { padding: 22px 16px 0; }
.payment-title {
  text-align: center; font-size: 17px; font-weight: 800;
  margin-bottom: 20px; letter-spacing: -0.02em;
}
.pay-method-btn {
  width: 100%; background: #1a1a1a; border: 1px solid #282828;
  border-radius: 14px; padding: 15px 18px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  color: #fff; font-size: 14px; font-weight: 600; text-align: left;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transition: background .15s;
}
.pay-method-btn:active { background: #222; }
.pay-method-icon {
  width: 38px; height: 38px; background: #1e1e1e; border: 1px solid #2e2e2e;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pay-cancel-btn {
  width: 100%; background: none; border: none; color: #555;
  font-size: 14px; font-weight: 600; padding: 14px; cursor: pointer; letter-spacing: .01em;
}
.payment-footer {
  padding: 14px 2px 16px; border-top: 1px solid #1e1e1e;
  display: flex; justify-content: space-between; align-items: center;
}
.payment-total { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }

/* SPINNER */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid #2a2a2a; border-top-color: #fff;
  animation: spin .7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
