/* PlayWithD — Mobile-first web store */

:root {
  --bg: #f0ece4;
  --surface: rgba(255, 255, 255, 0.5);
  --surface-hover: rgba(255, 255, 255, 0.7);
  --border: rgba(74, 155, 158, 0.35);
  --text: #2c2c2c;
  --text-muted: #666;
  --accent: #4a9b9e;
  --accent-hover: #3d8588;
  --accent-light: rgba(74, 155, 158, 0.12);
  --navy: #1e3340;
  --success: #4a9b9e;
  --danger: #c44;
  --radius: 12px;
  --max-w: 600px;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px; /* sticky search bar clearance */
}

/* ── Header ──────────────────────────────────────────────────────── */

header {
  border-bottom: 3px solid var(--accent);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent);
}

/* ── Main ────────────────────────────────────────────────────────── */

main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 48px 0 24px;
}
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 10px;
  color: var(--navy);
}
.accent { color: var(--accent); }
.tagline {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.price-hint {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}

/* ── Sticky search bar ────────────────────────────────────────────── */

.sticky-search {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--navy);
  border-top: 2px solid var(--accent);
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.sticky-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sticky-pills {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.sticky-pills .pill {
  border-color: rgba(240, 236, 228, 0.25);
  color: rgba(240, 236, 228, 0.6);
}
.sticky-pills .pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sticky-box {
  display: flex;
  flex: 1;
  gap: 6px;
}
.sticky-box input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid rgba(240, 236, 228, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #f0ece4;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.sticky-box input:focus { border-color: var(--accent); }
.sticky-box input::placeholder { color: rgba(240, 236, 228, 0.4); }
.sticky-box button {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.sticky-box button:hover { background: var(--accent-hover); }
.sticky-box button:disabled { opacity: 0.5; cursor: not-allowed; }
.pill {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

/* ── Search feedback toast (above sticky bar) ────────────────────── */

.search-toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 201;
  max-width: var(--max-w);
  width: calc(100% - 40px);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
  animation: toast-in 0.25s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.search-toast.success {
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.search-toast.error {
  background: #fff;
  color: var(--danger);
  border: 2px solid var(--danger);
}
.search-toast.info {
  background: #fff;
  color: var(--text-muted);
  border: 2px solid var(--border);
}

/* ── Popular songs ────────────────────────────────────────────────── */

.popular-section {
  padding: 0 0 28px;
}
.popular-section h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.popular-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.popular-grid::-webkit-scrollbar { display: none; }
.popular-grid .popular-card {
  scroll-snap-align: start;
  min-width: 200px;
  flex-shrink: 0;
}
.popular-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.popular-card:hover { border-color: var(--accent); }
.pop-info {
  flex: 1;
  min-width: 0;
}
.pop-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pop-artist {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pop-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.pop-btns button {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pop-btns button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Songs section (replaces cart drawer) ─────────────────────────── */

.songs-section {
  padding: 8px 0 40px;
}
.songs-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.songs-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}
.per-song-hint {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* Song items */
.songs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.song-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.song-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.song-item-artist {
  font-size: 13px;
  color: var(--text-muted);
}
.song-item-inst {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.remove-btn:hover { opacity: 1; }

/* ── Live pricing bar ─────────────────────────────────────────────── */

.pricing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--navy);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.pricing-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.pricing-total {
  font-size: 24px;
  font-weight: 800;
  color: #f0ece4;
}
.pricing-detail {
  font-size: 13px;
  color: rgba(240, 236, 228, 0.6);
}
.pricing-savings {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 10px;
}

.add-more-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Inline checkout ──────────────────────────────────────────────── */

.checkout-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.checkout-inline .cart-email {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.35);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 0;
}
.checkout-inline .cart-email:focus { border-color: var(--accent); }
.checkout-inline .cart-email::placeholder { color: var(--text-muted); }
.checkout-btn {
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.checkout-btn:hover:not(:disabled) { background: var(--accent-hover); }
.checkout-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── What you get (compact strip) ─────────────────────────────────── */

.wyg-section {
  padding: 0 0 20px;
}
.wyg-section h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 10px;
}
.wyg-strip {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.wyg-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.wyg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* Preview */
.preview-area {
  text-align: center;
}
.preview-label {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 10px;
}
.preview-images {
  margin-bottom: 10px;
}
.preview-img {
  max-width: 220px;
  width: 100%;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.preview-toggle {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.pill.small {
  padding: 5px 14px;
  font-size: 12px;
}

/* ── Subscribe / CTA section ──────────────────────────────────────── */

.subscribe-section {
  text-align: center;
  padding: 32px 0 40px;
  border-top: 2px solid var(--border);
  margin-top: 20px;
}
.subscribe-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}
.inline-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}
.inline-link:hover { opacity: 0.7; }

/* ── Success page ─────────────────────────────────────────────────── */

.success-page {
  text-align: center;
  padding: 80px 20px;
}
.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-page h1 {
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--navy);
}
.success-page p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.muted { font-size: 14px !important; }
.btn-back {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
}

/* ── Footer ───────────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 2px solid var(--border);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.tiktok-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}
.tiktok-link:hover { opacity: 0.7; }

/* ── Spinner ──────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ──────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .tagline { font-size: 14px; }
  .pricing-bar { flex-direction: column; gap: 8px; align-items: flex-start; }
  .checkout-inline { flex-direction: column; }
  .song-item-info { flex-direction: column; gap: 2px; }
  .popular-grid .popular-card { min-width: 170px; }
  .sticky-inner { flex-direction: row; }
  .sticky-pills { flex-direction: column; gap: 2px; }
  .sticky-pills .pill { padding: 4px 10px; font-size: 11px; }
}
