/* ============================================================
   btabs_product_organica.css
   Grid layout for product tabs: popular, latest, special.
   Shared by all three tabs via .b-pgrid wrapper.
   Card internals (.b-card__*) are defined in the theme base.
   ============================================================ */

/* ── Grid container ─────────────────────────────────────── */
.b-pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 4px 0 8px;
}

/* ── Card shell ─────────────────────────────────────────── */
.b-pgrid .b-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.b-pgrid .b-card:hover,
.b-pgrid .b-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.11);
}

/* ── Media block ────────────────────────────────────────── */
.b-pgrid .b-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--barik-50, #f5f5f5);
}

.b-pgrid .b-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
  -webkit-transition: opacity 0.2s ease;
}

/* ── Ribbon (sale / sold-out badge) ─────────────────────── */
.b-pgrid .b-ribbon {
  position: absolute;
  top: 10px;
  left: 0;
  z-index: 3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 10px 3px 8px;
  border-radius: 0 var(--radius-xs, 4px) var(--radius-xs, 4px) 0;
  line-height: 1.4;
}

.b-pgrid .b-ribbon--sale {
  background: var(--primary, #e05);
  color: #fff;
}

.b-pgrid .b-ribbon--soldout {
  background: transparent;
  color: #fff;
}

.b-pgrid .b-ribbon--soldout span {
 background: rgba(15, 23, 42, 0.75);
}

/* ── Overlay action buttons (wishlist / compare) ────────── */
.b-pgrid .b-card__overlay-top {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  -webkit-transition: opacity 0.18s ease, transform 0.18s ease;
}

.b-pgrid .b-card:hover .b-card__overlay-top {
  opacity: 1;
  transform: translateX(0);
}

.b-pgrid .wish-mini,
.b-pgrid .compare-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-muted, #555);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-transition: background 0.15s ease, color 0.15s ease;
}

.b-pgrid .wish-mini:hover,
.b-pgrid .compare-mini:hover {
  background: var(--primary, #e05);
  color: #fff;
}

/* ── Add-to-cart button (bottom of media) ───────────────── */
.b-pgrid .btn-addtocart {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  border: none;
  border-radius: 0;
  background: rgb(var(--primary-rgb, 238, 0, 85), 0.88);
  color: #fff;
  padding: 8px 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
  -webkit-transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
}

.b-pgrid .b-card:hover .btn-addtocart {
  opacity: 1;
  transform: translateY(0);
}

.b-pgrid .btn-addtocart:hover {
  background: var(--primary, #e05);
}

/* ── Card body (name + price) ───────────────────────────── */
.b-pgrid .b-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.b-pgrid .b-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-base, #222);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.b-pgrid .b-card__name:hover {
  color: var(--primary, #e05);
}

.b-pgrid .b-card__price {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  line-height: 1.3;
}

.b-pgrid .b-price--special {
  color: var(--primary, #e05);
  font-weight: 700;
}

.b-pgrid .b-price--old {
  color: var(--text-muted, #999);
  font-size: 12px;
  font-weight: 400;
}

.b-pgrid .b-price--tax {
  color: var(--text-muted, #aaa);
  font-size: 11px;
  width: 100%;
}

/* ── More products link ─────────────────────────────────── */
.more-product-wrapper {
  margin-top: 24px;
}

/* ── Responsive ─────────────────────────────────────────── */

/* Tablet landscape — comfortable 4-col */
@media (max-width: 1024px) {
  .b-pgrid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }
}

/* Tablet portrait — 3-col minimum */
@media (max-width: 768px) {
  .b-pgrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* Mobile — 2-col */
@media (max-width: 480px) {
  .b-pgrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .b-pgrid .b-card__body {
    padding: 8px 8px 10px;
  }

  .b-pgrid .b-card__name {
    font-size: 13px;
  }

  /* Always-visible cart button on touch devices */
  .b-pgrid .btn-addtocart,
  .b-pgrid .b-card__overlay-top {
    opacity: 1;
    transform: none;
  }
}
