/* ============================================================
   Ediciones Lola Mento — Estilos
   ============================================================ */

:root {
  --color-bg: #faf9f6;
  --color-text: #2c2c2c;
  --color-text-light: #666;
  --color-accent: #8b5cf6;
  --color-accent-hover: #7c3aed;
  --color-surface: #ffffff;
  --color-border: #e5e5e5;
  --font-body: "Georgia", "Times New Roman", serif;
  --font-heading: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max-width: 960px;
  --radius: 8px;
}

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

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header ------------------------------------------------------------ */

header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

header h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header h1 a {
  color: var(--color-text);
  text-decoration: none;
}

header p {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* --- Main -------------------------------------------------------------- */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* --- Catálogo (grid de productos) -------------------------------------- */

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.product-card .card-body {
  padding: 1.2rem;
}

.product-card h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.product-card .author {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.product-card .price {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* --- Detalle de producto ----------------------------------------------- */

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

.product-detail .cover {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.product-detail .info h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.product-detail .info .author {
  color: var(--color-text-light);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.product-detail .info .description {
  font-size: 1rem;
  margin-bottom: 2rem;
}

.product-detail .info .price {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  display: block;
}

/* --- Botones ----------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* --- Página de éxito --------------------------------------------------- */

.success-page {
  text-align: center;
  padding: 3rem 1rem;
}

.success-page h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #16a34a;
}

.success-page p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-light);
}

.success-page .btn {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
}

/* --- Error / loading --------------------------------------------------- */

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-light);
}

.error-msg {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
}

/* --- Footer ------------------------------------------------------------ */

footer {
  text-align: center;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 0.85rem;
}

footer a {
  color: var(--color-accent);
  text-decoration: none;
}

/* --- Formato journamee badge ------------------------------------------- */

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-text-light);
  background: #f3f0ff;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 640px) {
  header h1 {
    font-size: 1.4rem;
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-detail .cover {
    max-width: 300px;
    margin: 0 auto;
  }

  .catalog {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }
}
