/* ==========================================================================
   MwalimuFocus.Co.Ke - Unified Product Card & Responsive Grid
   Aligned with live https://mwalimufocus.co.ke storefront cards (.pop-card):
   - Soft cyan/aqua gradient background (#e0ffff -> #c8f7f7)
   - Subtle tinted header bar (rgba(0,119,182,0.07)) with uppercase #0077b6 text
   - Centered dark-navy clickable title (#1a1a2e, hover #0077b6)
   - Bold current price + struck-through old price row
   - Footer with full-width brand green "Buy Now" (#1a6e3c) & outlined "Add to Cart"
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESPONSIVE PRODUCTS GRID
   -------------------------------------------------------------------------- */
.mf-products-grid,
.mf-trending-grid,
.mf-units-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 1199px) {
  .mf-products-grid,
  .mf-trending-grid,
  .mf-units-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 899px) {
  .mf-products-grid,
  .mf-trending-grid,
  .mf-units-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 539px) {
  .mf-products-grid,
  .mf-trending-grid,
  .mf-units-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
}

/* --------------------------------------------------------------------------
   2. UNIFIED PRODUCT CARD (.pop-card / .result-card parity)
   -------------------------------------------------------------------------- */
.mf-product-card {
  background: linear-gradient(160deg, #e0ffff 0%, #c8f7f7 100%);
  border: 1px solid rgba(0, 119, 182, 0.12);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
  height: 100%;
}

.mf-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.11);
  border-color: rgba(0, 119, 182, 0.28);
}

/* Full Set Card and Corner Ribbon Styling */
.mf-product-card--fullset {
  position: relative;
  border: 2px solid rgba(0, 206, 209, 0.9) !important;
  box-shadow: 0 14px 34px rgba(0, 206, 209, 0.22) !important;
}

.mf-product-card--fullset:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 206, 209, 1) !important;
  box-shadow: 0 18px 40px rgba(0, 206, 209, 0.28) !important;
}

.mf-card-ribbon-fullset {
  position: absolute;
  top: 8px;
  right: -48px;
  width: 160px;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 206, 209, 0.95), rgba(0, 170, 175, 0.95));
  color: #ffffff;
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  padding: 6.5px 0;
  transform: rotate(45deg);
  transform-origin: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  z-index: 5;
  pointer-events: none;
}

.mf-card-ribbon-fullset span {
  display: block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   3. CARD TOP HEADER STRIP (e.g. LESSON NOTES › GRADE 10)
   -------------------------------------------------------------------------- */
.mf-card-header {
  background: rgba(0, 119, 182, 0.07);
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(0, 119, 182, 0.1);
  display: flex;
  align-items: center;
}

.mf-card-header-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0077b6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Compatibility alias for existing elements */
.mf-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: rgba(0, 119, 182, 0.07);
  border-bottom: 1px solid rgba(0, 119, 182, 0.1);
}

.mf-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0077b6;
}

/* --------------------------------------------------------------------------
   4. CARD BODY: Centered Title & Price Row
   -------------------------------------------------------------------------- */
.mf-card-body {
  padding: 1rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-grow: 1;
}

.mf-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.4;
  margin: 0 0 0.65rem 0;
  text-align: center;
  min-height: 54px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mf-card-title a {
  color: #1a1a2e;
  text-decoration: none;
  transition: color 0.15s ease;
}

.mf-card-title a:hover {
  color: #0077b6;
  text-decoration: underline;
}

.mf-card-price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: auto;
}

.mf-card-price-current {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a1a2e;
}

.mf-card-price-old {
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: line-through;
  color: #64748b;
}

.mf-card-price-free {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #1a6e3c;
  background: rgba(26, 110, 60, 0.12);
  padding: 2px 10px;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   5. CARD FOOTER ACTIONS (Buy Now & Add to Cart)
   -------------------------------------------------------------------------- */
.mf-card-actions {
  background: transparent;
  border-top: 1px solid rgba(0, 119, 182, 0.1);
  padding: 0.75rem 1rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
}

.mf-card-btn-buy {
  width: 100%;
  min-height: 36px;
  background-color: #1a6e3c;
  color: #ffffff;
  border: 1.5px solid #1a6e3c;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.44rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}

.mf-card-btn-buy:hover {
  background-color: #145c31;
  border-color: #145c31;
  color: #ffffff;
}

.mf-card-btn-cart {
  width: 100%;
  min-height: 36px;
  background-color: transparent;
  color: #1a2a3a;
  border: 1.5px solid #3a4a5c;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mf-card-btn-cart:hover {
  background-color: #f0f4f8;
  border-color: #1a2a3a;
  color: #0a1a28;
}

.mf-card-btn-cart.is-in-cart {
  background-color: #15803d;
  border-color: #15803d;
  color: #ffffff;
}

.mf-card-btn-cart.is-in-cart:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.mf-card-btn-buy:active,
.mf-card-btn-cart:active {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   6. BACKWARDS COMPATIBILITY UTILITIES
   -------------------------------------------------------------------------- */
.mf-card-chips {
  display: none;
}

.mf-card-footer {
  display: none;
}
