/* ============================================================
   Modern 2026 — PRODUCT DETAIL PAGE
   ------------------------------------------------------------
   Responsive across phones (≤575), tablets (≤991) and desktop.
   Loaded LAST so it overrides legacy + theme + RTL sheets.
   ============================================================ */

/* Brand-tinted neutral background behind the gallery on desktop */
.m-product {
    --m-prod-radius: 24px;
    --m-prod-pad:    clamp(16px, 3vw, 28px);
    --m-prod-soft:   color-mix(in srgb, var(--m-brand, #b8541a) 8%, #fff);
    --m-prod-line:   color-mix(in srgb, var(--m-brand, #b8541a) 14%, #f5efe8);
    background: linear-gradient(180deg, #fbf8f3 0%, #fff 220px);
    padding-block: clamp(28px, 5vw, 70px);
}

/* ===========================================================
   00. SAUDI RIYAL ICON — global override
   ===========================================================
   The legacy stylesheet `style.css` forces `.Saudi_Riyal` to
   `width: 15px !important; height: 17px !important;` which
   stretches the icon and clips it inside our larger price
   blocks. Cancel both inside any product/tax/related context
   so the per-rule `width: …` below can size it freely.
*/
.m-product .Saudi_Riyal,
.m-tax-panel .Saudi_Riyal,
.m-related .Saudi_Riyal,
.m-product__sticky .Saudi_Riyal {
    height: auto !important;
    margin: 0 2px !important;
    vertical-align: middle !important;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}

/* ===========================================================
   01. HERO — gallery + info two-column grid
   =========================================================== */
.m-product__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(20px, 3.5vw, 56px);
    align-items: start;
}
@media (max-width: 991.98px) {
    .m-product__grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ===========================================================
   02. GALLERY — bigger, framed, sticky on desktop
   =========================================================== */
.m-product__gallery {
    background: #fff;
    border: 1px solid var(--m-line, rgba(0,0,0,.06));
    border-radius: var(--m-prod-radius);
    padding: clamp(14px, 2vw, 22px);
    box-shadow:
        0 24px 60px -28px rgba(0,0,0,.18),
        0 6px 18px -10px rgba(0,0,0,.10);
    position: relative;
    overflow: hidden;
}
@media (min-width: 992px) {
    .m-product__gallery { position: sticky; top: 96px; }
}

/* Decorative brand glow behind the gallery */
.m-product__gallery::before {
    content: "";
    position: absolute;
    top: -40%;
    inset-inline-end: -30%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, color-mix(in srgb, var(--m-brand,#b8541a) 18%, transparent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.m-product__gallery .exzoom,
.m-product__gallery .exzoom_img_box,
.m-product__gallery .exzoom_img_box img {
    position: relative;
    z-index: 1;
    border-radius: 16px;
    overflow: hidden;
}

/* Floating discount badge */
.m-product__discount {
    position: absolute;
    top: 18px;
    inset-inline-start: 18px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: 0 10px 22px -6px rgba(239,68,68,.55);
    z-index: 5;
    letter-spacing: .02em;
}

/* ===========================================================
   03. INFO PANEL — title, price, chips, description
   =========================================================== */
.m-product__info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Tiny breadcrumb / category chip above the title */
.m-product__crumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--m-text-mute, #7a685a);
    background: var(--m-prod-soft);
    padding: 6px 14px;
    border-radius: 999px;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.m-product__crumb i { color: var(--m-brand, #b8541a); font-size: 11px; }

/* Title */
.m-product__title {
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: clamp(24px, 4.5vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--m-text, #2a1f17);
    margin: 0;
}

/* Rating row */
.m-product__rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #f59e0b;
    font-size: 14px;
    letter-spacing: 1px;
}
.m-product__rating .count {
    color: var(--m-text-mute, #7a685a);
    font-size: 13px;
    margin-inline-start: 4px;
    letter-spacing: 0;
}

/* Quick-info chips (calorie, time, etc) */
.m-product__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.m-product__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--m-line, rgba(0,0,0,.08));
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--m-text-soft, #4a3b30);
}
.m-product__chip i { color: var(--m-brand, #b8541a); font-size: 12px; }
.m-product__chip--cal i { color: #ef6a36; }
.m-product__chip--time i { color: #2563eb; }
.m-product__chip--veg i { color: #16a34a; }

/* Price block */
.m-product__price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: var(--m-prod-soft);
    border-radius: 18px;
    border: 1px dashed var(--m-prod-line);
}
.m-product__price-current {
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 800;
    color: var(--m-brand, #b8541a);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.m-product__price-current img.Saudi_Riyal,
.m-product__price-current svg {
    width: 24px !important;
    height: 24px !important;     /* explicit — beats legacy 17px !important */
    margin: 0 4px !important;
    vertical-align: middle !important;
}
.m-product__price-old {
    font-size: 18px;
    color: var(--m-text-mute, #7a685a);
    text-decoration: line-through;
    opacity: .8;
}
.m-product__price-saved {
    background: #16a34a;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    margin-inline-start: auto;
    letter-spacing: .03em;
}

/* Short description */
.m-product__desc {
    font-size: 15px;
    line-height: 1.75;
    color: var(--m-text-soft, #4a3b30);
    margin: 0;
}

/* ===========================================================
   04. ALLERGENS PANEL — professional warning panel
   =========================================================== */
.m-allergens-panel {
    background: linear-gradient(135deg, #fef9e7 0%, #fff5d6 100%);
    border: 1px solid #f7d97f;
    border-radius: 18px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}
.m-allergens-panel::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.m-allergens-panel__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.m-allergens-panel__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 6px 14px -4px rgba(245,158,11,.45);
}
.m-allergens-panel__title {
    font-size: 14.5px;
    font-weight: 800;
    color: #78350f;
    margin: 0;
    line-height: 1.3;
}
.m-allergens-panel__sub {
    font-size: 11.5px;
    color: #92400e;
    margin: 0;
    opacity: .85;
}

.m-allergens-panel__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.m-allergen-item {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--m-text, #2a1f17);
    transition: transform .25s ease, box-shadow .25s ease;
}
.m-allergen-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -10px rgba(245,158,11,.35);
}
.m-allergen-item__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
}
.m-allergen-item[data-color="warning"] .m-allergen-item__icon { background: #f59e0b; }
.m-allergen-item[data-color="danger"]  .m-allergen-item__icon { background: #ef4444; }
.m-allergen-item[data-color="info"]    .m-allergen-item__icon { background: #0891b2; }
.m-allergen-item[data-color="success"] .m-allergen-item__icon { background: #16a34a; }
.m-allergen-item[data-color="primary"] .m-allergen-item__icon { background: #2563eb; }

/* "No allergens" pleasant variant */
.m-allergens-panel--clean {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #6ee7b7;
}
.m-allergens-panel--clean::before { background: linear-gradient(180deg, #10b981, #059669); }
.m-allergens-panel--clean .m-allergens-panel__icon { background: #10b981; box-shadow: 0 6px 14px -4px rgba(16,185,129,.45); }
.m-allergens-panel--clean .m-allergens-panel__title { color: #065f46; }
.m-allergens-panel--clean .m-allergens-panel__sub   { color: #047857; }

/* ===========================================================
   05. SIZE SELECTOR — modern card-style radio
   =========================================================== */
.m-product__field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.m-product__field-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--m-text, #2a1f17);
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.m-product__field-title small {
    font-weight: 500;
    color: var(--m-text-mute, #7a685a);
    font-size: 12px;
}
.m-product__field-title i { color: var(--m-brand, #b8541a); }

.m-size-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.m-size-list .form-check {
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
}
.m-size-list .form-check-input {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none;
}
.m-size-list .form-check-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 2px solid var(--m-line, rgba(0,0,0,.08));
    border-radius: 14px;
    padding: 12px 10px;
    cursor: pointer;
    transition: all .25s var(--m-ease, ease);
    text-align: center;
    line-height: 1.2;
}
.m-size-list .form-check-label::before {
    content: attr(data-size);
    font-weight: 700;
    font-size: 14px;
    color: var(--m-text, #2a1f17);
}
.m-size-list .form-check-label span {
    font-size: 13px;
    font-weight: 600;
    color: var(--m-brand, #b8541a);
}
.m-size-list .form-check-label:hover {
    border-color: var(--m-brand, #b8541a);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -10px rgba(var(--theme-brand-rgb,184,84,26), .35);
}
.m-size-list .form-check-input:checked + .form-check-label {
    border-color: var(--m-brand, #b8541a);
    background: linear-gradient(135deg, color-mix(in srgb, var(--m-brand, #b8541a) 12%, #fff), #fff);
    box-shadow: 0 10px 22px -10px rgba(var(--theme-brand-rgb,184,84,26), .45),
                inset 0 0 0 1px var(--m-brand, #b8541a);
}
.m-size-list .form-check-input:checked + .form-check-label::after {
    content: "\f00c";
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 18px; height: 18px;
    background: var(--m-brand, #b8541a);
    color: #fff;
    border-radius: 50%;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* The form-check-label needs position:relative for the ::after */
.m-size-list .form-check { position: relative; }

/* ===========================================================
   06. ADDONS — checkbox toggle cards
   =========================================================== */
.m-addon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.m-addon-list .form-check {
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
    position: relative;
}
.m-addon-list .form-check-input {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none;
}
.m-addon-list .form-check-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border: 1.5px solid var(--m-line, rgba(0,0,0,.08));
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all .25s var(--m-ease, ease);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--m-text, #2a1f17);
    line-height: 1.3;
}
.m-addon-list .form-check-label span {
    font-size: 12.5px;
    color: var(--m-brand, #b8541a);
    font-weight: 700;
    background: var(--m-prod-soft);
    padding: 3px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.m-addon-list .form-check-label:hover {
    border-color: var(--m-brand, #b8541a);
    transform: translateY(-1px);
}
.m-addon-list .form-check-input:checked + .form-check-label {
    border-color: var(--m-brand, #b8541a);
    background: linear-gradient(135deg, color-mix(in srgb, var(--m-brand, #b8541a) 8%, #fff), #fff);
    box-shadow: inset 0 0 0 1px var(--m-brand, #b8541a),
                0 6px 14px -6px rgba(var(--theme-brand-rgb,184,84,26), .35);
}
.m-addon-list .form-check-input:checked + .form-check-label::before {
    content: "\f00c";
    margin-inline-end: 6px;
    color: var(--m-brand, #b8541a);
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
}

/* ===========================================================
   07. QUANTITY STEPPER + LIVE TOTAL
   =========================================================== */
.m-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--m-line, rgba(0,0,0,.08));
    border-radius: 16px;
}
.m-qty-stepper {
    display: inline-flex;
    align-items: center;
    background: var(--m-bg-2, #f7f3ee);
    border-radius: 999px;
    padding: 4px;
}
.m-qty-stepper button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    color: var(--m-text, #2a1f17);
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .25s var(--m-ease, ease);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.m-qty-stepper button:hover {
    background: var(--m-brand, #b8541a);
    color: #fff;
}
.m-qty-stepper input {
    width: 44px;
    text-align: center;
    border: 0;
    background: transparent;
    font-weight: 700;
    font-size: 15px;
    color: var(--m-text, #2a1f17);
    pointer-events: none;
}
.m-qty-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}
.m-qty-total small {
    font-size: 11px;
    color: var(--m-text-mute, #7a685a);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 4px;
}
.m-qty-total strong {
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--m-brand, #b8541a);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.m-qty-total strong .Saudi_Riyal { width: 18px !important; height: auto; }

/* ===========================================================
   08. PRIMARY ACTIONS (add-to-cart + wishlist)
   =========================================================== */
.m-product__actions {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.m-product__actions .m-btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--m-brand, #b8541a), var(--m-brand-dark, #8a3f12));
    color: #fff !important;
    border: 0;
    border-radius: 16px;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 14px 28px -10px rgba(var(--theme-brand-rgb,184,84,26), .55);
    transition: all .3s var(--m-ease, ease);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.m-product__actions .m-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 36px -12px rgba(var(--theme-brand-rgb,184,84,26), .7);
}
.m-product__actions .m-btn-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: #fff;
    border: 2px solid var(--m-line, rgba(0,0,0,.08));
    color: var(--m-text, #2a1f17);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all .25s var(--m-ease, ease);
}
.m-product__actions .m-btn-icon:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* ===========================================================
   09. TABS (Description + Reviews) — modern segmented control
   =========================================================== */
.m-product__tabs {
    margin-top: clamp(36px, 5vw, 64px);
    background: #fff;
    border: 1px solid var(--m-line, rgba(0,0,0,.06));
    border-radius: 24px;
    padding: clamp(18px, 3vw, 32px);
    box-shadow: 0 14px 36px -22px rgba(0,0,0,.15);
}
.m-product__tabs .nav-pills {
    display: inline-flex;
    background: var(--m-bg-2, #f7f3ee);
    padding: 5px;
    border-radius: 999px;
    margin-bottom: 22px;
    gap: 4px;
}
.m-product__tabs .nav-pills .nav-link {
    background: transparent !important;
    border: 0;
    color: var(--m-text-soft, #4a3b30) !important;
    padding: 10px 22px !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all .25s var(--m-ease, ease);
}
.m-product__tabs .nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--m-brand, #b8541a), var(--m-brand-dark, #8a3f12)) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px -6px rgba(var(--theme-brand-rgb,184,84,26), .45);
}

/* ===========================================================
   10. RELATED PRODUCTS — section heading + spacing
   =========================================================== */
.m-product__related {
    margin-top: clamp(40px, 6vw, 80px);
}
.m-product__related-title {
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--m-text, #2a1f17);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.m-product__related-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 28px;
    background: var(--m-brand, #b8541a);
    border-radius: 2px;
}

/* ===========================================================
   11. STICKY MOBILE CTA — fixed bottom bar (≤991px)
   =========================================================== */
.m-product__sticky {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1030;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--m-line, rgba(0,0,0,.08));
    padding: 12px max(14px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-right));
    display: none;                       /* hidden on desktop */
    align-items: center;
    gap: 12px;
    box-shadow: 0 -10px 30px -12px rgba(0,0,0,.18);
    transform: translateY(110%);
    transition: transform .3s cubic-bezier(.4,.2,.2,1);
}
.m-product__sticky.is-visible { transform: translateY(0); }

.m-product__sticky-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.m-product__sticky-info small {
    font-size: 11px;
    color: var(--m-text-mute, #7a685a);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.m-product__sticky-info strong {
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--m-brand, #b8541a);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.m-product__sticky-info strong .Saudi_Riyal { width: 16px !important; height: auto; }

.m-product__sticky-btn {
    background: linear-gradient(135deg, var(--m-brand, #b8541a), var(--m-brand-dark, #8a3f12));
    color: #fff;
    border: 0;
    border-radius: 14px;
    padding: 14px 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 22px -6px rgba(var(--theme-brand-rgb,184,84,26), .55);
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.m-product__sticky-btn i { font-size: 16px; }

@media (max-width: 991.98px) {
    .m-product__sticky { display: flex; }
    /* Add bottom padding to body so the sticky bar doesn't cover content */
    .m-product { padding-bottom: 100px; }
}

/* ===========================================================
   12. TAX BREAKDOWN PANEL (KSA 15% VAT)
   ===========================================================
   Used on the QR-flow product page to show price-without-tax,
   tax amount and total — so the customer sees exactly what
   they're paying before adding to cart.
*/
.m-tax-panel {
    background: linear-gradient(135deg, #fdfaf5 0%, #faf3e8 100%);
    border: 1px solid var(--m-prod-line);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.m-tax-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
    color: var(--m-text-soft, #4a3b30);
}
.m-tax-panel__row strong {
    font-weight: 700;
    color: var(--m-text, #2a1f17);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.m-tax-panel__row .Saudi_Riyal {
    width: 13px !important;
    height: auto;
    filter: none;
}
.m-tax-panel__row--tax {
    color: #d97706;
}
.m-tax-panel__row--tax strong { color: #d97706; }
.m-tax-panel__row--total {
    border-top: 1px dashed var(--m-prod-line);
    padding-top: 10px;
    margin-top: 4px;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--m-text, #2a1f17);
}
.m-tax-panel__row--total strong {
    color: var(--m-brand, #b8541a);
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: 19px;
}
.m-tax-panel__row--total strong .Saudi_Riyal { width: 16px !important; }

/* ===========================================================
   13. RELATED PRODUCTS — compact "mini" cards
   ===========================================================
   Smaller, denser horizontal cards. Mobile uses a horizontal
   swipe rail (Jahez-style). Desktop uses a tight grid.
*/
.m-related {
    margin-top: clamp(40px, 6vw, 80px);
}
.m-related__title {
    font-family: var(--m-font-display, "Playfair Display"), serif;
    font-size: clamp(20px, 3.6vw, 28px);
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--m-text, #2a1f17);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.m-related__title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--m-brand, #b8541a);
    border-radius: 2px;
}

/* Grid container — responsive, denser than the main grid */
.m-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

/* Single mini-card */
.m-related-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--m-line, rgba(0,0,0,.06));
    border-radius: 14px;
    overflow: hidden;
    transition: transform .25s var(--m-ease, ease), box-shadow .25s var(--m-ease, ease);
    display: flex;
    flex-direction: column;
}
.m-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px -16px rgba(0,0,0,.18);
    border-color: rgba(var(--theme-brand-rgb, 184,84,26), .25);
}

/* Image area — square, smaller (was big in legacy) */
.m-related-card__img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--m-bg-2, #f7f3ee);
}
.m-related-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.m-related-card:hover .m-related-card__img img { transform: scale(1.07); }

/* Category chip on image */
.m-related-card__cat {
    position: absolute;
    top: 6px;
    inset-inline-start: 6px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
    color: var(--m-brand, #b8541a) !important;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 3px 8px;
    border-radius: 999px;
    text-decoration: none !important;
    line-height: 1;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Quick-add floating button */
.m-related-card__add {
    position: absolute;
    bottom: 6px;
    inset-inline-end: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--m-brand, #b8541a), var(--m-brand-dark, #8a3f12));
    color: #fff !important;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 8px 16px -6px rgba(var(--theme-brand-rgb,184,84,26), .55);
    transition: transform .2s ease;
    text-decoration: none !important;
}
.m-related-card__add:hover {
    transform: scale(1.1);
    color: #fff !important;
}

/* Body — title + price */
.m-related-card__body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.m-related-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
    font-size: 9.5px;
    margin: 0;
}
.m-related-card__rating .count {
    color: var(--m-text-mute, #7a685a);
    font-size: 9.5px;
    margin-inline-start: 3px;
}
.m-related-card__title {
    color: var(--m-text, #2a1f17) !important;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}
.m-related-card__title:hover { color: var(--m-brand, #b8541a) !important; }
.m-related-card__price {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--m-brand, #b8541a);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}
.m-related-card__price .Saudi_Riyal {
    width: 11px !important;
    height: auto;
    margin: 0;
}
.m-related-card__price del {
    font-size: 11px;
    color: var(--m-text-mute, #7a685a);
    font-weight: 500;
    margin-inline-start: 4px;
}

/* Mobile: horizontal swipe rail (Jahez-style) */
@media (max-width: 575.98px) {
    .m-related__grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 14px 12px;
        margin: 0 -14px 0;
    }
    .m-related__grid::-webkit-scrollbar { display: none; }
    .m-related-card {
        flex: 0 0 150px;
        scroll-snap-align: start;
    }
    .m-related-card__img { aspect-ratio: 1 / 1; }
    .m-related-card__title { font-size: 12px; min-height: 30px; }
    .m-related-card__price { font-size: 13px; }
    .m-related__title { font-size: 18px; padding-inline: 4px; }
}

/* Tiny phones */
@media (max-width: 360px) {
    .m-related-card { flex-basis: 138px; }
}

/* ===========================================================
   14. EXTRA MOBILE TWEAKS
   =========================================================== */
@media (max-width: 575.98px) {
    .m-product__info { gap: 14px; }
    .m-product__price { padding: 12px 14px; }
    .m-product__price-current { font-size: 26px; }
    .m-product__price-old { font-size: 15px; }
    .m-product__chips { gap: 6px; }
    .m-product__chip { padding: 6px 11px; font-size: 11.5px; }

    .m-allergens-panel { padding: 14px 14px 14px 18px; }
    .m-allergens-panel__list { grid-template-columns: 1fr 1fr; }
    .m-allergen-item { padding: 8px 10px; font-size: 12px; }
    .m-allergen-item__icon { width: 26px; height: 26px; font-size: 11px; }

    .m-size-list { grid-template-columns: repeat(3, 1fr); }
    .m-addon-list { grid-template-columns: 1fr; }

    .m-product__actions .m-btn-primary { padding: 14px 20px; font-size: 14px; }
    .m-product__actions .m-btn-icon { width: 50px; height: 50px; }

    .m-product__tabs { padding: 16px 14px; }
    .m-product__tabs .nav-pills .nav-link { padding: 8px 16px !important; font-size: 13px !important; }
}

/* Tiny phones (< 360px) */
@media (max-width: 360px) {
    .m-allergens-panel__list { grid-template-columns: 1fr; }
    .m-size-list { grid-template-columns: repeat(2, 1fr); }
}
