/* ---------- Grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin: 28px 8px 8px 8px !important;
}

/* ---------- Card ---------- */
/* === Product Card Container === */
.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);       /* thin outline for crisp edge */
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),            /* main soft shadow */
    0 0 0 2px rgba(255, 255, 255, 0.5) inset;  /* faint inner glow for depth */
  overflow: hidden; /* ensures child elements like button align perfectly */
  background-color: #fff;
}

/* === Card Content (above the button) === */
.product-card-content {
  flex-grow: 1;
  padding: 1rem;
}

/* ---------- Media ---------- */
.product-media {
    position: relative;
    background: #f7f7f8;
    max-height: 460px;
}

.product-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity .25s ease;

}

/* ---------- Body ---------- */
.product-body {
    padding: 16px;
    display: grid;
    gap: .6rem;
}

.product-title {
    margin: 0;
    font-size: 1.45rem; /* larger, shopping-like */
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.product-writeup {
    margin: 0;
    font-size: 0.80rem; /* slightly smaller, secondary info */
    color: #333;
    text-align: justify;
    text-indent: 1.5em;     /* 👈 adds tab-style indent */
}
/* ---------- Rating (dynamic, capped at 5) ---------- */
.meta-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.stars {
    --rating: 0;
    /* 0..5 set inline */
    --percent: calc((min(max(var(--rating), 0), 5) / 5) * 100%);
    display: inline-block;
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: .12em;
    background: linear-gradient(90deg, #f5b50a var(--percent), #e5e7eb var(--percent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* reveal gradient */
}

.ratings-count {
    font-size: 0.8rem;
    color: #666;
}
/* ---------- Pricing ---------- */
.price-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    flex-wrap: wrap;
}

.current-price {
    font-size: 1.3rem; /* more prominence */
    font-weight: 800;
    color: #000;
}

.old-price {
    color: #888;
    font-size: 0.9rem;
    text-decoration: line-through;
}

.discount {
    color: #28a745;
    font-weight: 700;
    font-size: 1rem; /* slight boost to show value */
}


.expiry {
    margin-left: auto;
    font-size: .8rem;
    color: #6b7280;
}

/* ---------- Pros / Cons ---------- */
.pc {
    display: grid;
    gap: .25rem;
}

.pc h4 {
    margin: 0;
    font-size: .9rem;
    font-weight: 700;
    color: #222;
}

.pc ul {
    margin: .25rem 0 0;
    padding-left: 1rem;
    color: #3a3a3a;
    font-size: .9rem;
}

.pc li {
    margin: .15rem 0;
}

/* === Footer (Ensure Button Flush to Card Edges) === */
.card-footer {
    margin-top: auto;
    padding: 0;
}

/* === Buy Button (Slimmer, with Icon) === */
.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* space between icon & text */
  width: 100%;
  padding: 0.45rem 0.9rem; /* reduced height */
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  --md-accent-fg-color: #ffffff !important;
}

/* Icon styling */
.buy-btn i {
  display: inline-flex;
  font-size: 1.1rem;
  line-height: 1;
  color: #232F3E;
}



/* === Mobile Adjustments === */
@media (max-width: 640px) {
  .buy-btn {
    font-size: 0.95rem;
    padding: 0.65rem; /* still touch-friendly */
  }
}



/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
    .product-grid {
        gap: 18px;
    }

    .product-body {
        padding: 14px;
    }

    .product-title {
        font-size: 1.05rem;
    }

    .product-writeup {
        font-size: .92rem;
    }

    .product-media {
        aspect-ratio: 4 / 3;
    }

    /* taller images on phones */
}

@media (max-width: 420px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .price-row {
        gap: .35rem;
    }

    .stars {
        font-size: .95rem;
    }
}

/* Reduced motion friendly */
@media (prefers-reduced-motion: reduce) {

    .product-card,
    .product-media img,
    .buy-btn {
        transition: none;
    }
}


/* === Reasons to Buy (Balanced, Aligned) === */
.pros {
  background-color: #F6FFF6;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0px -16px;
}

.pros h4 {
  color: #2E7D32;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.pros ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pros li {
  padding-left: 2px;
  position: relative;
  margin-bottom: 2px;
  font-size: 0.80rem; /* increased for readability */
  color: #333;
  line-height: 1.2; /* ensures alignment with bullet */
}

.pros li::before {
  content: "✔";
  color: #43A047;
  font-size: 0.80rem;
  position: absolute;
  left: -20px; 
  top: 0.08rem; /* aligned vertically with text */
}

/* === Reasons to Avoid (Balanced, Aligned) === */
.cons {
  background-color: #FFFDF6;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0px -16px;
}

.cons h4 {
  color: #F57C00;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.cons ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cons li {
  padding-left: 2px;
  position: relative;
  margin-bottom: 2px;
  font-size: 0.80rem; /* increased for readability */
  color: #333;
  line-height: 1.4;
}

.cons li::before {
  content: "✖";
  color: #F57C00;
  font-size: 0.80rem;
  position: absolute;
  left: -20px; 
  top: 0.08rem;
}

.admonition.tip > .admonition-title {
  font-weight: 500;     /* lighter, similar to your reasons-to-buy */
  font-size: 0.75rem;   /* slightly smaller */
  color: #444;          /* subtle grey */
}



/* Top pick and Value pick CSS */

/* ---------- Card Badges (top-left) ---------- */
.card-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
  z-index: 1; /* above image but below nav/header */
  pointer-events: none; /* badges don't block clicks */
}

/* Base badge look (compact) */
.card-badge {
  pointer-events: auto; /* allow tooltip or future links */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.65rem;      /* smaller text */
  line-height: 1;
  font-weight: 600;        /* less heavy than 700 */
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15); /* softer shadow */
  backdrop-filter: blur(4px);
  white-space: nowrap;
  opacity: 0.9;            /* slightly subdued */
}

/* Top Pick (gold, subtle) */
.card-badge--top-pick {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  color: #1b1330;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Value Pick (green, subtle) */
.card-badge--value-pick {
  background: linear-gradient(135deg, #4ade80 0%, #16a34a 100%);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.card-badge--best-deal {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%); /* reddish pink */
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Small icon inside badge */
.card-badge i {
  font-size: 0.75rem;
  opacity: 0.85;
}
