@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Lora:wght@400;700&family=Open+Sans:wght@300;400&display=swap');

body {
  font-family: 'Open Sans', sans-serif;
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  color: #2a2a2a;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Ensure full viewport height */
}

header {
  background-color: #ffffff;
  color: #2a2a2a;
  padding: 20px 15px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  position: relative;
}

header img {
  height: 70px;
  margin-bottom: 12px;
  transition: transform 0.4s ease-in-out;
}

header img:hover {
  transform: scale(1.08);
}

.button-container {
  display: flex;
  gap: 12px;
  padding: 20px 15px;
  justify-content: center;
}

.main-nav {
  padding: 50px 15px;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  flex-grow: 1; /* Expand to fill remaining space */
  display: flex;
  justify-content: center;
}

.main-nav a {
  display: inline-block;
  width: 210px;
  height: 62px;
  line-height: 62px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-size: 19px;
  border-radius: 12px;
  background: linear-gradient(135deg, #5a3460, #7a4b82);
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.4s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  touch-action: manipulation;
}

.main-nav a:hover {
  background: linear-gradient(135deg, #7a4b82, #5a3460);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.filter-toggle {
  padding: 12px 18px;
  background-color: #5a3460;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
  touch-action: manipulation;
  position: relative;
}

.filter-toggle:hover {
  background-color: #7a4b82;
  transform: translateY(-1px);
}

.filter-toggle[href] {
  text-decoration: none;
  display: inline-block;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 15px;
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  justify-content: center;
}

.filters.hidden {
  display: none;
}

.filters select,
.filters input {
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #dcd7d1;
  font-size: 15px;
  background: #fefefd;
  color: #2a2a2a;
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  transition: all 0.3s ease-in-out;
  width: 100%;
  max-width: 210px;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 3px rgba(0,0,0,0.06);
}

.filters select:focus,
.filters input:focus {
  border-color: #5a3460;
  box-shadow: 0 0 8px rgba(90, 52, 96, 0.2), 0 2px 3px rgba(0,0,0,0.1);
  outline: none;
}

#reset-filters {
  padding: 14px 28px;
  background: linear-gradient(135deg, #5a3460, #7a4b82);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  touch-action: manipulation;
}

#reset-filters:hover {
  background: linear-gradient(135deg, #7a4b82, #5a3460);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

#toggle-view {
  padding: 14px 22px;
  background: linear-gradient(135deg, #5a3460, #7a4b82);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  touch-action: manipulation;
}

#toggle-view:hover {
  background: linear-gradient(135deg, #7a4b82, #5a3460);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.18);
}

.search-bar {
  text-align: center;
  margin: 25px 0;
}

#search-bar {
  padding: 14px 18px;
  width: 90%;
  max-width: 420px;
  border-radius: 12px;
  border: 1px solid #dcd7d1;
  font-size: 15px;
  background: #fefefd;
  transition: all 0.3s ease-in-out;
  touch-action: manipulation;
  -webkit-appearance: none;
}

#search-bar:focus {
  border-color: #5a3460;
  box-shadow: 0 0 8px rgba(90, 52, 96, 0.2), 0 2px 3px rgba(0,0,0,0.1);
  outline: none;
}

#search-bar:hover {
  background: #f4f0ec;
  transform: translateY(-1px);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 25px 15px;
  max-width: 100%;
  margin: 0;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background-color: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.4s ease-in-out, box-shadow 0.3s ease-in-out;
  padding: 12px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 7px 15px rgba(0,0,0,0.15);
}

.card img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  transition: opacity 0.3s ease-in-out;
  border-radius: 10px;
}

.card.list-view {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 12px;
  gap: 22px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.card.list-view img {
  display: none;
}

.card.list-view h2 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  margin: 0;
  color: #5a3460;
  flex-grow: 1;
}

.card.list-view .info {
  margin: 0;
  color: #444;
  font-weight: 400;
  margin-left: auto;
}

.card h2 {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  margin: 12px 0 6px;
  color: #5a3460;
}

.info {
  font-size: 15px;
  margin: 5px 0;
  color: #444;
}

.badge {
  display: inline-block;
  background: #ead6ee;
  color: #5a3460;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 50px;
  margin: 3px 4px;
  font-weight: 400;
  font-family: 'Open Sans', sans-serif;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  background-color: #ffffff;
  margin: 15% auto;
  padding: 15px;
  border: 1px solid #e8e3de;
  width: 90%;
  max-width: 400px;
  border-radius: 15px;
  font-family: 'Open Sans', sans-serif;
  animation: fadeIn 0.4s ease-in-out;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-image {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 12px;
}

.modal-details {
  flex-grow: 1;
  padding: 8px 0;
}

.modal-details h2 {
  font-family: 'Lora', serif;
  color: #5a3460;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.modal-description {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.5;
}

.modal-details .info {
  font-size: 14px;
  margin: 5px 0;
  color: #444;
}

.close {
  color: #777;
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
}

.close:hover {
  color: #5a3460;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8e3de;
}

.nav-btn {
  background-color: #5a3460;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  width: 48%;
}

.nav-btn:hover {
  background-color: #7a4b82;
  transform: translateY(-1px);
}

.grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .filters select,
  .filters input {
    max-width: 100%;
  }
  .search-bar #search-bar {
    max-width: 100%;
  }
  .modal-content {
    margin: 10% auto;
    width: 90%;
    max-width: 90%;
    padding: 15px;
    max-height: 85vh;
  }
  .modal-image {
    max-height: 220px;
  }
  .modal-details h2 {
    font-size: 1.2rem;
  }
  .modal-description {
    font-size: 13px;
  }
  .modal-details .info {
    font-size: 13px;
  }
  .nav-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .card.list-view {
    flex-direction: column;
    text-align: center;
  }
  .card.list-view .info {
    margin-left: 0;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}