/* ===== STORE CSS — Audio Opowieści Web Store ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --gold: #d4a857;
  --gold-dark: #b8860b;
  --dark-bg: #0f0f23;
  --dark-card: #1a1a2e;
  --dark-card-hover: #16213e;
  --text-light: #f5f5f5;
  --text-muted: #a0a0b0;
  --danger: #ef5350;
  --success: #66bb6a;
  --radius: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--dark-bg);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* NAV */
.store-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 168, 87, 0.15);
}
.store-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
}
.store-nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
#nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-username {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* LANGUAGE SWITCHER */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: rgba(212, 168, 87, 0.1);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid rgba(212, 168, 87, 0.2);
}
.lang-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.lang-btn:hover {
  color: var(--gold);
  background: rgba(212, 168, 87, 0.15);
}
.lang-btn.active {
  background: var(--gold);
  color: var(--dark-bg);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}
.btn-gold {
  background: var(--gold);
  color: var(--dark-bg);
}
.btn-gold:hover {
  background: var(--gold-dark);
}
.btn-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover {
  background: rgba(212, 168, 87, 0.1);
}
.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 14px;
}
.btn-danger {
  background: var(--danger);
  color: white;
}

/* HERO */
.store-hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: linear-gradient(
    180deg,
    rgba(212, 168, 87, 0.08) 0%,
    transparent 100%
  );
}
.store-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.store-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* HOW IT WORKS */
.how-it-works {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto 1.5rem;
  flex-wrap: wrap;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--dark-card);
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 168, 87, 0.2);
}
.step-num {
  background: var(--gold);
  color: var(--dark-bg);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.step-text {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.95rem;
}
.step-arrow {
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 700;
}
@media (max-width: 600px) {
  .step-arrow {
    display: none;
  }
  .how-it-works {
    gap: 0.5rem;
  }
  .step {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
}

.badge {
  background: var(--dark-card);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(212, 168, 87, 0.15);
}

/* MAIN */
.store-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* LANGUAGE SWITCHER LABEL */
.lang-switcher-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  margin-right: 4px;
}

/* BOOK LANGUAGE */
.book-lang-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 0.5rem;
}
.book-lang-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}
.book-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(212, 168, 87, 0.12);
  border: 1px solid rgba(212, 168, 87, 0.25);
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.5rem;
}
.book-lang .lang-flag {
  font-size: 1rem;
}
.book-detail-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(212, 168, 87, 0.12);
  border: 1px solid rgba(212, 168, 87, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  margin-bottom: 1rem;
}
.book-detail-lang .lang-flag {
  font-size: 1.3rem;
}

/* GRID */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* BOOK CARD */
.book-card {
  background: var(--dark-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.book-cover {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.book-cover-emoji {
  font-size: 4rem;
}
.book-cover-title {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-info {
  padding: 1rem;
}
.book-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}
.book-info .author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.book-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.book-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
}
.book-price-free {
  color: var(--success);
}

/* PREVIEW BUTTON */
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 168, 87, 0.1);
  border: 1px solid rgba(212, 168, 87, 0.3);
  color: var(--gold);
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.preview-btn:hover {
  background: rgba(212, 168, 87, 0.2);
}

/* BOOK DETAIL MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--dark-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(212, 168, 87, 0.15);
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-detail-modal {
  max-width: 650px;
}
.book-detail-cover {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.book-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-detail-cover .book-cover-emoji {
  font-size: 5rem;
}
.book-detail-body {
  padding: 1.5rem;
}
.book-detail-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.book-detail-body .author {
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.book-detail-body .description {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.book-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.book-detail-meta .badge {
  font-size: 0.8rem;
}
.book-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
}
.book-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.purchase-owned {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem;
  background: rgba(102, 187, 106, 0.1);
  border-radius: 10px;
}
.book-owned-badge {
  color: var(--success);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  background: rgba(102, 187, 106, 0.1);
  border-radius: 8px;
  margin-top: 0.25rem;
}
.payment-pending {
  text-align: center;
  padding: 1rem;
  color: var(--gold);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* AUTH MODAL */
.auth-modal {
  max-width: 420px;
  padding: 2rem;
}
.auth-modal h2 {
  font-family: var(--font-display);
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-align: center;
}
.auth-modal .subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.form-group input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--dark-bg);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-light);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus {
  border-color: var(--gold);
}
.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  display: none;
}
.form-switch {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.form-switch a {
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
}

/* AUDIO PLAYER */
.mini-player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.mini-player button {
  background: var(--gold);
  border: none;
  color: var(--dark-bg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-player .progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.mini-player .progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.3s;
}
.mini-player .time {
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 3rem;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}
.empty-state a {
  color: var(--gold);
}

/* LOADING */
.loading-spinner {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* FOOTER */
.store-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0;
}
.store-footer a {
  color: var(--gold);
}

/* ===== APP DOWNLOAD BANNER ===== */
.app-banner {
  position: relative;
  overflow: hidden;
  margin-top: 4rem;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #0a0a1a 0%, #16213e 50%, #0f0f23 100%);
  border-top: 1px solid rgba(212, 168, 87, 0.2);
}
.app-banner-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.app-banner-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}
.app-banner-glow.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--gold);
  top: -150px;
  left: -100px;
  animation: bannerFloat 20s ease-in-out infinite;
}
.app-banner-glow.glow-2 {
  width: 400px;
  height: 400px;
  background: #4a7c28;
  bottom: -100px;
  right: -50px;
  animation: bannerFloat 20s ease-in-out infinite reverse;
}
@keyframes bannerFloat {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(30px, -20px);
  }
}
.app-banner-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.app-banner-badge {
  display: inline-block;
  background: rgba(212, 168, 87, 0.15);
  color: var(--gold);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(212, 168, 87, 0.25);
}
.app-banner-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--gold);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.app-banner-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.app-banner-text p strong {
  color: var(--text-light);
}
.app-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.app-features li {
  color: var(--text-light);
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.app-stores {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.store-badge-link {
  text-decoration: none;
  color: inherit;
}
.store-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1.5rem;
  border-radius: 14px;
  color: var(--text-light);
  transition: all 0.25s;
  cursor: pointer;
}
.store-badge:hover {
  background: rgba(212, 168, 87, 0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 168, 87, 0.15);
}
.store-badge small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1;
}
.store-badge strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}

/* PHONE MOCKUP */
.app-banner-visual {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}
.phone-mockup {
  width: 220px;
  background: #0a0a1a;
  border-radius: 28px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  padding: 12px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(212, 168, 87, 0.1);
  position: relative;
}
.phone-mockup::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.phone-screen {
  background: var(--dark-bg);
  border-radius: 18px;
  padding: 1.25rem 0.75rem 0.75rem;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.phone-app-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212, 168, 87, 0.15);
}
.phone-app-logo {
  font-size: 1.2rem;
}
.phone-book-item {
  display: flex;
  gap: 0.6rem;
  background: var(--dark-card);
  border-radius: 12px;
  padding: 0.65rem;
}
.phone-book-cover {
  width: 50px;
  height: 65px;
  background: linear-gradient(135deg, #1a2d4a, #0f1b2d);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.phone-book-info {
  flex: 1;
  min-width: 0;
}
.phone-book-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.3;
}
.phone-book-author {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.phone-book-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.phone-book-progress span {
  font-size: 0.6rem;
  color: var(--gold);
  font-weight: 600;
}
.phone-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.phone-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
}
.phone-player {
  margin-top: auto;
  background: var(--dark-card);
  border-radius: 14px;
  padding: 0.75rem;
  border: 1px solid rgba(212, 168, 87, 0.15);
}
.phone-player-title {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.phone-play-btn {
  width: 36px;
  height: 36px;
  background: var(--gold);
  color: var(--dark-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* QR CODES */
.qr-codes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.qr-code {
  text-align: center;
}
.qr-placeholder {
  background: var(--dark-card);
  border-radius: 14px;
  padding: 8px;
  display: inline-block;
  border: 1px solid rgba(212, 168, 87, 0.15);
}
.qr-code span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 500;
}

/* BANNER RESPONSIVE */
@media (max-width: 900px) {
  .app-banner-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .app-features {
    justify-items: center;
  }
  .app-stores {
    justify-content: center;
  }
  .app-banner-visual {
    justify-content: center;
  }
}
@media (max-width: 500px) {
  .app-features {
    grid-template-columns: 1fr;
  }
  .app-banner-visual {
    flex-direction: column;
  }
  .qr-codes {
    flex-direction: row;
    gap: 1.5rem;
  }
  .phone-mockup {
    width: 190px;
  }
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .store-nav {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .store-logo {
    font-size: 1.1rem;
  }
  .store-nav-right {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
  }
  .lang-switcher-label {
    display: none;
  }
  #nav-auth {
    display: flex;
    gap: 0.4rem;
  }
  #nav-user {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .nav-username {
    max-width: 100px;
    font-size: 0.8rem;
  }
  .btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }
  .store-hero {
    padding: 3rem 1rem 2rem;
  }
  .store-main {
    padding: 1rem;
  }
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }
}
