:root {
  --primary: #004B5C;
  --primary-dark: #003845;
  --background: #ffffff;
  --text: #1f2d33;
  --muted: #6b7b83;
  --border: #d9e3e7;
  --card-shadow: 0 8px 24px rgba(0, 75, 92, 0.08);
  --card-shadow-hover: 0 12px 32px rgba(0, 75, 92, 0.14);
  --radius: 16px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

/*
.site-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.2px;
}*/

.nav-menu {
  display: flex;
  gap: 12px;
}

.nav-button {
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.25s ease;
  background: #ffffff;
}

.nav-button:hover,
.nav-button.active {
  background: var(--primary);
  color: #ffffff;
}

/* Hero */
.hero {
  padding: 72px 0 36px;
  background:
    linear-gradient(to bottom, rgba(0, 75, 92, 0.04), rgba(255, 255, 255, 0));
}

.hero-content {
  text-align: center;
  max-width: 760px;
}

.hero h2 {
  margin: 0 0 16px;
  font-size: 2.4rem;
  color: var(--primary);
  font-weight: 700;
}

.hero p {
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

/* Controls */
.controls-section {
  padding: 12px 0 8px;
}

.controls-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 2px 10px rgba(0, 75, 92, 0.04);
}

.sort-group label {
  color: var(--primary);
  font-weight: 600;
}

.sort-group select {
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

/* Books */
.books-section {
  padding: 32px 0 80px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.book-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
}

.book-image-wrap {
  background: linear-gradient(180deg, rgba(0, 75, 92, 0.06), rgba(0, 75, 92, 0.02));
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

.book-image {
  width: 100%;
  max-width: 220px;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

.book-content {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-title {
  margin: 0 0 8px;
  font-size: 1.28rem;
  color: var(--primary);
  line-height: 1.3;
}

.book-price {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 600;
}

.book-category {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

.book-description {
  margin: 0 0 22px;
  color: var(--text);
  font-size: 0.96rem;
  flex-grow: 1;
}

.book-link {
  display: inline-block;
  text-align: center;
  background: var(--primary);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.2s ease;
}

.book-link:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.footer-container {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Empty/Error states */
.message-box {
  grid-column: 1 / -1;
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: rgba(0, 75, 92, 0.02);
}

/* Responsive */
@media (max-width: 992px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h2 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-menu {
    width: 100%;
    flex-wrap: wrap;
  }

  .controls-container {
    justify-content: flex-start;
  }

  .sort-group {
    width: 100%;
    justify-content: space-between;
    border-radius: 14px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-content {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .books-grid {
    grid-template-columns: 1fr;
  }

  .site-title {
    font-size: 1.35rem;
  }

  .hero h2 {
    font-size: 1.7rem;
  }

  .book-image-wrap {
    min-height: 280px;
  }

  .book-image {
    height: 260px;
  }
}

/* Contact Page */
.contact-section {
  padding: 32px 0 80px;
}

.contact-card {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 32px;
}

.contact-card-header {
  margin-bottom: 24px;
}

.contact-card-header h3 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 1.5rem;
}

.contact-card-header p {
  margin: 0;
  color: var(--muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: var(--primary);
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 75, 92, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 180px;
}

.contact-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}

.submit-button {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}

.submit-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.form-status {
  min-height: 24px;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-status.success {
  color: var(--primary);
  font-weight: 600;
}

.form-status.error {
  color: #b3261e;
  font-weight: 600;
}

@media (max-width: 768px) {
  .contact-card {
    padding: 22px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}