.selectly-store-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
}

/* Controls */
.selectly-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.selectly-search,
.selectly-category,
.selectly-sort-mobile {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  background: #fff;
}

.selectly-search:focus,
.selectly-category:focus,
.selectly-sort-mobile:focus {
  border-color: rgba(0,0,0,0.25);
}

.selectly-results.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.selectly-empty {
  padding: 18px;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 14px;
  text-align: center;
}

/* MOBILE: 1 product per row */
.selectly-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.selectly-tile {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* NEW: top title area */
.selectly-top{
  padding: 12px 12px 8px;
}
.selectly-title{
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}
.selectly-title-link{
  color: inherit;
  text-decoration: none;
}
.selectly-title-link:hover{
  text-decoration: underline;
}

.selectly-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.selectly-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selectly-img-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.05);
}

.selectly-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  background: rgba(0,0,0,0.78);
  color: #fff;
}

.selectly-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selectly-excerpt {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.9;
}

/* NEW: details link */
.selectly-details{
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}
.selectly-details:hover{
  text-decoration: underline;
}

.selectly-ctas {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 6px;
}

.selectly-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.15);
  font-weight: 700;
  font-size: 14px;
}

.selectly-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 2px;
}

.selectly-page-btn {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.15);
  font-weight: 700;
}

.selectly-page-info {
  font-size: 13px;
  opacity: 0.8;
}

/* Desktop row: category headings + sort on right */
.selectly-catrow{
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 8px;
}

.selectly-catbar{
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.selectly-cat-pill{
  display: inline-block;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  color: #111;
  text-decoration: none !important;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  opacity: 0.7;
}

.selectly-cat-pill.is-active{
  border-bottom-color: #000;
  opacity: 1;
}

/* Subcategory bar */
.selectly-subcatbar{
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

/* smaller + not bold + no underline */
.selectly-subcat-pill{
  display: inline-block;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  text-decoration: none !important;
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  opacity: 0.8;
}

.selectly-subcat-pill.is-active{
  opacity: 1;
  font-weight: 600;
  background: rgba(0,0,0,0.06);
}

/* Sort UI (desktop right) */
.selectly-sort{
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.selectly-sort-label{
  font-size: 13px;
  font-weight: 700;
  opacity: 0.8;
}

#selectly-sort-badge{
  width: 190px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  font-size: 14px;
}

/* LIKE pill bottom-right on image (heart + "3 Saves") */
.selectly-like{
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

.selectly-like-heart{
  font-size: 16px;
  line-height: 1;
  color: #111;
}

.selectly-like.is-liked .selectly-like-heart{
  color: #e11d48;
}

.selectly-like-count{
  font-size: 13px;
  font-weight: 800;
  color: #111;
  line-height: 1;
}

.selectly-like-label{
  font-size: 13px;
  font-weight: 700;
  color: #111;
  line-height: 1;
  opacity: 0.9;
}

/* Tablet */
@media (min-width: 768px) {
  .selectly-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile layout: Search full width, Category + Sort 50/50 */
@media (max-width: 1023px){
  .selectly-controls{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
  }

  #selectly-search{
    grid-column: 1 / -1;
  }

  #selectly-category{
    grid-column: 1 / 2;
  }

  #selectly-sort-badge-mobile{
    grid-column: 2 / 3;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .selectly-catrow{ display: flex; }
  .selectly-category{ display: none; }
  #selectly-sort-badge-mobile{ display: none; }

  .selectly-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

/* Single product page */
.selectly-single{
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px;
}
.selectly-single-title{
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.2;
}
.selectly-single-media{
  margin: 12px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.10);
}
.selectly-single-img{
  width: 100%;
  height: auto;
  display: block;
}
.selectly-badge.selectly-badge-single{
  position: static;
  display: inline-block;
  margin: 6px 0 0;
}
.selectly-pc{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}
.selectly-pc h3{
  margin: 0 0 8px;
}
.selectly-pc ul{
  margin: 0;
  padding-left: 18px;
}
@media (min-width: 900px){
  .selectly-pc{
    grid-template-columns: 1fr 1fr;
  }
}
.selectly-similar{
  margin-top: 26px;
}
.selectly-similar h3{
  margin: 0 0 12px;
}
