/* Break out of WP containers and center content */
.container,
.itembar {
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 auto !important;
  padding: 0 !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* Ensure wrapper fills viewport and stops at item bar */
.mmf-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* full height of screen */
}

/* Let product grid grow to fill remaining space */
.container {
  flex: 1; /* fills remaining vertical space */
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
  flex-wrap: nowrap; /* don't wrap on large screens */
  margin: 0;
  padding: 0;
}

/* Each product item */
.item {
  flex: 1 1 25%; /* 4 items per row */
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item .text {
  position: absolute;
  top: 10px;       /* move to top */
  left: 10px;      /* move to left */
  transform: none; /* remove centering */
  
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 10px;
  border-radius: 5px;
  color: #fff;
  text-align: left; /* optional */
  width: auto;      /* no stretching */
  display: inline-block; /* shrink to fit text */
}

.item .text h2 {
  font-size: 1rem;
  margin: 0;
  color: #fff !important;  /* force white text */
}

/* Category Navigation below grid */
.itembar {
  margin-bottom: 0; /* flush at bottom */
  padding-bottom: 0;
}

.itembar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  background-color: #898e8f;
  padding: 10px;
  margin: 0;
}

.itembar li {
  margin: 0 15px; /* space out items more */
}

.itembar a {
  color: #a31d3e !important;
  text-decoration: none;
  padding: 10px 15px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.itembar a:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .container {
    flex-wrap: wrap;
  }
  .item {
    flex: 1 1 50%; /* 2 items per row */
  }
}

@media (max-width: 600px) {
  .item {
    flex: 1 1 100%; /* 1 per row on mobile */
  }
}

/* Remove whitespace outside your container */
.mmf-wrapper,
.wp-coder,
.wp-block-wp-coder,
.wp-block {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    min-height: auto !important;
}
