/* Color Palette - Modern Purple Theme */
/* Primary: #6c63ff (purple) */
/* Secondary: #0078d4 (blue) */
/* Success: #28a745 (green) */
/* Warning: #ffc107 (yellow) */
/* Danger: #dc3545 (red) */
/* Light: #f8f9fa (light gray) */
/* Dark: #343a40 (dark gray) */

/* Product panel styling for t-shirts, matching original story panel size */
.product {
  background: #fff;
  border-radius: 1em;
  box-shadow: 0 2px 8px #0002;
  padding: 1em;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: box-shadow 0.2s;
  margin-bottom: 0.5em;
}
.product:hover {
  box-shadow: 0 4px 16px #6c63ff33;
}
.product-images {
  display: flex;
  gap: 0.5em;
  justify-content: center;
  margin-bottom: 0.5em;
}
.product-images img {
  width: 90px;
  height: 110px;
  object-fit: cover;
  border-radius: 0.5em;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}
.product h3 {
  font-size: 1em;
  margin: 0.4em 0 0.2em 0;
  text-align: center;
}
.product-desc {
  text-align: center;
  font-size: 0.95em;
  color: #6c757d;
  margin: 0.2em 0 0.3em 0;
}
.product-price {
  color: #6c63ff;
  font-weight: bold;
  text-align: center;
  margin: 0.1em 0 0.5em 0;
}
.product button {
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 1em;
  padding: 0.4em 1em;
  font-size: 0.98em;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.2s;
}
.product button:hover {
  background: #b388ff;
}
@media (max-width: 600px) {
  .product {
    width: calc(100% - 2em);
    max-width: calc(100% - 2em);
    margin: 0 auto 0.5em auto;
    border-radius: 0.5em;
  }
  .product-images img {
    width: 30vw;
    height: 35vw;
    min-width: 80px;
    min-height: 90px;
    max-width: 120px;
    max-height: 140px;
  }
}
/* Secondary buttons (outline style) */
.btn-outline-primary, #tnc-btn, #contact-btn, .view-cart-btn, #view-cart-btn {
  background: #fff;
  color: #6c63ff;
  border: 2px solid #6c63ff;
  border-radius: 2em;
  padding: 0.5em 1.5em;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 8px #0001;
  transition: background 0.2s, color 0.2s;
}
.btn-outline-primary:hover, #tnc-btn:hover, #contact-btn:hover, .view-cart-btn:hover, #view-cart-btn:hover {
  background: #6c63ff;
  color: #fff;
}
body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: #f8f9fa;
  margin: 0;
  color: #343a40;
}
header {
  background: linear-gradient(90deg, #6ec6ff 0%, #b388ff 100%);
  color: #fff;
  padding: 2rem 0 1rem 0;
  text-align: center;
  box-shadow: 0 2px 8px #0001;
}
/* Centered, modern font for story descriptions */
.story-description {
  text-align: center;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.98em;
  margin: 1em 0;
}
.category h2 {
  margin-left: 1em;
  color: #6c63ff;
}
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  justify-content: flex-start;
  padding: 1em;
}
.book {
  background: #fff;
  border-radius: 1em;
  box-shadow: 0 2px 8px #0002;
  padding: 1em;
  width: 400px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: box-shadow 0.2s;
}
.book:hover {
  box-shadow: 0 4px 16px #6c63ff33;
}
.book img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5em;
  margin-bottom: 0.5em;
  display: block;
}
.book h3 {
  font-size: 1.1em;
  margin: 0.5em 0 0.2em 0;
  text-align: center;
}
.book p {
  color: #6c63ff;
  font-weight: bold;
  margin: 0.2em 0 0.5em 0;
}
.book button {
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 1em;
  padding: 0.5em 1.2em;
  font-size: 1em;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.2s;
}
.book button:hover {
  background: #b388ff;
}
#cart-modal {
  min-width: 320px;
  max-width: 90vw;
  border-radius: 1em;
  box-shadow: 0 8px 32px #6c63ff33;
  background: #fff;
  padding: 2em 2em 1.5em 2em;
  z-index: 100;
  text-align: left;
  min-height: 400px !important;
  overflow: auto !important;
}
#cart-modal h2 {
  margin-top: 0;
  color: #6c63ff;
}
#cart-items {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}
#cart-items li {
  padding: 0.3em 0;
  border-bottom: 1px solid #eee;
}
#checkout-btn {
  background: #43a047;
  color: #fff;
  border: none;
  border-radius: 1em;
  padding: 0.7em 2em;
  font-size: 1.1em;
  cursor: pointer;
  margin-top: 1em;
  transition: background 0.2s;
}
#checkout-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
#checkout-btn:hover:not(:disabled) {
  background: #388e3c;
}
#close-cart-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 1.5em;
  cursor: pointer;
  float: right;
  margin-top: -1em;
  margin-right: -1em;
  transition: color 0.2s;
}
#close-cart-btn:hover {
  color: #6c63ff;
}
.hidden {
  display: none;
}
@media (max-width: 600px) {
  .grid {
    flex-direction: column;
    gap: 1em;
    width: 100%;
    max-width: 100%;
    padding: 1em;
    margin: 0;
    box-sizing: border-box;
  }
  .book {
    width: calc(100vw - 2.4em);
    max-width: calc(100vw - 2.4em);
    border-radius: 0.5em;
    padding: 1em;
    margin: 0 auto;
    box-sizing: border-box;
  }
  #cart-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100vw - 2em) !important;
    max-width: calc(100vw - 2em) !important;
    min-width: auto !important;
    border-radius: 1em !important;
    padding: 1.5em !important;
    box-sizing: border-box;
    max-height: calc(100vh - 4em) !important;
    overflow-y: auto !important;
    z-index: 10001 !important;
  }
  
}

/* Mobile header buttons - prevent overlap with title */
@media (max-width: 600px) {
  /* Make header much more compact on mobile */
  header {
    padding: 0.8rem 0 0.5rem 0 !important;
  }
  
  /* Make header title smaller on mobile */
  header h1 {
    font-size: 1.8rem !important;
    margin: 0 !important;
  }
  
  /* Header buttons mobile positioning - move below header */
  .header-buttons {
    position: static !important;
    display: flex !important;
    justify-content: center !important;
    gap: 0.4em !important;
    margin: 0.3em auto 0.8em auto !important;
    padding: 0 1em !important;
    flex-wrap: wrap !important;
    order: -1; /* Move buttons before intro text */
  }
  
  /* Make header buttons smaller and more mobile-friendly */
  .view-cart-btn, #view-cart-btn, #contact-btn, #tnc-btn {
    padding: 0.3em 0.8em !important;
    font-size: 0.85rem !important;
    border-radius: 1.5em !important;
  }
  
  /* Adjust intro text spacing */
  b[style*="font-size:1.2em"] {
    margin-top: 0 !important;
    font-size: 1.1em !important;
  }
  
  /* Fix product modal on mobile - only when it should be visible */
  #product-modal:not([style*="display: none"]) {
    display: flex !important;
    align-items: flex-start !important;
    padding: 1em 0 !important;
    z-index: 9999 !important;
  }
  
  /* Ensure product modal is properly hidden */
  #product-modal[style*="display: none"] {
    display: none !important;
  }
  
  #product-modal-content {
    margin: 1em auto !important;
    max-height: calc(100vh - 2em) !important;
    overflow-y: auto !important;
    width: calc(100vw - 3em) !important;
    max-width: calc(100vw - 3em) !important;
    box-sizing: border-box !important;
  }
  
  /* Make the 3 product images fit horizontally in modal */
  #product-modal-images {
    gap: 0.3em !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
  }
  
  #product-modal-images .modal-img-thumb {
    width: calc(33.333% - 0.2em) !important;
    max-width: calc(33.333% - 0.2em) !important;
    min-width: calc(33.333% - 0.2em) !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 3/4 !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
  }
}

/* Filter styling */
.filters {
  text-align: center;
  margin: 1.5em 0;
  padding: 1em;
  background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%);
  border-radius: 1em;
  box-shadow: 0 2px 12px #0001;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
}

.filters label {
  font-weight: 600;
  color: #495057;
  margin: 0;
  font-size: 1em;
}

.filters select {
  padding: 0.5em 1em;
  border: 2px solid #dee2e6;
  border-radius: 0.8em;
  background: #fff;
  color: #495057;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px #0001;
  min-width: 120px;
}

.filters select:hover {
  border-color: #6c63ff;
  box-shadow: 0 2px 8px #6c63ff33;
}

.filters select:focus {
  outline: none;
  border-color: #6c63ff;
  box-shadow: 0 0 0 3px #6c63ff22;
}

@media (max-width: 600px) {
  .filters {
    flex-direction: column;
    gap: 0.5em;
    padding: 0.8em;
  }
  
  .filters select {
    min-width: 100%;
    max-width: 280px;
  }
}
