/* ═══════════════════════════════════════════════════════════════════════
   SHOP CSS – Biome Racer Shop & Freischalt-System (Mobile First)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Shop Modal Overlay ───────────────────────────────────────────────── */
#shop-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 15, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1200;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(30px + env(safe-area-inset-bottom));
}
#shop-modal.active {
  display: flex;
}

/* ── Shop Container ───────────────────────────────────────────────────── */
.shop-container {
  max-width: 1000px;
  width: 100%;
  animation: shopFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@keyframes shopFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Shop Header ──────────────────────────────────────────────────────── */
.shop-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(102,252,241,0.12);
}
@media (min-width: 600px) {
  .shop-header {
    flex-wrap: nowrap;
    gap: 18px;
    margin-bottom: 28px;
    padding-bottom: 18px;
  }
}
.shop-title {
  text-align: left;
  margin: 0;
  font-size: clamp(20px, 5.5vw, 32px);
}
.shop-subtitle {
  color: var(--text-muted);
  font-size: clamp(11px, 3vw, 13px);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  text-align: left;
  margin-top: 4px;
  font-family: var(--font-title);
}
.shop-coins-badge {
  background: rgba(251,191,36,0.1);
  border: 1.5px solid #fbbf24;
  border-radius: 30px;
  padding: 6px 14px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(12px, 3.5vw, 14px);
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(251,191,36,0.2);
  align-self: center;
}
.shop-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 14px;
  transition: all 0.2s ease;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.shop-close-btn:hover,
.shop-close-btn:active {
  border-color: #ef4444;
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

/* ── Shop Grid ────────────────────────────────────────────────────────── */
#shop-packs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 580px) {
  #shop-packs-grid {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
  }
}

/* ── Shop Card ────────────────────────────────────────────────────────── */
.shop-card {
  background: linear-gradient(145deg, #16161e, #1a1a28);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}
.shop-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.18);
}
.shop-card--owned {
  border-color: rgba(34,197,94,0.35);
  box-shadow: 0 0 20px rgba(34,197,94,0.08);
}

/* ── Card Header ──────────────────────────────────────────────────────── */
.shop-card-header {
  padding: 14px 16px 12px;
  border-bottom: 1.5px solid;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0,0,0,0.2);
}
.shop-card-icon {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 4px;
}
.shop-card-title {
  font-family: 'Orbitron', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  text-transform: uppercase;
}
.shop-card-price {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── Card Body ────────────────────────────────────────────────────────── */
.shop-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shop-card-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}
.shop-card-biome-tag {
  display: inline-block;
  border: 1px solid;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  width: fit-content;
}
.shop-preview-label {
  font-size: 10px;
  color: #475569;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}
.shop-card-thumbnail {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  display: block;
  transition: transform 0.3s ease;
}
.shop-card:hover .shop-card-thumbnail {
  transform: scale(1.03);
}

/* ── Card Footer ──────────────────────────────────────────────────────── */
.shop-card-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.shop-btn-buy {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border: 2px solid;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(249,115,22,0.1));
  border-color: #fbbf24;
  color: #fbbf24;
  text-transform: uppercase;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.shop-btn-buy:hover:not(:disabled),
.shop-btn-buy:active:not(:disabled) {
  background: linear-gradient(135deg, rgba(251,191,36,0.3), rgba(249,115,22,0.2));
  box-shadow: 0 0 20px rgba(251,191,36,0.3);
  transform: scale(1.02);
}
.shop-btn-disabled {
  border-color: rgba(239,68,68,0.5) !important;
  color: #ef4444 !important;
  background: rgba(239,68,68,0.05) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}
.shop-btn-owned {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 2px solid rgba(34,197,94,0.5);
  color: #22c55e;
  background: rgba(34,197,94,0.08);
  cursor: default;
  text-transform: uppercase;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Detail Preview Overlay - Mobile First ────────────────────────────── */
.pack-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 15, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  opacity: 0;
  transition: opacity 0.3s ease;
}
@media (min-width: 600px) {
  .pack-preview-overlay {
    padding: 20px;
  }
}
.pack-preview-overlay.active {
  display: flex;
  opacity: 1;
}

.pack-preview-content {
  background: linear-gradient(145deg, #16161e, #1a1a28);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 800px;
  max-height: calc(92dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  padding: 18px 14px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@media (min-width: 600px) {
  .pack-preview-content {
    border-radius: 16px;
    padding: 28px 24px;
  }
}
.pack-preview-overlay.active .pack-preview-content {
  transform: translateY(0);
}

.preview-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  touch-action: manipulation;
}
@media (min-width: 600px) {
  .preview-close-btn {
    top: 16px;
    right: 16px;
  }
}
.preview-close-btn:hover,
.preview-close-btn:active {
  background: #ef4444;
  border-color: #ef4444;
  transform: scale(1.08);
}

.preview-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
@media (min-width: 600px) {
  .preview-header {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
  }
}
.preview-icon {
  font-size: 40px;
  line-height: 1;
}
.preview-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  padding-right: 44px;
}
@media (min-width: 600px) {
  .preview-title {
    padding-right: 0;
  }
}
.preview-desc {
  color: #94a3b8;
  font-size: clamp(12.5px, 3vw, 15px);
  margin-top: 4px;
}
.preview-long-desc {
  color: #cbd5e1;
  font-size: clamp(12.5px, 3vw, 14px);
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.preview-canvas-wrapper {
  background: #000;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.05);
}
@media (min-width: 600px) {
  .preview-canvas-wrapper {
    padding: 10px;
    margin-bottom: 24px;
  }
}
.preview-canvas-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 700;
}
#preview-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 1;
  border-radius: 8px;
  display: block;
}

.preview-vehicles {
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .preview-vehicles {
    padding: 16px;
    margin-bottom: 24px;
  }
}
.preview-vehicles-title {
  font-size: 12px;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 10px;
}
.preview-vehicles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-vehicle-tag {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  color: #f1f5f9;
}

.preview-action-container {
  display: flex;
  justify-content: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 600px) {
  .preview-action-container {
    justify-content: flex-end;
    padding-top: 18px;
  }
}
.preview-action-container .btn {
  width: 100%;
  font-size: 13.5px;
  padding: 12px 18px;
  min-height: 48px;
}
@media (min-width: 600px) {
  .preview-action-container .btn {
    width: auto;
    font-size: 15px;
    padding: 14px 28px;
  }
}
