/* r690: polish on the 11-10 (r674) glass dock - seller and buyer panels. Loaded after the dock's own CSS. */

/* ---- 1. colour change with no lag: the tone is predicted (app.js), so the glass can change fast ---- */
@media (max-width: 640px) {
    .has-bnav .bnav { transition: transform .35s cubic-bezier(.34, 1.3, .64, 1), opacity .25s, background-color .12s ease-out, box-shadow .12s ease-out, border-color .12s ease-out !important; }
}
body.lg.has-bnav .bnav > .lg-barglass { transition: background-color .12s ease-out !important; }
.pcd-glass { transition: background-color .12s ease-out, box-shadow .12s ease-out, border-color .12s, -webkit-backdrop-filter .12s, backdrop-filter .12s !important; }
:is(.bnav, .pcd) :is(.tab, .bnav-more, .pcd-it, .pcd-it .pcd-lbl) { transition-duration: .12s !important; }

/* ---- 2. phone: «سفارشات» and «جدید» change places, so «جدید» sits in the middle of the bar ---- */
@media (max-width: 640px) {
    .has-bnav .bnav > .tab[data-tab="products"] { order: 1; }
    .has-bnav .bnav > .tab[data-tab="orders"]   { order: 2; }
    .has-bnav .bnav > .tab[data-tab="create"]   { order: 3; }
    .has-bnav .bnav > .tab[data-tab="wallet"]   { order: 4; }
    .has-bnav .bnav > .bnav-more                { order: 5; }
    .has-bnav .bnav > .tab:not([data-bar])      { order: 6; }
}

/* ---- 3. PC «محصول جدید»: one clean gold glass button ----
   no three orange lines running round it and no icon flipping between «PDF» and «+» every
   3.6 s; a lit top edge, a soft gold shadow, the same height as the dock's other items, and one
   quiet light sweep when the pointer arrives (a response, not a loop) */
@media (min-width: 640.02px) {
    .pcd .pcd-flow { display: none !important; }
    .pcd .pcd-main .nl-a { animation: none !important; }
    .pcd .pcd-main .nl-b { display: none !important; }
    .pcd .pcd-main {
        position: relative; overflow: hidden; isolation: isolate;
        background: linear-gradient(180deg, #fcd34d 0%, #f5b800 52%, #eaa600 100%) !important;
        color: #1f2937 !important; font-weight: 800 !important; letter-spacing: -.005em;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -1px 0 rgba(146, 64, 14, .22),
                    0 1px 2px rgba(146, 64, 14, .18), 0 6px 16px -6px rgba(217, 119, 6, .55) !important;
        transition: transform .12s ease-out, box-shadow .2s ease, filter .15s ease !important;
    }
    .pcd .pcd-main .ic { --ic-acc: #1f2937; }
    .pcd .pcd-main::after {
        content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
        background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 46%, transparent 62%);
        transform: translateX(110%); opacity: 0;
    }
    .pcd .pcd-main:active { transform: scale(.96) !important; }
    .pcd .pcd-main[aria-current] {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -1px 0 rgba(146, 64, 14, .22),
                    0 0 0 3px rgba(245, 184, 0, .28), 0 6px 16px -6px rgba(217, 119, 6, .55) !important;
    }
}
@media (min-width: 640.02px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .pcd .pcd-main:hover { background: linear-gradient(180deg, #fcd34d 0%, #f5b800 52%, #eaa600 100%) !important; filter: brightness(1.03); }
    .pcd .pcd-main:hover::after { opacity: 1; transform: translateX(-110%); transition: transform .7s cubic-bezier(.16, 1, .3, 1), opacity .2s; }
}

/* ======================= polish v2 (owner, 11-12) ======================= */

/* ---- 5. the whole dock is the «بیشتر» menu's glass: the same on every browser ---- */
html body.lg.has-bnav .bnav > .lg-barglass,
html body.lg .pcd:not(.is-home) > * > .pcd-glass,
html body.lg .pcd.is-home > * > .pcd-glass {
    background: rgba(255, 255, 255, .58) !important;  /* exactly the «بیشتر» menu's glass (pc-dock.css .pcd-glass) */
    -webkit-backdrop-filter: blur(5px) saturate(1.8) !important; backdrop-filter: blur(5px) saturate(1.8) !important;
    clip-path: none !important;                      /* no clear window under the drop: it sits on the frost */
}
html body.lg.has-bnav .bnav.tone-dark > .lg-barglass,
html body.lg .pcd.tone-dark > * > .pcd-glass { background: rgba(17, 24, 39, .58) !important; }

/* ---- 6. one fixed light, from the upper left: the highlight no longer chases the mouse ---- */
html body.lg .pcd > * > .pcd-glass { --lx: 28% !important; --ly: -10% !important; }

/* ---- 7. a calm, professional edge: one soft shadow on light pages, none on dark ones ---- */
html body.lg.has-bnav .bnav, html body.lg.lg-flat.has-bnav .bnav,
html body.lg .pcd:not(.is-home) > * > .pcd-glass, html body.lg.lg-flat .pcd:not(.is-home) > * > .pcd-glass {
    border-color: rgba(255, 255, 255, .55) !important;
    box-shadow: 0 8px 24px -8px rgba(31, 41, 55, .18), 0 1px 2px rgba(31, 41, 55, .06), inset 0 0 0 .5px rgba(255, 255, 255, .6) !important;
}
html body.lg.has-bnav .bnav.tone-dark, html body.lg.lg-flat.has-bnav .bnav.tone-dark,
html body.lg .pcd.tone-dark > * > .pcd-glass, html body.lg.lg-flat .pcd.tone-dark > * > .pcd-glass {
    border-color: rgba(255, 255, 255, .14) !important;
    box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .10) !important;
}
html body.lg.has-bnav .bnav.tone-dark::before, html body.lg .pcd.tone-dark > * > .pcd-glass::before { opacity: .35 !important; box-shadow: none !important; }
/* the drop's own cast shadow is a dark ring on a dark page: gone there */
html body .pcd.tone-dark .lg-shadow, html body .has-bnav .bnav.tone-dark > .lg-shadow { box-shadow: none !important; }
/* the pale glow behind the labels made a grey halo on dark bars */
html body.lg .pcd.tone-dark :is(.pcd-pill, .pcd-more) > .pcd-it, html body.lg.has-bnav .bnav.tone-dark > * { text-shadow: none !important; }
html body.lg .pcd.tone-dark .pcd-main { box-shadow: none !important; }

/* ---- 8. the lens: clear glass with a colourless rim (no blue, mint or pink) ---- */
html body .lg-sheen > i.lg-ring,
html body .tone-dark > .lg-bubble .lg-sheen > i.lg-ring, html body .pcd.tone-dark .lg-sheen > i.lg-ring {
    padding: 1px !important;
    background: conic-gradient(from calc(300deg + var(--tilt-a, 0) * 1deg),
        rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, .55) 10%, rgba(255, 255, 255, .18) 24%, rgba(255, 255, 255, .18) 40%,
        rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, .18) 62%, rgba(255, 255, 255, .18) 80%, rgba(255, 255, 255, .55) 90%, rgba(255, 255, 255, 1) 100%) !important;
    border-image: none !important; border-width: 0 !important;
}
html body .lg-sheen::before { display: none !important; }                  /* the blue "ice band" */
html body .lg-bubble, html body .has-bnav .bnav > .lg-bubble {
    background: rgba(255, 255, 255, .22) !important;
    -webkit-backdrop-filter: blur(.6px) saturate(1.5) brightness(1.06) !important; backdrop-filter: blur(.6px) saturate(1.5) brightness(1.06) !important;
}
html body .tone-dark > .lg-bubble, html body .pcd.tone-dark .lg-bubble { background: rgba(255, 255, 255, .1) !important; }
/* a real lens throws a little light down onto the surface under it and darkens its own far rim */
html body .lg-sheen { box-shadow: inset 0 -1.5px 2px rgba(31, 41, 55, .08), inset 0 1px 1px rgba(255, 255, 255, .8) !important; }
html body .tone-dark > .lg-bubble .lg-sheen, html body .pcd.tone-dark .lg-sheen { box-shadow: inset 0 -1.5px 2px rgba(0, 0, 0, .25), inset 0 1px 1px rgba(255, 255, 255, .35) !important; }

/* ---- 9. the light moves with the phone (polish.js writes --tilt-x / --tilt-y, -1..1, and --tilt-a) ---- */
html body.lg.has-bnav .bnav::before {
    background:
        radial-gradient(42% 140% at calc(28% + var(--tilt-x, 0) * 30%) calc(-10% + var(--tilt-y, 0) * 30%), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%),
        linear-gradient(180deg, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, 0) 38%) !important;
}
html body .lg-sheen > i.lg-lm { transform: translate(calc(var(--tilt-x, 0) * 6%), calc(var(--tilt-y, 0) * 8%)); }

/* ---- 10. owner (11-12): over white the 58% white glass just looked white. Frosted LIQUID glass
   instead, for the dock, the phone bar and the «بیشتر» menu alike: a light tint (30%) so the page
   reads through the frost, more blur and colour, and the glass made visible by light, not paint -
   a bright specular edge on top, a darker bottom edge where the light leaves, a liquid sheen
   across the upper half, and a soft lifted shadow. ---- */
html body.lg.has-bnav .bnav > .lg-barglass,
html body.lg .pcd > * > .pcd-glass,
html body .pcd .pcd-panel > .pcd-glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .22) 55%, rgba(255, 255, 255, .3) 100%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(1.9) brightness(1.04) !important; backdrop-filter: blur(10px) saturate(1.9) brightness(1.04) !important;
    border: 1px solid rgba(255, 255, 255, .5) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .95),
        inset 0 -1px 0 rgba(31, 41, 55, .07),
        inset 1px 0 0 rgba(255, 255, 255, .45), inset -1px 0 0 rgba(255, 255, 255, .45),
        inset 0 10px 16px -12px rgba(255, 255, 255, .95),
        inset 0 -12px 16px -14px rgba(31, 41, 55, .16),
        0 12px 32px -14px rgba(31, 41, 55, .28), 0 2px 6px -2px rgba(31, 41, 55, .1) !important;
}
html body.lg.has-bnav .bnav { box-shadow: 0 12px 32px -14px rgba(31, 41, 55, .28), 0 2px 6px -2px rgba(31, 41, 55, .1) !important; }
/* the liquid sheen: a curved band of light across the top, like light on a rounded slab */
html body.lg .pcd > * > .pcd-glass::before, html body .pcd .pcd-panel > .pcd-glass::before, html body.lg.has-bnav .bnav::before {
    opacity: 1 !important;
    background:
        radial-gradient(120% 90% at 50% -38%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .18) 46%, rgba(255, 255, 255, 0) 62%),
        radial-gradient(60% 120% at calc(18% + var(--tilt-x, 0) * 25%) 0%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 70%) !important;
}
/* dark parts: the same glass in navy */
html body.lg.has-bnav .bnav.tone-dark > .lg-barglass, html body.lg .pcd.tone-dark > * > .pcd-glass, html body .pcd.tone-dark .pcd-panel > .pcd-glass {
    background: linear-gradient(180deg, rgba(31, 41, 55, .5) 0%, rgba(17, 24, 39, .4) 60%, rgba(17, 24, 39, .48) 100%) !important;
    border-color: rgba(255, 255, 255, .14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .25), inset 0 10px 16px -12px rgba(255, 255, 255, .25) !important;
}
html body.lg .pcd.tone-dark > * > .pcd-glass::before, html body .pcd.tone-dark .pcd-panel > .pcd-glass::before, html body.lg.has-bnav .bnav.tone-dark::before { opacity: .35 !important; }
html body.lg.has-bnav .bnav.tone-dark { box-shadow: none !important; }
/* labels hold over anything that shows through the lighter glass */
html body.lg .pcd:not(.tone-dark) :is(.pcd-pill, .pcd-more) > .pcd-it, html body .pcd:not(.tone-dark) .pcd-panel button { text-shadow: 0 0 10px rgba(255, 255, 255, .9) !important; }
