
.header {
  background: black;
  color: #7a004b; 
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 45px;
  font-weight: 700;

  width: 600px;
  margin: 40px auto;
  text-align: center;

  padding: 12px 0;
  border-radius: 40px;
}

.section-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  margin-top: 80px;
  margin-bottom: 30px;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 80px;
}

button {
  background: black;
  color: white;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 28px;
  text-align: center;
  align-items: center;
  letter-spacing: 1px;
  border-radius: 28px;
  padding: 35px 50px;
  width: 180px;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#tag-page {
  position: relative;
}

#tag-page .tag-button {
  font-size: 23px;
  padding: 25px 25px;
  width: 160px; 
}

.back-button {
  background: none;
  color: black;
  font-family: "Playfair Display", serif;
  font-size: 25px;
  font-weight: 700;
  padding: 0;
  border: none;
  cursor: pointer;
  display: block;
  margin: 30px 0 0 90px;
}

button:hover {
  background: #7a004b; /* slightly lighter black */
  transform: scale(1.03);
  transition: all 0.2s ease;
  cursor: pointer;
}

/* ===== LOADING OVERLAY ===== */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(255, 255, 255, 0.9);

  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  z-index: 999;
}

/* Spinner */
.spinner {
  width: 50px;
  height: 50px;

  border: 4px solid #eee;
  border-top: 4px solid #7a004b;

  border-radius: 50%;
  animation: spin 1s linear infinite;

  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Loading text */
#loading-overlay p {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  color: #111;
}

/* ===== ERROR STATE ===== */
#loading-overlay button {
  margin-top: 15px;
  padding: 10px 25px;

  background: black;
  color: white;

  border: none;
  border-radius: 20px;

  font-family: "Playfair Display", serif;
  cursor: pointer;
}

#loading-overlay button:hover {
  background: #7a004b;
} 

/* ===== RESULTS PAGE & PRODUCT CARDS ===== */

/* Grid container */
#products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 30px;
}

/* Cards */

.card-info {
  background: #d9d9d9;
  padding: 14px 12px 16px;
}

.product-card {
  text-align: center;
  overflow: hidden;
}

/* Elements */
.product-card img {
  width: 100%;
  height: 380px;        
  object-fit: cover;    
  object-position: top; 
  display: block;
}

.product-card h3 {
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.product-card p {
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.product-card a {
  display: inline-block;
  margin-top: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#load-more-btn {
  width: 300px;
  padding: 16px 40px;
  border-radius: 30px;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
}

.product-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

#results-page, #tag-page, #gender-page {
  animation: fadeIn 0.4s ease;
}

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

@media (max-width: 768px) {
  .header {
    width: 80%;
    font-size: 30px;
  }

  .content {
    width: 100%;
    box-sizing: border-box;
  }

  #gender-page .content {
    align-items: center;
    padding: 0 20px;
  }

  #tag-page .content {
    align-items: center;
    padding: 0;
  }

  .button-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px;
    margin-top: 30px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 20px;
  }

  #gender-page .button-container {
    grid-template-columns: repeat(2, 1fr) !important;
    width: 80%;
    margin: 30px auto 0;
    padding: 0;
  }

  button {
    width: 100% !important;
    padding: 20px 10px !important;
    font-size: 16px !important;
    box-sizing: border-box;
  }

  #tag-page .tag-button {
    width: 100% !important;
    min-width: unset !important;
    font-size: 14px;
    padding: 20px 0;
    box-sizing: border-box;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
    padding: 15px;
  }

  .product-card img {
    height: 220px;
  }
}

