:root {
  --uwg-cols: 4;
  --uwg-w: 250px;
  --uwg-h: 250px;
  --uwg-gap: 20px;
  --uwg-fs: 16px;
  --uwg-cc: #ffffff;
  --uwg-cbg: rgba(0, 0, 0, 0.6);
  --uwg-mb: 600px;
  --uwg-pad: 20px;
  --uwg-radius: 6px;
}

/* ============================= */
/* Main Product Grid Layout      */
/* ============================= */
.uwg-grid {
  display: grid;
  grid-template-columns: repeat(var(--uwg-cols), minmax(0, 1fr));
  gap: var(--uwg-gap);
  padding: var(--uwg-pad);
  box-sizing: border-box;
  align-items: stretch;
}

/* ============================= */
/* Individual Product Blocks     */
/* ============================= */
.uwg-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: var(--uwg-radius);
  padding: var(--uwg-pad);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Thumbnail Wrapper */
.uwg-thumb {
  flex-shrink: 0;
}

/* Thumbnail Images */
.uwg-thumb img,
.uwg-item img {
  width: 100%;
  height: auto;
  max-width: var(--uwg-w);
  max-height: var(--uwg-h);
  object-fit: cover;
  border-radius: var(--uwg-radius);
  transition: transform 0.3s ease;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Hover Zoom Effect */
.uwg-item img:hover {
  transform: scale(1.03);
}

/* ============================= */
/* Typography & Content Blocks   */
/* ============================= */
.uwg-caption {
  margin-top: auto;
  font-size: var(--uwg-fs);
  color: var(--uwg-cc);
  background-color: var(--uwg-cbg);
  padding: 6px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 10px;
}

.uwg-desc {
  margin-top: 10px;
  flex-grow: 1;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
  color: #ddd;
}

/* ============================= */
/* Category Description Block    */
/* ============================= */
.uwg-term-description {
  max-width: 100%;
  margin: 0 auto 40px;
  padding: var(--uwg-pad);
  background-color: rgba(255,255,255,0.04);
  border-left: 5px solid #888;
  font-size: 16px;
  line-height: 1.7;
  color: #eee;
  box-sizing: border-box;
  text-align: left;
  border-radius: var(--uwg-radius);
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}

.uwg-term-description p {
  margin: 0 0 10px;
}

.uwg-term-description br {
  display: block;
  content: "";
  margin-bottom: 10px;
}

/* ============================= */
/* Category Table Grid Layout    */
/* ============================= */
.uwg-table-grid {
  width: 100%;
  border-collapse: collapse;
  padding: var(--uwg-pad);
  box-sizing: border-box;
}

.uwg-cell {
  width: 50%;
  padding: 15px;
  vertical-align: top;
  box-sizing: border-box;
}

.uwg-title {
  font-weight: bold;
  font-size: 18px;
  margin-top: 10px;
  color: #222;
}

.uwg-cell .uwg-desc {
  font-size: 16px;
  color: #444;
  margin-top: 5px;
}

/* ============================= */
/* Responsive Adjustments        */
/* ============================= */
@media (max-width: var(--uwg-mb)) {
  .uwg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .uwg-item img {
    max-width: 100%;
    max-height: none;
  }

  .uwg-cell {
    width: 100%;
  }

  .uwg-term-description {
    padding: 15px;
  }

  .uwg-item {
    padding: 15px;
  }
}

/* ============================= */
/* Single-Column Grid Override   */
/* ============================= */
.uwg-grid.single-column {
  display: block;
  max-width: 100%;
  padding: 0;
}

.uwg-grid.single-column .uwg-item {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 30px;
  padding: var(--uwg-pad);
  background-color: rgba(255,255,255,0.04);
  border-left: 5px solid #888;
  border-radius: var(--uwg-radius);
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  color: #eee;
  text-align: left;
  box-sizing: border-box;
}

.uwg-grid.single-column .uwg-caption,
.uwg-grid.single-column .uwg-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #ccc;
}