/* ============================================
   THE TACKLE SHOP - Single Screen Layout
   Fixed phone viewport, no scrolling
   ============================================ */

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

:root {
  --bg-dark: #1a1a2e;
  --bg-mid: #16213e;
  --bg-card: #0f3460;
  --accent: #e94560;
  --gold: #f5c518;
  --water: #00b4d8;
  --water-dark: #0077b6;
  --green: #2dc653;
  --text: #eaf2f8;
  --text-dim: #8899aa;
  --wood: #8b5e3c;
  --wood-dark: #6b3a2a;
}

body {
  background: #0d0d1a;
  color: var(--text);
  font-family: 'VT323', monospace;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px 0;
}

/* ---- PHONE FRAME ---- */
.game-container {
  width: 390px;
  height: min(720px, calc(100vh - 40px));
  background: var(--bg-mid);
  border-radius: 20px;
  border: 3px solid #333;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(233, 69, 96, 0.15), 0 0 80px rgba(0, 0, 0, 0.5);
}

/* ---- HEADER ---- */
.shop-header {
  background: linear-gradient(180deg, var(--wood-dark), var(--wood));
  padding: 14px 16px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
  flex-shrink: 0;
}

.shop-header h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 13px;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000, 0 0 10px rgba(245, 197, 24, 0.3);
}

.currency-select {
  font-family: 'VT323', monospace;
  font-size: 14px;
  padding: 4px 8px;
  background: var(--wood-dark);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px;
  cursor: pointer;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-dark);
  border-bottom: 2px solid #2a2a4a;
}

.tab {
  flex: 1;
  padding: 10px 0;
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(245, 197, 24, 0.05);
}

.tab[data-tab="powerups"] {
  color: var(--water);
  background: rgba(0, 180, 216, 0.08);
  border-bottom-color: var(--water);
}

.tab[data-tab="powerups"].active {
  color: var(--gold);
  background: rgba(245, 197, 24, 0.1);
  border-bottom-color: var(--gold);
}

/* ---- SHOP PANEL ---- */
.shop-panel {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  position: relative;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: absolute;
  left: 8px;
  right: 8px;
  visibility: hidden;
  pointer-events: none;
}

.tab-content.active {
  position: relative;
  left: auto;
  right: auto;
  visibility: visible;
  pointer-events: auto;
}

/* ---- PRODUCT ROW ---- */
.product-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 2px solid #1a4a7a;
  border-radius: 10px;
  padding: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.product-row:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(233, 69, 96, 0.2);
}

.product-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0a1628, #162040);
  border-radius: 8px;
  padding: 4px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  display: block;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.product-desc {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.2;
  margin-bottom: 2px;
}

.price {
  font-size: 20px;
  color: var(--green);
  font-weight: bold;
}

.sub-tag {
  display: inline-block;
  font-family: 'Press Start 2P', cursive;
  font-size: 6px;
  color: var(--water);
  background: rgba(0, 180, 216, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qty-select {
  width: 40px;
  padding: 6px 2px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  background: var(--bg-dark);
  color: var(--text);
  border: 2px solid #1a4a7a;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
}

.add-btn {
  width: 40px;
  height: 40px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), #c73250);
  border: 2px solid #ff6b81;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 #8a1a30;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  background: linear-gradient(180deg, #ff5577, var(--accent));
}

.add-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.sub-add {
  background: linear-gradient(180deg, var(--water), var(--water-dark));
  border-color: #48cae4;
  box-shadow: 0 2px 0 #005577;
}

.sub-add:hover {
  background: linear-gradient(180deg, #48cae4, var(--water));
}

.sub-row {
  border-color: var(--water-dark);
}

.sub-row:hover {
  border-color: var(--water);
  box-shadow: 0 2px 12px rgba(0, 180, 216, 0.2);
}

/* ---- CART SUMMARY ---- */
.cart-summary {
  flex-shrink: 0;
  background: var(--bg-dark);
  border-top: 3px solid var(--wood);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a4a;
}

.cart-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: var(--gold);
  letter-spacing: 1px;
}

.reset-btn {
  padding: 4px 10px;
  font-family: 'Press Start 2P', cursive;
  font-size: 6px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
}

.reset-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cart-contents {
  padding: 6px 12px;
  min-height: 48px;
  max-height: 100px;
  overflow-y: auto;
}

.cart-empty {
  color: var(--text-dim);
  font-size: 16px;
  text-align: center;
  padding: 12px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #1a1a2e;
  font-size: 16px;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-name {
  flex: 1;
  color: var(--text);
}

.cart-item-qty {
  color: var(--text-dim);
  margin: 0 8px;
  font-size: 14px;
}

.cart-item-price {
  color: var(--green);
  min-width: 50px;
  text-align: right;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  padding: 0 0 0 8px;
  font-family: 'VT323', monospace;
}

.cart-item-remove:hover {
  color: #ff6b81;
}

/* ---- CART FOOTER ---- */
.cart-footer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid #2a2a4a;
}

.cart-totals {
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  white-space: nowrap;
}

.cart-total-label {
  color: var(--text-dim);
}

.cart-total-value {
  color: var(--gold);
}

.promo-row {
  display: flex;
  gap: 4px;
  flex: 1;
}

.promo-input {
  width: 70px;
  padding: 6px;
  font-family: 'VT323', monospace;
  font-size: 14px;
  background: var(--bg-mid);
  color: var(--text);
  border: 1px solid #1a4a7a;
  border-radius: 4px;
}

.promo-input::placeholder {
  color: var(--text-dim);
  font-size: 12px;
}

.promo-btn {
  padding: 6px 8px;
  font-family: 'Press Start 2P', cursive;
  font-size: 6px;
  color: var(--gold);
  background: var(--wood-dark);
  border: 1px solid var(--wood);
  border-radius: 4px;
  cursor: pointer;
}

.cart-checkout-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 10px;
}

.checkout-btn {
  flex: 1;
  padding: 10px 16px;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: #fff;
  background: linear-gradient(180deg, var(--green), #1a8a3a);
  border: 2px solid #4ade80;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 #0f6028;
  transition: all 0.1s;
  flex-shrink: 0;
}

.checkout-btn:hover {
  background: linear-gradient(180deg, #4ade80, var(--green));
}

.checkout-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* ---- SCROLLBAR ---- */
.cart-contents::-webkit-scrollbar,
.shop-panel::-webkit-scrollbar {
  width: 4px;
}

.cart-contents::-webkit-scrollbar-track,
.shop-panel::-webkit-scrollbar-track {
  background: transparent;
}

.cart-contents::-webkit-scrollbar-thumb,
.shop-panel::-webkit-scrollbar-thumb {
  background: var(--wood);
  border-radius: 2px;
}

/* ---- CHECKOUT VIEW ---- */
.checkout-view {
  display: none;
  flex-direction: column;
}

.checkout-view.active {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.checkout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-dark);
  border-bottom: 2px solid #2a2a4a;
  flex-shrink: 0;
}

.checkout-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  color: var(--gold);
}

.back-btn {
  padding: 6px 10px;
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid #1a4a7a;
  border-radius: 4px;
  cursor: pointer;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.checkout-embed {
  background: #fff;
  flex: 1 0 auto;
}

/* Scrollbar for checkout view */
.checkout-view::-webkit-scrollbar {
  width: 6px;
}

.checkout-view::-webkit-scrollbar-track {
  background: var(--bg-mid);
}

.checkout-view::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}
