/* =============== GLOBAL RESET =============== */
/* Base Layout */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --banner-shift: 0px;
}

/* Centered container for all content */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

/* FILTER BUTTONS */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  text-align: center;
}

.category-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  background-color: #3366cc;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.category-buttons button:hover,
.category-buttons button.active {
  background-color: #254b99;
  transform: scale(1.05);
}

/* CATEGORY TITLES */
h2.category-title {
  width: 100%;
  text-align: center;
  color: #3366cc;
  padding: 15px 10px;
  margin: 30px 0 10px;
  font-size: 2rem;
  display: block;
}

.product-card h3 { font-size: 1.2rem; margin: 10px 0; }
.product-card p { font-size: 1rem; color: #333; margin: 0; }

/* Product card layout */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  justify-content: center;
}

/* Card images fixed to 320x300 */
.card img {
  width: 320px;
  height: 300px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

/* Ensure the rest of card is centered properly */
.card {
  text-align: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* =============== PRODUCT GRID =============== */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
}

/* ---- Product Card ---- */
.product-card {
  flex: 0 0 300px;
  width: 300px;
  max-width: 300px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s ease;
}

.product-card:hover {
  transform: translateY(-4px);
}

/* ---- Product Image ---- */
.product-card img {
  width: 280px;
  height: 320px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}

/* ---- Text ---- */
.product-card h3 {
  font-size: 1.05rem;
  margin: 6px 0;
}
.product-card p {
  font-size: 0.98rem;
  color: #222;
}

/* ---- Responsive Wrapping (keeps cards centered) ---- */
@media (max-width: 1200px) {
  .product-grid { justify-content: center; }
}
@media (max-width: 1024px) {
  .product-grid { justify-content: center; }
}
@media (max-width: 768px) {
  .product-grid { justify-content: center; }
}
@media (max-width: 480px) {
  .product-grid { justify-content: center; }
}

/* =============== BANNER & ITEM SECTION =============== */
.item-link {
  display: block;
  width: 100%;
  height: 120px;
  text-decoration: none;
  color: inherit;
}

.item-wrapper {
  position: relative;
  width: 1200px;
  max-width: 1200px;
  margin: 20px auto;
}

.item-section {
  width: 100%;
  max-width: 1260px;
  margin: 50px auto;
  display: flex;
  justify-content: center;
  position: relative;
  transform: translateX(var(--banner-shift));
}

.banner {
  width: 100%;
  max-width: 1200px;
  height: 120px;
  min-height: 120px;
  padding-right: 80px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(270deg, #ff66a6, #66ffcc, #66aaff, #ff66a6);
  background-size: 600% 600%;
  animation: gradientShift 15s ease infinite;
  padding: 10px;
}

.banner img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Gradient animation */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Overlays */
.center-overlay,
.overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.item-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 1;
}

.center-item-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.item-overlay img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 5px;
}

/* =============== RESPONSIVE BANNER ADJUSTMENTS =============== */
@media (max-width: 1200px) {
  :root { --banner-shift: -10px; }
}
@media (max-width: 1024px) {
  :root { --banner-shift: -10px; }
}
@media (max-width: 768px) {
  :root { --banner-shift: 20px; }
}
@media (max-width: 900px) {
  .banner {
    height: auto;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
  }
  .center-item-overlay {
    position: relative;
    transform: none;
    left: auto;
    top: auto;
    margin: 5px 0;
  }
}
@media (max-width: 768px) {
  :root { --banner-shift: 0px; }
  .banner {
    flex-direction: column;
    height: auto;
    padding: 10px;
  }
  .item-overlay img { max-height: 120px; }
}
@media (max-width: 600px) {
  .banner {
    height: auto;
    padding: 12px;
  }
  .banner img { max-height: 120px; }
}
@media (max-width: 480px) {
  .item-overlay img { max-height: 250px; }
}

/* Fix slight left shift on large screens */
@media (min-width: 1200px) {
  .banner {
    position: relative;
    left: 35px;
    transform: translateX(-10px);
  }
}

/* --- Keep banner full width (1200px) even when few cards are shown --- */
.item-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.banner {
  width: 1200px;
  max-width: 1200px;
}

/* Keep responsiveness perfect */
@media (max-width: 1200px) {
  .banner {
    width: 100%;
    max-width: 100%;
  }
}

/* --- Keep banner perfectly centered regardless of number of cards --- */
.item-section {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.banner {
  margin: 0 auto;
  width: 1200px;
  max-width: 1200px;
}

/* Responsive centering (banner full width on smaller screens) */
@media (max-width: 1200px) {
  .banner {
    width: 100%;
    max-width: 100%;
  }
}

/* --- Subtle banner centering correction on large screens --- */
@media (min-width: 1200px) {
  .banner {
    position: relative;
    left: 10px; /* move banner ~25px left; adjust -20 to -30px as needed */
  }
}
