/* Curated Discovery: Tabbed Real Estate Shelf + Bento Marketplace Grid */

.curated-shelves-container {
  margin-bottom: 1.5rem;
}
.shelf-section {
  margin-bottom: 1.25rem;
  position: relative;
}
.re-tabbed-shelf {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.re-shelf-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.re-shelf-heading-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}
.shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.shelf-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.shelf-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
}
.shelf-subtitle {
  font-size: 0.78rem;
  color: #64748b;
}
.re-shelf-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.re-shelf-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.re-shelf-tab-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}
.re-shelf-tab-btn.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}
.re-shelf-tab-btn.is-active i {
  color: #ffffff !important;
}
.shelf-view-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.shelf-view-all:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.shelf-wrapper {
  position: relative;
}
.shelf-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.shelf-track::-webkit-scrollbar {
  height: 4px;
}
.shelf-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.shelf-card {
  flex: 0 0 210px;
  scroll-snap-align: start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shelf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -3px rgba(0, 0, 0, 0.08);
}
.shelf-card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.shelf-card-img-box {
  position: relative;
  width: 100%;
  height: 140px;
  background: #f1f5f9;
  overflow: hidden;
}
.shelf-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.shelf-card:hover .shelf-card-img {
  transform: scale(1.03);
}
.shelf-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.shelf-card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  gap: 4px;
}
.shelf-price {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
}
.shelf-price .price-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}
.frame-tag {
  font-size: 0.72rem;
  padding: 1px 6px;
  height: auto;
  font-weight: 700;
}
.shelf-card-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}
.shelf-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.shelf-card-meta {
  font-size: 0.78rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s, transform 0.15s;
}
.shelf-arrow-btn:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.08);
}
.shelf-arrow-prev { left: -10px; }
.shelf-arrow-next { right: -10px; }

/* ================= BENTO GRID FOR MARKETPLACE SHELVES ================= */
.bento-shelves-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.bento-shelves-grid.has-3-boxes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.bento-shelves-grid.has-1-boxes {
  grid-template-columns: 1fr;
}
.bento-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.bento-box--drops {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 55%);
}
.bento-box--pets {
  border-color: #a7f3d0;
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 55%);
}
.bento-box--tech {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 55%);
}
.bento-box--home {
  border-color: #fbcfe8;
  background: linear-gradient(180deg, #fdf2f8 0%, #ffffff 55%);
}
.bento-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.bento-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}
.bento-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bento-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.bento-shelves-grid.has-3-boxes .bento-mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bento-item-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bento-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -3px rgba(15, 23, 42, 0.1);
}
.bento-item-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  overflow: hidden;
}
.bento-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}
.bento-item-card:hover .bento-item-img {
  transform: scale(1.04);
}
.bento-discount-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #15803d;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.bento-item-price-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  width: fit-content;
  max-width: calc(100% - 10px);
  overflow: hidden;
}
.bento-price-current {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.bento-price-old {
  font-size: 0.75rem;
  color: #cbd5e1;
  text-decoration: line-through;
  white-space: nowrap;
}
.bento-price-gift {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4ade80;
  white-space: nowrap;
}
.bento-item-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

@media (max-width: 1024px) {
  .bento-shelves-grid.has-3-boxes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bento-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.shelf-track--deals .deal-card {
  flex: 0 0 245px;
  scroll-snap-align: start;
  flex-direction: column;
  min-height: auto;
}
.shelf-track--deals .deal-card-media {
  width: 100%;
  min-width: 0;
  height: 155px;
}
.shelf-track--deals .deal-card-body {
  padding: 10px 12px;
}

@media (max-width: 768px) {
  .shelf-arrow-btn { display: none; }
  .shelf-card { flex: 0 0 185px; }
  .shelf-track--deals .deal-card { flex: 0 0 215px; }
  .shelf-track--deals .deal-card-media { height: 135px; }
  .shelf-card-img-box { height: 125px; }
  .bento-shelves-grid,
  .bento-shelves-grid.has-3-boxes {
    grid-template-columns: 1fr;
  }
  .bento-mini-grid,
  .bento-shelves-grid.has-3-boxes .bento-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .re-shelf-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    padding-bottom: 2px;
  }
}
