* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #eef2ff;
  color: #1f2937;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: #1e293b;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
}

.main-nav a {
  color: #e2e8f0;
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.95rem;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  padding: 56px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3.5rem);
  margin: 0 0 18px;
  line-height: 1.05;
}

.hero-copy p {
  font-size: 1.05rem;
  margin-bottom: 24px;
  max-width: 620px;
  line-height: 1.7;
}

.button {
  display: inline-block;
  padding: 14px 26px;
  background: #4338ca;
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-book {
  width: 260px;
  height: 360px;
  border-radius: 30px;
  padding: 28px;
  color: white;
  background: linear-gradient(145deg, #2563eb, #0284c7);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
  user-select: none;
  pointer-events: none;
}

.hero-book span {
  display: block;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.book-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #f8fafc;
}

/* Ensure image containers do not force huge layout and keep ratio on narrow screens */
@media (max-width: 900px) {
  .book-image {
    max-height: 50vh;
  }
}

.admin-page {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px 48px;
}

.admin-panel,
.admin-list {
  background: white;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}

.admin-panel h1,
.admin-list h2 {
  margin-top: 0;
}

.admin-dashboard {
  display: grid;
  gap: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 24px;
  align-items: start;
}

.admin-main-card,
.admin-sidebar-card,
.design-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 24px;
}

.card-header h1 {
  font-size: 1.85rem;
  margin-bottom: 8px;
}

.card-header p,
.sidebar-note {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 20px;
}

.admin-sidebar {
  display: grid;
  gap: 24px;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.admin-form label {
  display: grid;
  gap: 10px;
  font-weight: 600;
  color: #334155;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  font: inherit;
  background: #f8fafc;
}

.admin-form button {
  width: fit-content;
  padding: 14px 24px;
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.button-primary {
  background: #4338ca;
}

.button-secondary {
  background: #0f172a;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.design-card {
  display: grid;
  gap: 16px;
}

.design-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
}

.design-card-body h3 {
  margin: 0 0 8px;
}

.design-card-body p {
  margin: 0;
  color: #475569;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: #334155;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  font: inherit;
}

.admin-form button {
  width: fit-content;
  padding: 14px 24px;
  color: white;
  background: #4338ca;
  border: none;
  border-radius: 16px;
  cursor: pointer;
}

.cart-link {
  display: inline-block;
  margin-left: 12px;
  padding: 8px 12px;
  background: #10b981;
  color: white;
  border-radius: 12px;
  text-decoration: none;
}

.alert {
  padding: 14px 18px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.alert.success {
  background: #d1fae5;
  color: #065f46;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.admin-cards {
  display: grid;
  gap: 18px;
}

.slider {
  position: relative;
  overflow: hidden;
  background: #f8fafc;
  aspect-ratio: 330 / 215;
  max-height: 60vh;
  display: grid;
  place-items: center;
}
.slider .slide {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.slider button.slide-prev,
.slider button.slide-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
}
.slider button.slide-prev {
  left: 12px;
}
.slider button.slide-next {
  right: 12px;
}

.admin-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  align-items: center;
}

.admin-book-image {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  object-fit: cover;
}

.admin-card-body h3 {
  margin-top: 0;
}

.db-warning {
  max-width: 1200px;
  margin: 24px auto;
  padding: 18px 22px;
  background: #fef9c3;
  color: #92400e;
  border-radius: 18px;
}

.book-cover {
  min-height: 320px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  transition: background 0.35s ease;
  user-select: none;
}

.cover-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cover-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: white;
  line-height: 1.1;
}

.cover-author {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.design-classic {
  background: linear-gradient(180deg, #7c3aed 0%, #000000 100%);
  background-image:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.15) 0%,
      transparent 26%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 80%);
}

.design-modern {
  background: linear-gradient(180deg, #0f172a 0%, #3b82f6 100%);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.08) 0 12px,
    transparent 12px 24px
  );
}

.design-minimal {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
  color: #0f172a;
}

.design-minimal .cover-tag {
  background: rgba(15, 23, 42, 0.09);
  color: #0f172a;
}

.product-info {
  padding: 24px;
}

.product-info h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.product-meta {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #475569;
  margin: 0 0 18px;
}

.price {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.design-label {
  color: #334155;
  font-weight: 600;
  margin-bottom: 10px;
}

.design-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.design-option {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.design-option.active,
.design-option:hover {
  border-color: #4338ca;
  background: #4338ca;
  color: white;
}

.buy-button {
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  border: none;
  background: #4338ca;
  color: white;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.steps-section {
  padding: 48px 32px 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.steps-section h2 {
  text-align: center;
  margin-bottom: 28px;
  font-size: 2rem;
}

.steps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step-card {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.step-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.site-footer {
  text-align: center;
  padding: 24px 32px;
  color: #64748b;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 20px;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    margin-top: 12px;
  }

  .main-nav a {
    margin-left: 0;
    margin-right: 18px;
  }
}
