@font-face {
  font-family: 'Cooper Hewitt';
  src: url('../font/CooperHewitt-WebFonts-public/CooperHewitt-Book.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Cooper Hewitt';
  src: url('../font/CooperHewitt-WebFonts-public/CooperHewitt-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Cooper Hewitt';
  src: url('../font/CooperHewitt-WebFonts-public/CooperHewitt-Semibold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Cooper Hewitt';
  src: url('../font/CooperHewitt-WebFonts-public/CooperHewitt-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

:root {
  --primary: #1A3263;
  --secondary: #547792;
  --accent: #FAB95B;
  --bg: #E8E2DB;
  --text: #1A3263;
  --green: #FAB95B;
  /* Overridden to fit strict palette */
  --orange: #FAB95B;
  /* Overridden to fit strict palette */
  --border: #547792;
}

body {
  font-family: 'Cooper Hewitt', 'Inter', sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text);
  /* Sticky Footer Logic */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Nav */
nav {
  background: var(--primary);
  padding: 15px 20px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--bg);
}

.nav-links {
  display: flex;
  gap: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--bg);
}

.nav-item:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Layout */
/* Layout */
.container,
.view-section {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 15px;
  flex: 1;
  /* Pushes content to expand, keeping footer at bottom */
  width: 100%;
  /* Ensure it takes full width within max-width */
  box-sizing: border-box;
}

.btn {
  background: var(--accent);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
}

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

.btn-buy {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn-buy:hover {
  background: var(--secondary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--primary);
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 10px;
  background: transparent;
}

/* Category Pills */
.category-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  margin-bottom: 20px;
  scrollbar-width: none;
  /* Firefox */
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

/* Chrome/Safari */

.pill {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  transition: all 0.2s;
}

.pill.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* Status & Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--border);
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
}

.status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-PendingDeposit {
  background: var(--accent);
  color: var(--primary);
}

.status-VerifyingDeposit {
  background: var(--secondary);
  color: var(--bg);
}

.status-Ordered {
  background: var(--primary);
  color: var(--bg);
}

.status-Shipped {
  background: var(--secondary);
  color: var(--bg);
}

/* Progress Bar */
.progress-track {
  display: flex;
  margin-bottom: 20px;
}

.step {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  position: relative;
  color: var(--secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step i {
  font-size: 32px;
  margin-bottom: 8px;
  transition: color 0.3s, text-shadow 0.3s;
}

.step.glow i {
  color: var(--green);
  text-shadow: 0 0 10px var(--green);
  animation: pulse-glow 1.5s infinite alternate;
}

@keyframes pulse-glow {
  from {
    text-shadow: 0 0 5px var(--green);
  }

  to {
    text-shadow: 0 0 15px var(--green), 0 0 25px var(--green);
  }
}

.step.active {
  color: var(--primary);
  font-weight: bold;
}

.step.active.glow {
  color: var(--accent);
}

/* Connectors */
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 6px;
  background-image: radial-gradient(circle, var(--secondary) 2.5px, transparent 3px);
  background-size: 15px 15px;
  background-repeat: repeat-x;
  background-position: center;
  z-index: 0;
}

.step i,
.step div {
  position: relative;
  z-index: 2;
  /* Keep icon and text above dots */
  background: white;
  /* Optional: clears dots behind icon */
}

/* Completed Connector means the line AFTER this step is colored */
.step.completed:not(:last-child)::after {
  background-image: radial-gradient(circle, var(--primary) 3px, transparent 3.5px);
}

/* Glowing Connector */
.step.glow:not(:last-child)::after {
  background-image: radial-gradient(circle, var(--green) 3px, transparent 3.5px);
  animation: pulse-dots 1.5s infinite alternate;
}

@keyframes pulse-dots {
  from {
    opacity: 0.6;
  }

  to {
    opacity: 1;
  }
}

.step.completed {
  color: var(--green);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 50, 99, 0.7);
  /* --primary with opacity */
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg);
  padding: 30px;
  border: 2px solid var(--border);
  border-radius: 4px;
  max-width: 450px;
  width: 90%;
  position: relative;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.view-section {
  display: none;
}

#view-shop {
  display: block;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-item {
    padding: 5px 10px;
  }

  .container {
    margin: 15px auto;
    padding: 0 10px;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
    /* 2 items per row on mobile */
    gap: 10px;
  }

  .card {
    padding: 10px;
  }

  .card img {
    height: 140px;
  }

  /* Make inputs larger for touch */
  input,
  button,
  select,
  textarea {
    font-size: 16px !important;
  }

  .modal-content {
    padding: 20px;
    width: 95%;
  }

  /* Scrollable Tables */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr;
    /* 1 item per row on very small screens */
  }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--primary);
  color: var(--bg);
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left: 4px solid var(--accent);
}

.toast-error {
  border-left: 4px solid var(--secondary);
}

.toast-info {
  border-left: 4px solid var(--accent);
}

@media (max-width: 600px) {
  #toast-container {
    bottom: 15px;
    left: 15px;
    right: 15px;
    align-items: center;
    /* Center horizontally */
  }

  .toast {
    width: 100%;
    max-width: none;
    justify-content: center;
  }
}

/* Gallery Styles */
.gallery-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.main-image {
  width: 100%;
  height: 300px;
  object-fit: contain;
  border-radius: 8px;
}

.thumb-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumb.active {
  border-color: var(--primary);
}

.description-box {
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* JKantner Style Book Loader */
#page-loader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(232, 226, 219, 0.95);
  /* --bg with opacity */
  z-index: 99999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 30px;
}

#page-loader p {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-align: center;
}

.book-shelf {
  width: 120px;
  height: 140px;
}

@keyframes book-bounce {
  0% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  80% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes shelf-lift {
  0% {
    transform: translateY(0) rotate(0);
  }

  20% {
    transform: translateY(-4px) rotate(10deg);
  }

  40% {
    transform: translateY(-4px) rotate(0);
  }

  40% {
    transform: translateY(-4px) rotate(-10deg);
  }

  80% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(0);
  }
}

.book-shelf__book {
  animation: book-bounce 1.5s ease infinite;
}

.book-shelf__book--two {
  animation-delay: 0.1s;
}

.book-shelf__book--three {
  animation-delay: 0.2s;
}

.book-shelf__shelf {
  animation: shelf-lift 1.5s ease infinite;
  transform-origin: 50% 50%;
}