:root {
  --tea-refill-theme-color: #2196f3;
}

/* Unified image + name block for category and product */
.image-name-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 18px auto;
  box-shadow: 0 2px 8px rgba(33,150,243,0.07);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--tea-refill-theme-color);
}
.image-name-block img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  border: none;
  margin: 0;
  display: block;
}
.image-name-block .image-name-label {
  padding: 14px 10px;
  background: #f8faff;
  font-weight: bold;
  font-size: 1.1em;
  border-top: 1px solid #e3f0fb;
  border-radius: 0 0 8px 8px;
  text-align: center;
  margin: 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Remove old margin and border from previous selectors */
#category-image-box,
#product-image-box {
  margin-bottom: 0;
  border: none;
  background: none;
  min-height: unset;
  text-align: initial;
}

/* Category and Product Buttons */
#category-buttons,
#product-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12.8px;
  margin-bottom: 18px;
}
.category-btn,
.product-btn {
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
}
.category-btn.selected,
.product-btn.selected {
  border: 2px solid #000;
}
.category-btn:hover,
.product-btn:hover {
  filter: brightness(0.9);
}

/* Presentation buttons styling */
.presentation-btn {
  background: #fff;
  color: #000;
  border: 2px solid var(--tea-refill-theme-color);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  margin-bottom: 0;
}
.presentation-btn.selected,
.presentation-btn:active {
  background: var(--tea-refill-theme-color);
  color: #fff;
  border-color: var(--tea-refill-theme-color);
}
.presentation-btn:hover {
  filter: brightness(0.9);
}

/* Variation group container (grid row of buttons) */
.tea-refill-variation-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

/* Variation button styling */
.variation-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 1rem;
  position: relative;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.variation-btn.selected,
.variation-btn:active {
  border-color: var(--tea-refill-theme-color);
  background: #e3f0fb;
}
.variation-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.variation-btn .variation-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #eee;
}
.variation-btn .variation-name {
  font-weight: bold;
  margin-bottom: 4px;
  text-align: center;
}
.variation-btn .variation-price {
  color: var(--tea-refill-theme-color);
  font-weight: bold;
  margin-bottom: 2px;
  text-align: center;
}
.variation-btn .variation-outofstock {
  color: #e53935;
  font-size: 0.95em;
  margin-top: 6px;
  font-weight: bold;
  text-align: center;
}

/* Quantity/add-to-cart wrapper at bottom */
.variation-qty-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 8px 0 0 0;
  width: 100%;
}
.variation-qty-wrap label {
  font-size: 1em;
  margin-right: 8px;
}
.variation-qty-wrap input[type="number"] {
  width: 60px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid #bbb;
  font-size: 1em;
}
.variation-qty-wrap .add-to-cart-btn {
  background: var(--tea-refill-theme-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 0;
  transition: background 0.2s;
}
.variation-qty-wrap .add-to-cart-btn:hover {
  background: #1769aa;
}

/* Upsell section styling */
.tea-refill-upsell-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 12px 0 0 0;
  border-top: 1px solid #e3f0fb;
}
.tea-refill-upsell-product {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 2px solid var(--tea-refill-theme-color);
  border-radius: 10px;
  background: #fff;
  padding: 12px 10px 10px 10px;
  box-sizing: border-box;
  text-align: center;
  min-width: 0;
}
.tea-refill-upsell-product img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 auto 8px auto;
  display: block;
}
.tea-refill-upsell-product .upsell-name {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 1.05em;
}
.tea-refill-upsell-product .upsell-price {
  color: var(--tea-refill-theme-color);
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1em;
}
.tea-refill-upsell-product .add-upsell-btn {
  background: var(--tea-refill-theme-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  width: 100%;
  margin-top: auto;
}
.tea-refill-upsell-product .add-upsell-btn:hover {
  background: #1769aa;
}
@media (max-width: 600px) {
  .tea-refill-upsell-wrap {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tea-refill-upsell-product img {
    width: 56px;
    height: 56px;
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  #step-1,
  #step-2 {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  .image-name-block {
    max-width: 100%;
  }
  .image-name-block img {
    height: 180px;
  }
  .tea-refill-variation-group {
    gap: 10px;
  }
  .variation-btn {
    min-width: 120px;
    max-width: 140px;
    padding: 12px 8px;
  }
}
@media (max-width: 600px) {
  #step-1,
  #step-2 {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 16px;
  }
  #category-buttons,
  #product-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-wrap: unset;
    justify-content: unset;
  }
  .category-btn,
  .product-btn {
    width: 100%;
    min-width: 0;
    padding: 14px 0;
    font-size: 1.05rem;
    margin-bottom: 0;
    box-sizing: border-box;
  }
  .image-name-block img {
    height: 160px;
  }
  .image-name-block .image-name-label {
    padding: 12px 6px;
    font-size: 1.05em;
  }
  .tea-refill-variation-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .variation-btn {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    padding: 12px 8px;
    font-size: 1.05rem;
  }
  .variation-qty-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  #step-1,
  #step-2,
  #step-3 {
    margin-bottom: 20px;
  }
}

/* Inline notification */
.tea-refill-inline-notification {
  position: relative;
  z-index: 10;
  display: block;
  pointer-events: none;
  font-size: 0.98rem;
  padding: 8px 10px;
  border-radius: 5px;
  max-width: 95vw;
  word-break: break-word;
}

/* Short description styling */
.tea-refill-short-desc {
  font-weight: normal;
  font-size: 0.95em;
  margin: 8px 0 0 0;
  color: #444;
}