/* =====================================================================
   Product page and article page ("yd-"). Loaded after listing.css.
   Same tokens as the rest of the herbal theme (--yh-*, --yp-*).
   ===================================================================== */

:root {
    --yd-box: linear-gradient(180deg, #fff, #fffcf6);
    --yd-edge: #efe4cd;
    --yd-shadow: 0 0 0 1px var(--yd-edge), 0 14px 28px -22px rgba(90, 60, 20, .55);
    --yd-soft: #f3ecdb;
    --yd-top: 110px;       /* set by script: height of the site header */
}
:root[data-theme="dark"] {
    --yd-box: var(--yh-box);
    --yd-edge: rgba(150, 230, 175, .22);
    --yd-shadow: var(--yh-box-shadow);
    --yd-soft: rgba(255, 255, 255, .07);
}

html:has(.yd) { scroll-behavior: smooth; }
.yd [id] { scroll-margin-top: calc(var(--yd-top) + 76px); }
.yd svg { flex: none; }

/* ---------- Top: gallery + buy box ---------- */

.yd-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 992px) { .yd-top { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 34px; } }

/* ---------- Gallery ---------- */

.yd-gallery { min-width: 0; }
@media (min-width: 992px) { .yd-gallery { position: sticky; top: calc(var(--yd-top) + 16px); } }

.yd-gallery__stage {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: radial-gradient(circle at 50% 35%, #fff, #f3ecdb);
    box-shadow: 0 0 0 1px var(--yd-edge), 0 22px 40px -28px rgba(90, 60, 20, .6);
}
:root[data-theme="dark"] .yd-gallery__stage { background: radial-gradient(circle at 50% 35%, #fbf8ef, #e7dfcb); box-shadow: var(--yh-box-shadow); }

.yd-gallery__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}
.yd-gallery__track::-webkit-scrollbar { display: none; }

.yd-slide { display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0; background: none; scroll-snap-align: center; cursor: zoom-in; }
.yd-slide img { width: 100%; height: 100%; object-fit: contain; }
.yd-slide--empty { color: var(--yh-green-2); cursor: default; }
.yd-slide--empty svg { width: 72px; height: 72px; opacity: .5; }

.yd-gallery__off {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 5px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--yh-wine-2), var(--yh-wine));
    color: #fff;
    font-size: .85rem;
    font-weight: 900;
    box-shadow: 0 8px 16px -8px var(--yh-wine);
    pointer-events: none;
}

.yd-gallery__zoom, .yd-gallery__nav {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #1d2b22;
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5);
    cursor: pointer;
    transition: transform .2s, background .2s;
}
.yd-gallery__zoom:hover, .yd-gallery__nav:hover { background: #fff; transform: scale(1.08); }
.yd-gallery__zoom { top: 12px; inset-inline-end: 12px; }
.yd-gallery__zoom svg, .yd-gallery__nav svg { width: 22px; height: 22px; }
.yd-gallery__nav { top: 50%; margin-top: -22px; opacity: 0; }
.yd-gallery__nav--prev { inset-inline-start: 12px; }
.yd-gallery__nav--prev svg { transform: rotate(180deg); }
.yd-gallery__nav--next { inset-inline-end: 12px; }
.yd-gallery__stage:hover .yd-gallery__nav { opacity: 1; }
@media (hover: none) { .yd-gallery__nav { display: none; } }

.yd-gallery__dots { position: absolute; bottom: 12px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.yd-gallery__dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(20, 40, 28, .3); box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); transition: width .25s, background .25s; }
.yd-gallery__dots i.is-active { width: 24px; background: var(--yh-green-2); }

.yd-thumbs { display: flex; gap: 10px; margin-top: 12px; padding: 3px; overflow-x: auto; scrollbar-width: none; }
.yd-thumbs::-webkit-scrollbar { display: none; }
.yd-thumb { flex: none; width: 72px; height: 72px; padding: 0; overflow: hidden; border: 0; border-radius: 14px; background: var(--yd-box); box-shadow: 0 0 0 1px var(--yd-edge); cursor: pointer; opacity: .75; transition: opacity .2s, box-shadow .2s, transform .2s; }
.yd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yd-thumb:hover { opacity: 1; transform: translateY(-2px); }
.yd-thumb.is-active { opacity: 1; box-shadow: 0 0 0 2.5px var(--yh-gold); }
@media (min-width: 992px) { .yd-thumb { width: 84px; height: 84px; } }

/* ---------- Buy box ---------- */

.yd-buy { min-width: 0; padding: 20px 18px; border-radius: 22px; background: var(--yd-box); box-shadow: var(--yd-shadow); }
@media (min-width: 992px) { .yd-buy { padding: 26px 28px; } }

.yd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.yd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 999px; background: var(--yd-soft); color: var(--yp-text); font-size: .8rem; font-weight: 700; text-decoration: none; transition: background .2s, color .2s; }
.yd-chip svg { width: 16px; height: 16px; color: var(--yh-green-2); }
.yd-chip:hover { color: var(--yh-green-2); }
.yd-chip--brand { background: #eef5e6; color: var(--yh-green); }
:root[data-theme="dark"] .yd-chip--brand { background: rgba(124, 196, 143, .16); color: #a8e3b6; }

.yd-title { margin: 0 0 4px; color: var(--yp-text); font-size: 1.4rem; font-weight: 900; line-height: 1.6; }
@media (min-width: 992px) { .yd-title { font-size: 1.8rem; } }
.yd-en { margin: 0 0 8px; color: var(--yp-muted); font-size: .9rem; text-align: right; }
.yd-lead { margin: 0 0 14px; color: var(--yp-muted); font-size: .92rem; line-height: 2; }

.yd-price { margin: 14px 0 16px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #fff8e6, #fdf1d6); box-shadow: inset 0 0 0 1px #f0dcaa; }
:root[data-theme="dark"] .yd-price { background: linear-gradient(135deg, #2a2312, #1c180d); box-shadow: inset 0 0 0 1px rgba(245, 184, 61, .4); }
.yd-price__main { display: flex; align-items: center; gap: 12px; }
.yd-price__main strong { color: var(--yh-wine); font-size: 1.7rem; font-weight: 900; line-height: 1.3; }
.yd-price__main strong small { font-size: .85rem; font-weight: 700; }
:root[data-theme="dark"] .yd-price__main strong { color: var(--yh-gold-2); }
.yd-price__off { padding: 3px 11px; border-radius: 999px; background: linear-gradient(135deg, var(--yh-wine-2), var(--yh-wine)); color: #fff; font-size: .85rem; font-weight: 900; }
.yd-price__old { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: .85rem; }
.yd-price__old del { color: var(--yp-muted); }
.yd-price__old span { color: var(--yh-green-2); font-weight: 800; }
.yd-out { margin: 0; color: var(--yh-wine); font-size: 1.3rem; font-weight: 900; }
.yd-stock { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--yh-green-2); font-size: .82rem; font-weight: 700; }
.yd-stock i { width: 9px; height: 9px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, .22); }
.yd-stock--no { color: var(--yh-wine); }
.yd-stock--no i { background: var(--yh-wine); box-shadow: 0 0 0 4px rgba(140, 31, 51, .2); }

/* options (colour, size) */
.yd-form { display: grid; gap: 16px; }
.yd-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.yd-options legend { float: none; width: auto; margin: 0 0 8px; padding: 0; font-size: .9rem; font-weight: 800; color: var(--yp-text); }
.yd-options legend b { color: var(--yh-green-2); }
.yd-options > div { display: flex; flex-wrap: wrap; gap: 8px; }
.yd-option { position: relative; cursor: pointer; }
.yd-option input { position: absolute; opacity: 0; inset: 0; }
.yd-option span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--yd-box); box-shadow: inset 0 0 0 1.5px var(--yd-edge); color: var(--yp-text); font-weight: 700; font-size: .9rem; transition: box-shadow .2s, background .2s, color .2s; }
.yd-options--priced .yd-option span { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 6px 18px; line-height: 1.5; min-width: 96px; }
.yd-option span small { font-size: .74rem; font-weight: 700; opacity: .85; }
.yd-option:hover span { box-shadow: inset 0 0 0 1.5px var(--yh-gold); }
.yd-option input:checked + span { background: linear-gradient(135deg, var(--yh-green-2), var(--yh-green)); color: #fff; box-shadow: 0 10px 18px -12px var(--yh-green); }
.yd-option input:focus-visible + span { outline: 3px solid var(--yh-gold); outline-offset: 2px; }

/* quantity + add to cart */
.yd-cta { display: flex; gap: 10px; align-items: stretch; }
.yd-qty { display: inline-flex; align-items: center; flex: none; border-radius: 14px; background: var(--yd-soft); box-shadow: inset 0 0 0 1px var(--yd-edge); }
.yd-qty button { display: grid; place-items: center; width: 44px; height: 54px; border: 0; background: none; color: var(--yp-text); cursor: pointer; border-radius: 14px; }
.yd-qty button:hover { color: var(--yh-green-2); background: rgba(47, 122, 59, .08); }
.yd-qty button svg { width: 18px; height: 18px; }
.yd-qty input { width: 44px; height: 54px; padding: 0; border: 0 !important; background: transparent !important; color: var(--yp-text) !important; font: inherit; font-weight: 900; text-align: center; box-shadow: none !important; -moz-appearance: textfield; }
.yd-qty input::-webkit-outer-spin-button, .yd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.yd-add {
    position: relative;
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 22px;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--yh-green-2), var(--yh-green));
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 26px -16px var(--yh-green);
    transition: transform .2s, filter .2s;
}
.yd-add::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent); transform: skewX(-20deg); transition: left .7s var(--yp-ease); }
.yd-add:hover { transform: translateY(-2px); filter: brightness(1.07); }
.yd-add:hover::after { left: 130%; }
.yd-add svg { width: 22px; height: 22px; }
:root[data-theme="dark"] .yd-add { box-shadow: 0 0 0 1px rgba(150, 230, 175, .5), 0 0 28px -8px rgba(124, 196, 143, .65); }

.yd-call { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; border-radius: 14px; background: linear-gradient(135deg, var(--yh-wine-2), var(--yh-wine)); color: #fff; font-weight: 900; text-decoration: none; }
.yd-call svg { width: 22px; height: 22px; }

.yd-trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.yd-trust li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--yd-soft); font-size: .8rem; line-height: 1.6; color: var(--yp-muted); }
.yd-trust li b { display: block; color: var(--yp-text); font-size: .84rem; }
.yd-trust svg { width: 28px; height: 28px; padding: 5px; border-radius: 9px; background: #eef5e6; color: var(--yh-green-2); }
:root[data-theme="dark"] .yd-trust svg { background: rgba(124, 196, 143, .16); color: #8fdca3; }

.yd-quick { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--yd-soft); }
.yd-quick h2 { margin: 0 0 8px; font-size: .95rem; font-weight: 900; color: var(--yp-text); }
.yd-quick ul { margin: 0; padding: 0; list-style: none; }
.yd-quick li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--yd-edge); font-size: .85rem; }
.yd-quick li:last-child { border-bottom: 0; }
.yd-quick li span { color: var(--yp-muted); }
.yd-quick li b { color: var(--yp-text); text-align: end; }
.yd-quick__more { display: inline-block; margin-top: 6px; color: var(--yh-green-2); font-size: .82rem; font-weight: 800; text-decoration: none; }

.yd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.yd-tags a { padding: 4px 12px; border-radius: 999px; background: var(--yd-soft); color: var(--yp-muted); font-size: .78rem; text-decoration: none; }
.yd-tags a:hover { color: var(--yh-green-2); }

.yd-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--yd-edge); font-size: .82rem; color: var(--yp-muted); }
.yd-share[hidden] { display: none; }
.yd-share > span { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: auto; font-weight: 700; }
.yd-share svg { width: 18px; height: 18px; }
.yd-share a, .yd-share button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--yd-soft); color: var(--yp-text); font: inherit; font-size: .8rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .2s, color .2s; }
.yd-share a:hover, .yd-share button:hover { background: #eef5e6; color: var(--yh-green-2); }
.yd-share em { font-style: normal; }

/* ---------- Section menu ---------- */

.yd-tabs {
    position: sticky;
    top: var(--yd-top);
    z-index: 20;
    display: flex;
    gap: 6px;
    margin: 28px -16px 0;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    background: color-mix(in srgb, var(--yp-bg) 92%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--yd-edge);
}
.yd-tabs::-webkit-scrollbar { display: none; }
.yd-tabs a { flex: none; padding: 9px 18px; border-radius: 999px; color: var(--yp-muted); font-size: .88rem; font-weight: 700; text-decoration: none; transition: background .2s, color .2s; }
.yd-tabs a:hover { color: var(--yp-text); background: var(--yd-soft); }
.yd-tabs a.is-active { background: linear-gradient(135deg, #fdecbf, #f8d77f); color: #5b3b05; box-shadow: inset 0 0 0 1px rgba(184, 130, 20, .35); }
:root[data-theme="dark"] .yd-tabs a.is-active { background: linear-gradient(135deg, #5a4210, #3d2d0a); color: var(--yh-gold-2); }
.yd-tabs:empty { display: none; }

/* ---------- Sections ---------- */

.yd-section { margin-top: 30px; }
.yd-section[hidden] { display: none; }
.yd-section > h2, .yd-head h2 { position: relative; margin: 0 0 14px; padding-inline-start: 14px; color: var(--yp-text); font-size: 1.15rem; font-weight: 900; }
.yd-section > h2::before, .yd-head h2::before { content: ""; position: absolute; inset-inline-start: 0; top: 14%; bottom: 14%; width: 4px; border-radius: 4px; background: var(--yh-gold); }
.yd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.yd-head h2 { margin-bottom: 14px; }

.yd-prose { padding: 20px 18px; border-radius: 20px; background: var(--yd-box); box-shadow: var(--yd-shadow); line-height: 2.15; font-size: .96rem; color: var(--yp-text); overflow-wrap: anywhere; }
@media (min-width: 768px) { .yd-prose { padding: 28px 32px; font-size: 1rem; } }
.yd-prose > :first-child { margin-top: 0; }
.yd-prose > :last-child { margin-bottom: 0; }
.yd-prose h2, .yd-prose h3, .yd-prose h4 { margin: 1.6em 0 .6em; font-weight: 900; line-height: 1.7; color: var(--yh-green); }
:root[data-theme="dark"] .yd-prose h2, :root[data-theme="dark"] .yd-prose h3, :root[data-theme="dark"] .yd-prose h4 { color: #a8e3b6; }
.yd-prose h2 { font-size: 1.3rem; padding-bottom: .3em; border-bottom: 2px solid var(--yd-edge); }
.yd-prose h3 { font-size: 1.12rem; }
.yd-prose p { margin: 0 0 1.1em; }
.yd-prose img { max-width: 100%; height: auto !important; border-radius: 16px; margin-block: .6em; }
.yd-prose a { color: var(--yh-green-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.yd-prose ul, .yd-prose ol { padding-inline-start: 1.6em; margin: 0 0 1.2em; }
.yd-prose li { margin-bottom: .4em; }
.yd-prose li::marker { color: var(--yh-gold); font-weight: 900; }
.yd-prose blockquote { margin: 1.4em 0; padding: 14px 18px; border-inline-start: 4px solid var(--yh-gold); border-radius: 0 14px 14px 0; background: var(--yd-soft); color: var(--yp-muted); }
.yd-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.2em 0; }
.yd-prose th, .yd-prose td { padding: 10px 14px; border: 1px solid var(--yd-edge); white-space: nowrap; }
.yd-prose th { background: var(--yd-soft); }
.yd-prose iframe, .yd-prose video { max-width: 100%; border-radius: 14px; }
.yd-prose iframe { aspect-ratio: 16 / 9; height: auto; }

.yd-specs { display: grid; gap: 0; margin: 0; padding: 6px 18px; border-radius: 20px; background: var(--yd-box); box-shadow: var(--yd-shadow); }
@media (min-width: 768px) { .yd-specs { grid-template-columns: 1fr 1fr; column-gap: 40px; padding: 10px 28px; } }
.yd-specs > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--yd-edge); font-size: .9rem; }
.yd-specs dt { color: var(--yp-muted); }
.yd-specs dd { margin: 0; color: var(--yp-text); font-weight: 800; text-align: end; }

/* rails of products */
.yd-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 46%; gap: 10px; margin-inline: -16px; padding: 4px 16px 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.yd-rail::-webkit-scrollbar { display: none; }
.yd-rail > * { scroll-snap-align: start; }
.yd-rail .yp-hcard { height: 100%; }
@media (min-width: 576px) { .yd-rail { grid-auto-columns: 31%; } }
@media (min-width: 992px) { .yd-rail { grid-auto-columns: calc((100% - 3 * 14px) / 4); gap: 14px; margin-inline: 0; padding-inline: 0; scrollbar-width: thin; } }
@media (min-width: 1200px) { .yd-rail { grid-auto-columns: calc((100% - 4 * 14px) / 5); } }
.yd-rail--mini { grid-auto-columns: 78%; }
@media (min-width: 576px) { .yd-rail--mini { grid-auto-columns: 44%; } }
@media (min-width: 992px) { .yd-rail--mini { grid-auto-columns: calc((100% - 3 * 14px) / 4); } }

/* small product row (recently viewed, article side) */
.yd-mini { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: var(--yd-box); box-shadow: var(--yd-shadow); color: var(--yp-text); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.yd-mini:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--yh-gold), 0 14px 22px -16px rgba(140, 95, 20, .6); color: var(--yp-text); }
.yd-mini img { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; background: var(--yd-soft); }
.yd-mini span { display: grid; gap: 2px; min-width: 0; }
.yd-mini b { font-size: .86rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yd-mini small { color: var(--yh-wine); font-size: .8rem; font-weight: 800; }
:root[data-theme="dark"] .yd-mini small { color: var(--yh-gold-2); }

/* articles on the product page */
.yd-posts { display: grid; gap: 10px; }
@media (min-width: 768px) { .yd-posts { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.yd-post { display: flex; gap: 12px; padding: 10px; border-radius: 18px; background: var(--yd-box); box-shadow: var(--yd-shadow); color: var(--yp-text); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.yd-post:hover { transform: translateY(-3px); box-shadow: 0 0 0 1.5px var(--yh-gold), 0 18px 28px -18px rgba(140, 95, 20, .55); color: var(--yp-text); }
.yd-post img { width: 96px; height: 80px; flex: none; border-radius: 12px; object-fit: cover; background: var(--yd-soft); }
.yd-post span { display: grid; gap: 3px; align-content: center; min-width: 0; }
.yd-post em { font-style: normal; color: var(--yh-green-2); font-size: .72rem; font-weight: 800; }
.yd-post b { font-size: .9rem; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yd-post small { color: var(--yp-muted); font-size: .75rem; }

/* keep exploring */
.yd-explore { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.yd-explore a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 16px; background: var(--yd-box); box-shadow: var(--yd-shadow); color: var(--yp-text); font-size: .88rem; font-weight: 800; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.yd-explore a svg { width: 20px; height: 20px; color: var(--yh-green-2); }
.yd-explore a:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--yh-gold); color: var(--yp-text); }
@media (max-width: 575.98px) { .yd-explore a { flex: 1 1 calc(50% - 10px); justify-content: center; padding-inline: 10px; } }

/* ---------- Phone: bottom buy bar and "added" message ---------- */

.yd-buybar { display: none; }
@media (max-width: 991.98px) {
    .yd-buybar {
        position: fixed;
        inset-inline: 0;
        bottom: calc(var(--yp-bottombar-h) + env(safe-area-inset-bottom, 0px));
        z-index: 1019;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: color-mix(in srgb, var(--yp-surface) 94%, transparent);
        backdrop-filter: blur(12px);
        box-shadow: 0 -10px 24px -14px rgba(0, 0, 0, .35), 0 -1px 0 var(--yd-edge);
        transform: translateY(130%);
        transition: transform .3s var(--yp-ease);
    }
    .yd-buybar.is-visible { transform: none; }
    .yd-buybar > div { display: grid; line-height: 1.4; }
    .yd-buybar del { color: var(--yp-muted); font-size: .74rem; }
    .yd-buybar strong { color: var(--yh-wine); font-size: 1.05rem; font-weight: 900; white-space: nowrap; }
    :root[data-theme="dark"] .yd-buybar strong { color: var(--yh-gold-2); }
    .yd-buybar strong small { font-size: .7rem; }
    .yd-buybar .yd-add { min-height: 48px; margin-inline-start: auto; flex: 1; max-width: 240px; }
}

.yd-toast {
    position: fixed;
    inset-inline: 14px;
    bottom: calc(var(--yp-bottombar-h) + 16px + env(safe-area-inset-bottom, 0px));
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 460px;
    margin-inline: auto;
    padding: 12px 16px;
    border-radius: 16px;
    background: #14301f;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(150, 230, 175, .4), 0 20px 36px -14px rgba(0, 0, 0, .7);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .3s, transform .3s var(--yp-ease);
}
.yd-toast.is-on { opacity: 1; transform: none; }
.yd-toast[hidden] { display: none; }
.yd-toast > svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: #34c759; color: #fff; }
.yd-toast span { flex: 1; font-weight: 800; font-size: .92rem; }
.yd-toast a { padding: 7px 14px; border-radius: 10px; background: linear-gradient(180deg, var(--yh-gold-2), var(--yh-gold)); color: #2a1d05; font-size: .82rem; font-weight: 900; text-decoration: none; }
.yd-toast button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; }
.yd-toast button svg { width: 16px; height: 16px; }
@media (min-width: 992px) { .yd-toast { bottom: 24px; inset-inline-start: auto; inset-inline-end: 24px; margin: 0; } }

/* ---------- Full-screen viewer ---------- */

.yd-lb { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-rows: 1fr auto; background: rgba(6, 10, 8, .98); color: #fff; }
.yd-lb[hidden] { display: none; }
.yd-lb__stage { position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; cursor: zoom-in; }
.yd-lb.is-zoomed .yd-lb__stage { cursor: grab; }
.yd-lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s var(--yp-ease); will-change: transform; background: #f3efe4; border-radius: 6px; }
.yd-lb.is-zoomed .yd-lb__stage img { transition: none; }

.yd-lb__close, .yd-lb__zoom, .yd-lb__nav { position: absolute; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: background .2s; }
.yd-lb__close:hover, .yd-lb__zoom:hover, .yd-lb__nav:hover { background: rgba(255, 255, 255, .28); }
.yd-lb svg { width: 24px; height: 24px; }
.yd-lb__close { top: 14px; inset-inline-start: 14px; }
.yd-lb__zoom { top: 14px; inset-inline-start: 70px; }
.yd-lb__count { position: absolute; z-index: 2; top: 24px; inset-inline-end: 18px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .85rem; font-weight: 700; }
.yd-lb__nav { top: 50%; margin-top: -23px; }
.yd-lb__nav--prev { inset-inline-end: 14px; }
.yd-lb__nav--prev svg { transform: rotate(180deg); }
.yd-lb__nav--next { inset-inline-start: 14px; }
.yd-lb.is-single .yd-lb__nav, .yd-lb.is-single .yd-lb__thumbs { display: none; }
@media (hover: none) { .yd-lb__nav { display: none; } }

.yd-lb__thumbs { display: flex; justify-content: center; gap: 8px; padding: 12px; overflow-x: auto; scrollbar-width: none; }
.yd-lb__thumbs button { flex: none; width: 58px; height: 58px; padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: #222; opacity: .55; cursor: pointer; transition: opacity .2s, box-shadow .2s; }
.yd-lb__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.yd-lb__thumbs button.is-active { opacity: 1; box-shadow: 0 0 0 2.5px var(--yh-gold); }

/* =====================================================================
   Article page
   ===================================================================== */

.yd-progress { position: fixed; top: 0; inset-inline: 0; z-index: 1040; height: 4px; background: transparent; pointer-events: none; }
.yd-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--yh-gold), var(--yh-green-2)); transform: scaleX(0); transform-origin: 100% 50%; box-shadow: 0 0 10px rgba(245, 184, 61, .7); }

.yd-post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 992px) { .yd-post-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; } }

.yd-article { min-width: 0; }
.yd-article__head { margin-bottom: 16px; }
.yd-article h1 { margin: 12px 0 10px; color: var(--yp-text); font-size: 1.55rem; font-weight: 900; line-height: 1.7; }
@media (min-width: 992px) { .yd-article h1 { font-size: 2.1rem; } }
.yd-article__lead { margin: 0 0 14px; color: var(--yp-muted); font-size: 1rem; line-height: 2.1; }
.yd-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; color: var(--yp-muted); font-size: .8rem; }
.yd-meta li { display: inline-flex; align-items: center; gap: 6px; }
.yd-meta svg { width: 17px; height: 17px; color: var(--yh-green-2); }

.yd-cover { margin: 0 0 20px; overflow: hidden; border-radius: 22px; box-shadow: 0 0 0 1px var(--yd-edge), 0 24px 44px -28px rgba(60, 40, 10, .7); }
.yd-cover img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
@media (max-width: 575.98px) { .yd-cover { border-radius: 16px; } .yd-cover img { aspect-ratio: 16 / 10; } }

.yd-body { font-size: 1rem; }
@media (min-width: 768px) { .yd-body { font-size: 1.05rem; line-height: 2.25; } }

.yd-share--article { padding: 14px 16px; border: 0; border-radius: 18px; background: var(--yd-box); box-shadow: var(--yd-shadow); margin-top: 18px; }

/* table of contents */
.yd-toc[hidden] { display: none; }
.yd-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.yd-toc li { counter-increment: toc; }
.yd-toc li a { display: flex; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--yp-muted); font-size: .86rem; line-height: 1.7; text-decoration: none; transition: background .2s, color .2s; }
.yd-toc li:not(.is-sub) a::before { content: counter(toc, persian) "."; color: var(--yh-gold); font-weight: 900; }
.yd-toc li.is-sub a { padding-inline-start: 28px; font-size: .82rem; }
.yd-toc li a:hover { background: var(--yd-soft); color: var(--yp-text); }
.yd-toc li a.is-active { background: #eef5e6; color: var(--yh-green); font-weight: 800; }
:root[data-theme="dark"] .yd-toc li a.is-active { background: rgba(124, 196, 143, .16); color: #b9ecc7; }

.yd-toc--mobile { margin-bottom: 18px; border-radius: 18px; background: var(--yd-box); box-shadow: var(--yd-shadow); }
.yd-toc--mobile > summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; list-style: none; font-weight: 900; color: var(--yp-text); cursor: pointer; }
.yd-toc--mobile > summary::-webkit-details-marker { display: none; }
.yd-toc--mobile > summary svg { width: 20px; height: 20px; color: var(--yh-green-2); }
.yd-toc--mobile > summary::after { content: "+"; margin-inline-start: auto; font-size: 1.3rem; color: var(--yp-muted); }
.yd-toc--mobile[open] > summary::after { content: "−"; }
.yd-toc--mobile ol { padding: 0 8px 10px; }
@media (min-width: 992px) { .yd-toc--mobile { display: none; } }

.yd-side { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 992px) { .yd-side { position: sticky; top: calc(var(--yd-top) + 16px); } }
.yd-toc--side, .yd-side__box { padding: 16px; border-radius: 20px; background: var(--yd-box); box-shadow: var(--yd-shadow); }
.yd-toc--side h2, .yd-side__box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .98rem; font-weight: 900; color: var(--yp-text); }
.yd-toc--side h2 svg, .yd-side__box h2 svg { width: 20px; height: 20px; color: var(--yh-green-2); }
@media (max-width: 991.98px) { .yd-toc--side { display: none; } }
.yd-toc--side ol { max-height: 46vh; overflow-y: auto; }

.yd-side__products { display: grid; gap: 8px; }
.yd-side__more { display: inline-block; margin-top: 10px; color: var(--yh-green-2); font-size: .84rem; font-weight: 800; text-decoration: none; }
.yd-side__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.yd-side__tags a { padding: 6px 14px; border-radius: 999px; background: var(--yd-soft); color: var(--yp-text); font-size: .8rem; font-weight: 600; text-decoration: none; }
.yd-side__tags a:hover { color: var(--yh-green-2); }
.yd-side__tags a.is-active { background: linear-gradient(135deg, var(--yh-green-2), var(--yh-green)); color: #fff; }

.yd-related-posts { margin-top: 0; }

/* ---------- Dark: product cards and rails use the shared glowing boxes ---------- */

:root[data-theme="dark"] .yd-option span, :root[data-theme="dark"] .yd-qty { box-shadow: inset 0 0 0 1.5px rgba(150, 230, 175, .3); }
:root[data-theme="dark"] .yd-gallery__dots i { background: rgba(255, 255, 255, .35); }
:root[data-theme="dark"] .yd-tabs { background: color-mix(in srgb, #0a110d 92%, transparent); }

@media (prefers-reduced-motion: reduce) {
    html:has(.yd) { scroll-behavior: auto; }
    .yd-buybar, .yd-toast, .yd-lb__stage img { transition: none; }
}

/* toast: keep text on one line on narrow phones */
.yd-toast span { white-space: nowrap; font-size: .86rem; }
.yd-toast a { white-space: nowrap; }
