/* ============================================================================
   MobileUza storefront template — RETAIL (Jumia-style)
   Energetic, dense, conversion-focused. Every rule is scoped under body.tpl-retail
   so it only restyles the storefront when the retail template is active.
   Restyles BOTH the product detail (pd-* + rtl-* classes) AND the listing grid
   (.mu-grid) + cards (.mu-product-card). Uses the shared design tokens.
   ============================================================================ */

/* ---------------------------------------------------------------- DETAIL --- */

/* Wider buy column than gallery — Jumia leads with a tall buy-box on the right. */
body.tpl-retail .rtl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s5); }

/* Gallery: white framed card + a corner discount flag. */
body.tpl-retail .rtl-gallery { position: relative; background: var(--mu-surface); border: 1px solid var(--mu-line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--sh-1); }
body.tpl-retail .rtl-gallery .pd-main-img { border: 0; background: #fff; }
body.tpl-retail .rtl-gallery .pd-main-img img { object-fit: contain; }
body.tpl-retail .rtl-flag {
    position: absolute; top: var(--s4); left: var(--s4); z-index: 3;
    background: var(--mu-danger); color: #fff; font-weight: 800; font-size: var(--fz-sm);
    padding: 4px 10px; border-radius: var(--r-sm); letter-spacing: .01em;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .35);
}
body.tpl-retail .rtl-gallery .pd-thumb.is-active { border-color: var(--mu-gold); box-shadow: var(--sh-focus); }

/* Title block */
body.tpl-retail .rtl-eyebrow {
    display: inline-flex; align-items: center; gap: 6px; font-size: var(--fz-xs);
    font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--mu-gold-600); margin-bottom: var(--s2);
}
body.tpl-retail .rtl-title { font-size: var(--fz-xl); font-weight: 700; line-height: 1.3; margin: 0 0 var(--s2); }
body.tpl-retail .rtl-subline { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
body.tpl-retail .rtl-rev { font-size: var(--fz-sm); color: var(--mu-gold-600); font-weight: 600; }
body.tpl-retail .rtl-sku { font-size: var(--fz-xs); color: var(--mu-muted); padding-left: var(--s3); border-left: 1px solid var(--mu-line); }

/* Buy box — the conversion card */
body.tpl-retail .rtl-buybox { padding: var(--s5); margin-top: 0; border: 1px solid var(--mu-line); box-shadow: var(--sh-2); }
body.tpl-retail .rtl-price-block { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
body.tpl-retail .rtl-price { font-size: var(--fz-3xl); font-weight: 800; color: var(--mu-ink); line-height: 1; letter-spacing: -.01em; }
body.tpl-retail .rtl-cur { font-size: .5em; font-weight: 700; color: var(--mu-muted); margin-right: 4px; vertical-align: 6px; }
body.tpl-retail .rtl-was { font-size: var(--fz-base); color: var(--mu-muted); text-decoration: line-through; }
body.tpl-retail .rtl-badge { font-size: var(--fz-xs); padding: 3px 9px; }

/* Stock line */
body.tpl-retail .rtl-stock { margin: var(--s3) 0 var(--s4); font-size: var(--fz-sm); color: var(--mu-success); display: flex; align-items: center; gap: 6px; }
body.tpl-retail .rtl-stock--low { color: #c2410c; }
body.tpl-retail .rtl-stock--low strong { color: #c2410c; }
body.tpl-retail .rtl-stock--out { color: var(--mu-danger); }

/* Actions: big gold add-to-cart leads; the qty stepper sits beside it. */
body.tpl-retail .rtl-actions { gap: var(--s3); }
body.tpl-retail .rtl-add { flex: 1; min-width: 170px; font-weight: 800; letter-spacing: .01em; }
body.tpl-retail .rtl-secondary { margin-top: var(--s3); }
body.tpl-retail .mu-qty { border-radius: var(--r-md); }

/* Key features list */
body.tpl-retail .rtl-features { margin-top: var(--s5); background: var(--mu-gold-50); border: 1px solid var(--mu-gold-100); border-radius: var(--r-md); padding: var(--s4) var(--s5); }
body.tpl-retail .rtl-features__h { font-size: var(--fz-sm); text-transform: uppercase; letter-spacing: .03em; color: var(--mu-ink); margin: 0 0 var(--s3); display: flex; align-items: center; gap: 8px; }
body.tpl-retail .rtl-features__h i { color: var(--mu-gold-600); }
body.tpl-retail .rtl-feat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: var(--s2); }
body.tpl-retail .rtl-feat-list li { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--fz-sm); color: var(--mu-ink); }
body.tpl-retail .rtl-feat-list li i { color: var(--mu-success); margin-top: 3px; font-size: .8em; }

/* Reassurance row */
body.tpl-retail .rtl-reassure { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s4); }
body.tpl-retail .rtl-reassure__item { display: flex; gap: var(--s3); align-items: flex-start; background: var(--mu-surface); border: 1px solid var(--mu-line); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
body.tpl-retail .rtl-reassure__item i { color: var(--mu-gold-600); font-size: 1.15rem; margin-top: 2px; flex: 0 0 auto; }
body.tpl-retail .rtl-reassure__item strong { display: block; font-size: var(--fz-sm); color: var(--mu-ink); }
body.tpl-retail .rtl-reassure__item span { font-size: var(--fz-xs); color: var(--mu-muted); line-height: 1.4; display: block; }

/* Related heading accent */
body.tpl-retail .rtl-related .mu-section-title i { color: var(--mu-gold-600); }

/* ------------------------------------------------------- LISTING + CARDS --- */

/* Denser grid: 5-up on wide screens, compact gaps (Jumia density). */
body.tpl-retail .mu-grid { grid-template-columns: repeat(5, 1fr); gap: var(--s3); }

/* Compact card with a tight body and a small accented Add button. */
body.tpl-retail .mu-product-card { border-radius: var(--r-md); border-color: var(--mu-line); transition: var(--tr); }
body.tpl-retail .mu-product-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--mu-gold); }
body.tpl-retail .mu-product-card__media { aspect-ratio: 1 / 1; background: #fff; }
body.tpl-retail .mu-product-card__media img { object-fit: contain; padding: 10px; }
body.tpl-retail .mu-product-card:hover .mu-product-card__media img { transform: scale(1.03); }
body.tpl-retail .mu-product-card__body { padding: var(--s3); gap: 6px; }
body.tpl-retail .mu-product-card__code { font-size: var(--fz-xs); }
body.tpl-retail .mu-product-card__name { font-size: var(--fz-sm); font-weight: 600; line-height: 1.35; min-height: 2.7em; }
body.tpl-retail .mu-product-card .mu-stars { font-size: var(--fz-xs); }
body.tpl-retail .mu-product-card__meta { gap: 4px; }
body.tpl-retail .mu-product-card__meta .mu-price { font-size: var(--fz-base); font-weight: 800; color: var(--mu-ink); }
body.tpl-retail .mu-product-card__meta .mu-price__cur { color: var(--mu-muted); }
body.tpl-retail .mu-product-card__actions { padding-top: var(--s2); }
body.tpl-retail .mu-product-card__actions .mu-btn { font-size: var(--fz-sm); padding: 8px 10px; }
/* Make the gold Add the lead action; View is a compact ghost button. */
body.tpl-retail .mu-product-card__actions .mu-btn--ghost { flex: 0 0 auto; min-width: 44px; }
body.tpl-retail .mu-product-card__actions .mu-btn--gold { font-weight: 700; }

/* ------------------------------------------------------------ RESPONSIVE --- */
@media (max-width: 1100px) {
    body.tpl-retail .mu-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    body.tpl-retail .mu-grid { grid-template-columns: repeat(3, 1fr); }
    body.tpl-retail .rtl-reassure { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body.tpl-retail .rtl-grid { grid-template-columns: 1fr; gap: var(--s4); }
    body.tpl-retail .rtl-buybox { padding: var(--s4); }
    body.tpl-retail .rtl-price { font-size: var(--fz-2xl); }
}
@media (max-width: 560px) {
    body.tpl-retail .mu-grid { grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
    body.tpl-retail .mu-product-card__name { min-height: 0; }
}
