/* =========================================================
   CouponsArena – Store detail (storedetail.css)
   Dark Premium Purple/Magenta Theme with Dots
   FIX: no longer overrides body padding (navbar offset) or
        the navbar's :root colour variables.
   ========================================================= */

/* Variables are scoped to the page so they can't leak into the navbar */
.store-detail-page {
    --brand-primary: #a855f7;
    --brand-primary-dark: #7e22ce;
    --brand-primary-light: #d8b4fe;
    --brand-accent: #ec4899;
    --brand-deep-purple: #3b0764;

    --bg-body: #08050e;
    --bg-surface: rgba(26, 11, 46, 0.5);
    --bg-surface-hover: rgba(126, 34, 206, 0.15);
    --bg-dark: #050505;
    --bg-dark-accent: #1a0b2e;

    --text-main: #ffffff;
    --text-body: #d1d5db;
    --text-muted: #9ca3af;
    --text-light: #ffffff;
    --text-light-muted: #e5e7eb;

    --border-light: rgba(255, 255, 255, 0.08);
    --border-dark: rgba(126, 34, 206, 0.3);

    --gradient-brand: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-brand: 0 4px 14px 0 rgba(168, 85, 247, 0.25);

    --radius: 14px;
}

/* Background only. DO NOT reset padding/margin here:
   navbar.css gives body `padding-top: var(--nav-h)` for the fixed header. */
body {
    background-color: #08050e !important;
}

/* =========================================
   Gradient + Dots texture
   ========================================= */
.store-detail-page {
    background-color: var(--bg-body);
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(180deg, #050505 0%, #2e0a4f 50%, #08050e 100%);
    background-size: 20px 20px, 100% 100%;
    background-position: top left, center;
    background-attachment: fixed;

    color: var(--text-body);
    padding: 2rem 0 3rem;
    min-height: calc(100vh - var(--nav-h, 110px));
    width: 100%;
}

.store-detail-page [hidden] { display: none !important; }
.sd-wrap { padding: 0 1.5rem; position: relative; z-index: 1; }

/* ---------- Breadcrumb ---------- */
.sd-breadcrumb { margin-bottom: 1rem; }
.sd-breadcrumb .breadcrumb {
    display: flex; flex-wrap: wrap; margin: 0; padding: .65rem 1rem;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); font-size: .9rem;
    backdrop-filter: blur(10px);
}
.sd-breadcrumb .breadcrumb-item { font-weight: 700; }
.sd-breadcrumb .breadcrumb-item a { color: var(--brand-primary); text-decoration: none; transition: color 0.2s; }
.sd-breadcrumb .breadcrumb-item a:hover { color: var(--brand-accent); }
.sd-breadcrumb .breadcrumb-item.active { color: var(--text-main); }
.sd-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.sd-breadcrumb .text-muted { color: var(--text-muted) !important; }

/* ---------- Generic card ---------- */
.sd-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

/* ---------- Store header ---------- */
.store-header { position: relative; overflow: hidden; margin-bottom: 1.25rem; padding: 1.1rem 1.3rem 1.1rem 1.5rem; }
.store-header::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gradient-brand);
}
.store-header::after {
    content: ''; position: absolute; right: -50px; top: -50px; width: 160px; height: 160px;
    border-radius: 50%; background: radial-gradient(circle, rgba(236, 72, 153, .18), transparent 70%);
    pointer-events: none;
}
.store-header-inner { display: flex; align-items: center; gap: 1rem; position: relative; z-index: 1; }
.store-logo {
    flex: 0 0 72px; width: 72px; height: 72px; object-fit: contain; padding: .35rem;
    background: #fff; border: 1px solid var(--border-light); border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.store-logo-fallback {
    flex: 0 0 72px; width: 72px; height: 72px; display: grid; place-items: center;
    color: #fff; font-size: 1.8rem; font-weight: 800; background: var(--gradient-brand); border-radius: 14px;
}
.store-title { margin: 0 0 .25rem; color: var(--text-main); font-size: 1.45rem; font-weight: 800; line-height: 1.25; }
.store-description { margin: 0; color: var(--text-light-muted); font-size: .88rem; line-height: 1.55; }

/* ---------- Coupon cards ---------- */
.coupon-card {
    position: relative; display: flex; flex-direction: column; height: 100%;
    padding: 1rem .9rem .8rem; text-align: center;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
    animation: fadeInUp .45s ease backwards;
    backdrop-filter: blur(10px);
}
.coupon-card::before {
    content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 3px;
    background: var(--gradient-brand); border-radius: 0 0 4px 4px; opacity: 0; transition: opacity .25s ease;
}
.coupon-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-primary);
    background: var(--bg-surface-hover);
    box-shadow: var(--shadow-md), var(--shadow-brand);
}
.coupon-card:hover::before { opacity: 1; }
.coupon-card.is-expired { opacity: .6; }

.coupon-store-img { width: 50px; height: 50px; margin: 0 auto .6rem; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.coupon-title { margin: 0 0 .4rem; color: var(--text-main); font-size: .9rem; font-weight: 700; line-height: 1.35; }
.coupon-description { margin: 0 0 .7rem; color: var(--text-light-muted); font-size: .78rem; line-height: 1.4; }

.coupon-action { margin-top: auto; }
.reveal-btn, .deal-btn {
    display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%;
    padding: .5rem .8rem; color: #fff; font-size: .82rem; font-weight: 600; text-decoration: none;
    border: 0; border-radius: 999px; cursor: pointer;
    transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.reveal-btn { background: var(--gradient-brand); box-shadow: var(--shadow-brand); }
.deal-btn { background: linear-gradient(135deg, #7e22ce 0%, #4c1d95 100%); box-shadow: 0 4px 14px rgba(76, 29, 149, .3); }
.reveal-btn:hover, .deal-btn:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.1); }

.code-box {
    display: flex; overflow: hidden; border: 1.5px dashed var(--brand-primary);
    border-radius: 10px; background: rgba(126, 34, 206, .15);
}
.code-box input {
    flex: 1; min-width: 0; padding: .45rem .4rem; text-align: center;
    color: var(--text-main); font-family: 'Courier New', monospace; font-size: .85rem; font-weight: 800; letter-spacing: .04em;
    background: transparent; border: 0; outline: 0;
}
.btn-copy {
    flex: 0 0 38px; display: grid; place-items: center; color: #fff; font-size: .8rem;
    background: var(--brand-primary); border: 0; cursor: pointer; transition: background .2s ease;
}
.btn-copy:hover { background: var(--brand-accent); }
.btn-copy.is-copied { background: #16a34a; }
.copy-ok { margin-top: .3rem; color: #16a34a; font-size: .72rem; font-weight: 700; }

.coupon-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--border-light);
    color: var(--text-muted); font-size: .78rem; font-weight: 600;
}
.coupon-footer i { margin-right: .3rem; }
.coupon-footer .clicks i { color: var(--brand-primary); }
.coupon-footer .expiry { color: var(--text-muted); }
.coupon-footer .expiry i { color: var(--text-muted); }
.coupon-footer .expiry.is-past, .coupon-footer .expiry.is-past i { color: #ef4444; }

/* Empty */
.empty-state { padding: 3rem 1.5rem; text-align: center; background: var(--bg-surface); border: 1.5px dashed var(--border-dark); border-radius: var(--radius); }
.empty-icon {
    width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 1rem;
    color: #fff; font-size: 1.4rem; background: var(--gradient-brand); border-radius: 18px; box-shadow: var(--shadow-brand);
}
.empty-state h4 { color: var(--text-main); font-weight: 800; font-size: 1.15rem; }
.empty-state p { max-width: 440px; margin: 0 auto; font-size: .9rem; color: var(--text-light-muted); }

/* ---------- Content / related articles ---------- */
.content-card {
    position: relative; overflow: hidden; margin-top: 2rem; padding: 2.2rem 2.4rem;
    /* solid, readable panel behind the long-form content */
    background:
        radial-gradient(60% 40% at 100% 0%, rgba(236, 72, 153, .10) 0%, transparent 70%),
        radial-gradient(50% 35% at 0% 100%, rgba(147, 51, 234, .14) 0%, transparent 70%),
        linear-gradient(180deg, #170a2b 0%, #0f0719 100%);
    border: 1px solid var(--border-dark);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.content-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--gradient-brand); }
.section-title { margin: 0 0 1.2rem; color: var(--text-main); font-size: 1.35rem; font-weight: 800; }
.section-title::after { content: ''; display: block; width: 44px; height: 4px; margin-top: .5rem; border-radius: 4px; background: var(--gradient-brand); }

.store-article { color: var(--text-body); font-size: 1rem; line-height: 1.85; overflow-wrap: anywhere; }
.store-article > *:first-child { margin-top: 0; }
.store-article h1, .store-article h2, .store-article h3, .store-article h4 { margin: 1.8rem 0 .8rem; color: var(--text-main); font-weight: 800; line-height: 1.3; }
.store-article h1 { font-size: 1.6rem; }
.store-article h2 { font-size: 1.45rem; }
.store-article h3 { font-size: 1.2rem; }
.store-article p { margin: 0 0 1.1rem; }
.store-article a { color: var(--brand-primary); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid rgba(168, 85, 247, .3); }
.store-article a:hover { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.store-article img { display: block; max-width: 100%; height: auto; margin: 1.3rem auto; border-radius: 10px; }
.store-article ul, .store-article ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.store-article li { margin-bottom: .4rem; }
.store-article li::marker { color: var(--brand-primary); font-weight: 700; }
.store-article hr { margin: 1.8rem 0; border: 0; height: 1px; background: var(--border-light); opacity: 1; }
.store-article table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 1.4rem 0; border-collapse: collapse; }
.store-article th { padding: .6rem .9rem; text-align: left; color: #fff; background: var(--brand-deep-purple); }
.store-article td { padding: .55rem .9rem; border-top: 1px solid var(--border-light); }
.store-article blockquote {
    margin: 1.4rem 0; padding: 1rem 1.2rem; font-style: italic; color: var(--text-main);
    background: rgba(126, 34, 206, .15); border-left: 4px solid var(--brand-primary); border-radius: 0 10px 10px 0;
}

/* =========================================================
   .article-content  (CKEditor output: {!! $blog->content !!})
   Also applied to .store-article for the CKEditor-specific parts
   ========================================================= */
.article-content {
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.article-content::after { content: ''; display: block; clear: both; } /* contain floated images */
.article-content > *:first-child { margin-top: 0 !important; }
.article-content > *:last-child { margin-bottom: 0 !important; }

/* Headings */
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
    margin: 1.9rem 0 .8rem; color: var(--text-main); font-weight: 800; line-height: 1.3;
}
.article-content h1 { font-size: 1.7rem; }
.article-content h2 {
    font-size: 1.45rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border-light);
}
.article-content h3 { font-size: 1.2rem; }
.article-content h4 { font-size: 1.08rem; }
.article-content h5, .article-content h6 { font-size: 1rem; color: var(--brand-primary-light); }

/* Text */
.article-content p { margin: 0 0 1.1rem; }
.article-content strong, .article-content b { color: var(--text-main); font-weight: 700; }
.article-content em, .article-content i:not([class]) { color: var(--text-light-muted); }
.article-content mark { padding: .05em .3em; color: #fff; background: rgba(236, 72, 153, .35); border-radius: 4px; }
.article-content small { color: var(--text-muted); }
.article-content sub, .article-content sup { line-height: 0; }

/* Links */
.article-content a {
    color: var(--brand-primary); font-weight: 600; text-decoration: none;
    border-bottom: 1.5px solid rgba(168, 85, 247, .3); transition: color .2s, border-color .2s;
}
.article-content a:hover { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }

/* Lists (incl. CKEditor to-do lists) */
.article-content ul, .article-content ol { margin: 0 0 1.2rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: .45rem; }
.article-content li > ul, .article-content li > ol { margin: .45rem 0 0; }
.article-content li::marker { color: var(--brand-primary); font-weight: 700; }
.article-content ul.todo-list { list-style: none; padding-left: .2rem; }
.article-content .todo-list__label { display: flex; align-items: flex-start; gap: .5rem; }

/* Images + CKEditor figures */
.article-content img { max-width: 100%; height: auto; border-radius: 10px; }
.article-content > img, .article-content p > img:only-child {
    display: block; margin: 1.3rem auto;
}
.article-content figure { margin: 1.5rem auto; max-width: 100%; }
.article-content figure.image { display: table; clear: both; text-align: center; margin: 1.5rem auto; }
.article-content figure.image img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.article-content figure.image > figcaption,
.article-content figure > figcaption {
    display: table-caption; caption-side: bottom; padding: .5rem .8rem;
    color: var(--text-muted); font-size: .82rem; text-align: center; background: rgba(0, 0, 0, .25);
    border-radius: 0 0 10px 10px; word-break: break-word;
}
/* CKEditor 5 image alignment */
.article-content .image-style-side,
.article-content .image-style-align-right { float: right; max-width: 50%; margin: .4rem 0 1rem 1.5rem; }
.article-content .image-style-align-left { float: left; max-width: 50%; margin: .4rem 1.5rem 1rem 0; }
.article-content .image-style-align-center,
.article-content .image-style-block-align-center { margin-left: auto; margin-right: auto; }
.article-content .image-style-block-align-left { margin-left: 0; margin-right: auto; }
.article-content .image-style-block-align-right { margin-left: auto; margin-right: 0; }
.article-content .image_resized { max-width: 100%; display: block; box-sizing: border-box; }
.article-content .image_resized img { width: 100%; }
/* CKEditor 4 alignment */
.article-content img[style*="float:left"], .article-content img[style*="float: left"] { margin: .4rem 1.5rem 1rem 0; }
.article-content img[style*="float:right"], .article-content img[style*="float: right"] { margin: .4rem 0 1rem 1.5rem; }

/* Text alignment classes / inline styles */
.article-content .text-center, .article-content [style*="text-align:center"], .article-content [style*="text-align: center"] { text-align: center; }
.article-content .text-right, .article-content [style*="text-align:right"], .article-content [style*="text-align: right"] { text-align: right; }
.article-content [style*="text-align:justify"], .article-content [style*="text-align: justify"] { text-align: justify; }

/* Dark-theme safety net: CKEditor pastes inline black/white colours & fonts */
.article-content [style*="color"]:not(a):not(mark):not(th) { color: inherit !important; }
.article-content [style*="background-color"]:not(mark):not(th):not(td):not(code):not(pre) { background-color: transparent !important; }
.article-content [style*="font-family"] { font-family: inherit !important; }
.article-content [style*="font-size"] { font-size: inherit !important; }
.article-content [style*="line-height"] { line-height: inherit !important; }
.article-content [style*="margin-left"][style*="px"] { margin-left: 0 !important; }

/* Blockquote */
.article-content blockquote {
    clear: both; margin: 1.5rem 0; padding: 1rem 1.3rem; font-style: italic; color: var(--text-main);
    background: rgba(126, 34, 206, .15); border-left: 4px solid var(--brand-primary); border-radius: 0 10px 10px 0;
}
.article-content blockquote p:last-child { margin-bottom: 0; }

/* Code */
.article-content code {
    padding: .15em .45em; color: var(--brand-primary-light); font-size: .9em;
    font-family: 'Courier New', Consolas, monospace; background: rgba(0, 0, 0, .4);
    border: 1px solid var(--border-light); border-radius: 6px;
}
.article-content pre {
    margin: 1.4rem 0; padding: 1rem 1.2rem; overflow-x: auto; color: #e9d5ff;
    background: #0d0716; border: 1px solid var(--border-dark); border-radius: 12px; line-height: 1.6; tab-size: 4;
}
.article-content pre code { padding: 0; color: inherit; background: none; border: 0; font-size: .88rem; }

/* Tables (CKEditor wraps them in figure.table) */
.article-content figure.table { display: block; width: 100%; overflow-x: auto; margin: 1.5rem 0; }
.article-content table {
    width: 100% !important; max-width: 100%; margin: 1.5rem 0; border-collapse: collapse;
    font-size: .95rem; background: rgba(0, 0, 0, .2); border: 1px solid var(--border-light); border-radius: 10px;
}
.article-content figure.table table { margin: 0; }
.article-content .table-responsive-wrap, .article-content > table { display: block; overflow-x: auto; }
.article-content th {
    padding: .7rem .9rem; text-align: left; color: #fff; font-weight: 700;
    background: var(--brand-deep-purple) !important; border: 1px solid var(--border-dark);
}
.article-content td { padding: .65rem .9rem; color: var(--text-body); border: 1px solid var(--border-light); vertical-align: top; }
.article-content tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .03); }
.article-content tbody tr:hover td { background: rgba(126, 34, 206, .12); }

/* Media embeds (CKEditor oembed / iframes / video) */
.article-content figure.media { margin: 1.5rem 0; }
.article-content .raw-html-embed, .article-content .embed-responsive { max-width: 100%; }
.article-content iframe, .article-content video, .article-content embed {
    display: block; max-width: 100%; margin: 1.5rem auto; border: 0; border-radius: 12px;
}
.article-content figure.media oembed { display: block; width: 100%; }
.article-content div[data-oembed-url] > div { position: relative; padding-bottom: 56.25%; height: 0; }
.article-content div[data-oembed-url] iframe { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }

/* Misc */
.article-content hr { clear: both; margin: 2rem 0; border: 0; height: 1px; background: var(--border-light); opacity: 1; }
.article-content .page-break { display: none; }
.article-content .table-of-contents, .article-content details {
    margin: 1.2rem 0; padding: .8rem 1rem; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: 10px;
}
.article-content details summary { cursor: pointer; color: var(--text-main); font-weight: 700; }

/* Share the CKEditor-specific fixes with the store description content */
.store-article figure.image { display: table; margin: 1.5rem auto; text-align: center; clear: both; }
.store-article figure.image img { margin: 0 auto; }
.store-article figcaption { padding: .5rem .8rem; color: var(--text-muted); font-size: .82rem; text-align: center; }
.store-article [style*="color"]:not(a):not(mark):not(th) { color: inherit !important; }
.store-article [style*="background-color"]:not(mark):not(th):not(td) { background-color: transparent !important; }
.store-article [style*="font-family"] { font-family: inherit !important; }
.store-article pre { margin: 1.4rem 0; padding: 1rem 1.2rem; overflow-x: auto; color: #e9d5ff; background: #0d0716; border: 1px solid var(--border-dark); border-radius: 12px; }
.store-article code { padding: .15em .45em; color: var(--brand-primary-light); background: rgba(0, 0, 0, .4); border-radius: 6px; }
.store-article pre code { padding: 0; background: none; }
.store-article iframe, .store-article video { display: block; max-width: 100%; margin: 1.5rem auto; border: 0; border-radius: 12px; }

/* =========================================================
   Content polish (article-content + store-article)
   Better reading experience on the solid content panel
   ========================================================= */
.article-content, .store-article {
    color: #e2e0ea;               /* slightly brighter than --text-body for the darker panel */
    font-size: 1.04rem;
    line-height: 1.9;
    max-width: 78ch;              /* comfortable line length */
    margin-left: auto; margin-right: auto;
    letter-spacing: .005em;
}
.article-content figure.table, .article-content table,
.article-content pre, .article-content iframe, .article-content figure.image,
.store-article table, .store-article pre { max-width: 100%; }

/* Lead paragraph */
.article-content > p:first-of-type, .store-article > p:first-of-type {
    font-size: 1.12rem; color: #f3f0fa; line-height: 1.85;
}

/* Headings with accent */
.article-content h2, .store-article h2 {
    position: relative; margin-top: 2.4rem; padding: 0 0 .6rem 1rem;
    border-bottom: 1px solid var(--border-light);
}
.article-content h2::before, .store-article h2::before {
    content: ''; position: absolute; left: 0; top: .15em; bottom: .75em; width: 4px;
    border-radius: 4px; background: var(--gradient-brand);
}
.article-content h3, .store-article h3 { color: var(--brand-primary-light); }
.article-content h3::before, .store-article h3::before {
    content: '#'; margin-right: .45rem; color: var(--brand-accent); font-weight: 800;
}

/* Paragraph rhythm */
.article-content p, .store-article p { margin-bottom: 1.25rem; }

/* Custom bullets */
.article-content ul:not(.todo-list), .store-article ul { list-style: none; padding-left: 0; }
.article-content ul:not(.todo-list) > li, .store-article ul > li { position: relative; padding-left: 1.6rem; }
.article-content ul:not(.todo-list) > li::before, .store-article ul > li::before {
    content: ''; position: absolute; left: .25rem; top: .72em; width: 8px; height: 8px;
    border-radius: 50%; background: var(--gradient-brand); box-shadow: 0 0 8px rgba(236, 72, 153, .5);
}
.article-content ul:not(.todo-list) > li::marker, .store-article ul > li::marker { content: none; }
.article-content ol, .store-article ol { padding-left: 1.6rem; }
.article-content ol > li::marker, .store-article ol > li::marker { color: var(--brand-accent); font-weight: 800; }

/* Blockquote with quote mark */
.article-content blockquote, .store-article blockquote {
    position: relative; padding: 1.2rem 1.5rem 1.2rem 3.2rem; font-style: normal;
    color: #f3f0fa; background: linear-gradient(135deg, rgba(126, 34, 206, .22), rgba(236, 72, 153, .08));
    border: 1px solid var(--border-dark); border-left: 4px solid var(--brand-accent); border-radius: 0 14px 14px 0;
}
.article-content blockquote::before, .store-article blockquote::before {
    content: '\201C'; position: absolute; left: 1rem; top: .2rem;
    font-size: 3rem; line-height: 1; font-family: Georgia, serif; color: var(--brand-accent); opacity: .8;
}

/* Images: soft frame */
.article-content img, .store-article img {
    border: 1px solid var(--border-light); box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

/* Tables: contained on the panel */
.article-content figure.table, .article-content > table { border: 1px solid var(--border-dark); border-radius: 12px; }
.article-content th { background: linear-gradient(135deg, #4c1d95, #3b0764) !important; }

/* Links: clearer underline */
.article-content a, .store-article a {
    color: var(--brand-primary-light); border-bottom: 1.5px solid rgba(216, 180, 254, .35);
}
.article-content a:hover, .store-article a:hover { color: #fff; border-bottom-color: var(--brand-accent); }

/* Selection colour */
.article-content ::selection, .store-article ::selection { background: rgba(236, 72, 153, .45); color: #fff; }

/* =========================================================
   RELATED ARTICLES — STACKED LAYOUT
   Image on top → Title → Full content → Read more
   (matches streamcoupon.com store page)
   ========================================================= */
.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

.related-article-card {
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.related-article-card:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

/* Full-width image on top */
.related-article-thumb {
    display: block;
    width: 100%;
    margin-bottom: 1.15rem;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
    background: rgba(0, 0, 0, .25);
}

.related-article-thumb img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    transition: transform .45s ease;
}

.related-article-card:hover .related-article-thumb img {
    transform: scale(1.03);
}

/* Title below the image */
.related-article-title {
    margin: 0 0 .9rem;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-main);
}

.related-article-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color .2s ease;
}

.related-article-title a:hover {
    color: var(--brand-primary);
}

/* Full content body below the title */
.related-article-body {
    max-width: 100% !important;
    margin: 0 0 1.2rem !important;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-light-muted);
}

.related-article-body > :first-child { margin-top: 0 !important; }
.related-article-body > :last-child  { margin-bottom: 0 !important; }

/* Read more pill */
.related-article-card .read-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    align-self: flex-start;
    padding: .5rem 1.2rem;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--gradient-brand);
    border-radius: 999px;
    box-shadow: var(--shadow-brand);
    transition: filter .2s ease, gap .2s ease;
}

.related-article-card .read-link:hover {
    color: #fff;
    filter: brightness(1.1);
    gap: .65rem;
}

/* Desktop: bigger typography for readability */
@media (min-width: 992px) {
    .related-article-title { font-size: 1.55rem; }
    .related-article-body  { font-size: 1.05rem; line-height: 1.85; }
    .related-article-thumb img { max-height: 460px; }
}

/* ---------- Sidebar ---------- */
.side-card { margin-bottom: 1.25rem; padding: 1.1rem 1.25rem; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; }
.side-title { display: flex; align-items: center; gap: .55rem; margin: 0; color: var(--text-main); font-size: .98rem; font-weight: 800; }
.side-title i { color: var(--brand-primary); }
.side-badge { padding: .18rem .7rem; color: #fff; font-size: .7rem; font-weight: 700; background: var(--gradient-brand); border-radius: 999px; }
.side-card h6.store-name { margin: 0 0 .6rem; color: var(--brand-primary); font-size: .95rem; font-weight: 800; }
.side-card p { margin: 0; color: var(--text-light-muted); font-size: .88rem; line-height: 1.8; }

.filter-list { display: grid; gap: .5rem; }
.filter-link {
    display: block; padding: .45rem .8rem; text-align: center;
    color: var(--text-main); font-size: .85rem; font-weight: 600; text-decoration: none;
    background: transparent; border: 1.5px solid var(--border-light); border-radius: 6px;
    transition: all .2s ease;
}
.filter-link:hover { color: var(--brand-primary); border-color: var(--brand-primary); background: rgba(126, 34, 206, .1); }
.filter-link.active { color: #fff; border-color: transparent; background: var(--gradient-brand); box-shadow: var(--shadow-brand); }

.share-card { text-align: center; }
.share-list { display: flex; justify-content: center; gap: .6rem; }
.share-btn {
    width: 34px; height: 34px; display: grid; place-items: center;
    color: #fff; font-size: .85rem; text-decoration: none; cursor: pointer; border: 0; border-radius: 50%;
    background: var(--brand-primary); transition: transform .2s ease, filter .2s ease;
}
.share-btn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.15); }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #0f1419; border: 1px solid var(--border-light); }
.share-btn.whatsapp { background: #25d366; }
.share-btn.copy-link { background: var(--gradient-brand); }
.share-btn.copied { background: #16a34a; }

.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.related-store {
    display: grid; place-items: center; min-height: 38px; padding: .45rem .5rem; text-align: center;
    color: var(--text-light-muted); font-size: .75rem; font-weight: 600; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere;
    background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border-light); border-radius: 8px;
    transition: all .2s ease;
}
.related-store:hover { color: #fff; border-color: transparent; background: var(--gradient-brand); box-shadow: var(--shadow-brand); }

/* Sidebar stays in view on desktop, below the fixed navbar */
@media (min-width: 992px) {
    .sd-sticky { position: sticky; top: calc(var(--nav-h-scrolled, 85px) + 16px); }
}

/* ---------- Motion ---------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 991px) {
    /* background-attachment: fixed is janky / ignored on touch browsers */
    .store-detail-page { background-attachment: scroll; }
}

@media (max-width: 767px) {
    .store-detail-page { padding-top: 1rem; }
    .sd-wrap { padding: 0 .6rem; }
    .sd-breadcrumb .breadcrumb { padding: .55rem .8rem; font-size: .82rem; }

    .store-header { padding: .8rem .9rem .8rem 1.1rem; }
    .store-header-inner { align-items: flex-start; gap: .8rem; }
    .store-logo, .store-logo-fallback { flex-basis: 54px; width: 54px; height: 54px; }
    .store-title { font-size: 1.1rem; }
    .store-description { font-size: .78rem; }

    .coupons-row { --bs-gutter-x: .6rem; --bs-gutter-y: .6rem; }
    .coupon-card { padding: .8rem .6rem .6rem; }
    .coupon-store-img { width: 40px; height: 40px; margin-bottom: .45rem; }
    .coupon-title { font-size: .78rem; }
    .coupon-description { font-size: .72rem; }
    .reveal-btn, .deal-btn { padding: .4rem .5rem; font-size: .74rem; }
    .code-box input { font-size: .76rem; }
    .coupon-footer { font-size: .72rem; }

    .content-card { padding: 1.5rem 1.1rem; }
    .article-content, .store-article { font-size: .97rem; line-height: 1.8; max-width: 100%; }
    .article-content > p:first-of-type, .store-article > p:first-of-type { font-size: 1.03rem; }
    .article-content blockquote, .store-article blockquote { padding: 1rem 1rem 1rem 2.6rem; }
    .article-content { font-size: .95rem; line-height: 1.75; }
    .article-content h1 { font-size: 1.4rem; }
    .article-content h2 { font-size: 1.25rem; }
    .article-content h3 { font-size: 1.1rem; }
    /* un-float aligned images so they don't squeeze the text */
    .article-content .image-style-side,
    .article-content .image-style-align-right,
    .article-content .image-style-align-left,
    .article-content img[style*="float"] { float: none !important; max-width: 100%; margin: 1.2rem auto; display: block; }

    /* Related articles — mobile */
    .related-articles-list { gap: 1.75rem; }
    .related-article-card { padding-bottom: 1.5rem; }
    .related-article-title { font-size: 1.1rem; margin-bottom: .7rem; }
    .related-article-body { font-size: .92rem; line-height: 1.7; }
    .related-article-thumb { border-radius: 12px; margin-bottom: .9rem; }
    .related-article-thumb img { max-height: 240px; }
    .related-article-card .read-link { font-size: .8rem; padding: .45rem 1rem; }
}

@media (max-width: 400px) {
    .coupon-title { font-size: .74rem; }
    .reveal-btn, .deal-btn { font-size: .7rem; gap: .3rem; }
    .related-grid { grid-template-columns: 1fr; }
    .related-article-title { font-size: 1rem; }
}