/* ==========================================================================
   Price Board — application shell
   Everything here is local; no external fonts, CDNs or trackers.
   ========================================================================== */

:root {
    --pb-primary: #0b5ed7;
    --pb-primary-dark: #084298;
    --pb-accent: #00a67d;
    --pb-ink: #16202c;
    --pb-muted: #6b7a8d;
    --pb-line: #e4e9f0;
    --pb-bg: #f4f6fa;
    --pb-radius: 14px;
    --pb-shadow: 0 1px 2px rgba(16, 32, 54, .04), 0 8px 24px rgba(16, 32, 54, .07);
    --pb-shadow-lg: 0 2px 4px rgba(16, 32, 54, .05), 0 18px 42px rgba(16, 32, 54, .13);
}

body {
    background: var(--pb-bg);
    color: var(--pb-ink);
    font-family: Calibri, "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}
.anynumber{
    font-family: 'impact' !important;
}

/* ---------- top bar ---------- */
.pb-nav {
    background: #fff;
    border-bottom: 1px solid var(--pb-line);
    box-shadow: 0 1px 3px rgba(16, 32, 54, .05);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.pb-brand {
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--pb-ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.pb-brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .95rem;
}

.pb-nav .nav-link {
    color: var(--pb-muted);
    font-weight: 600;
    border-radius: 9px;
    padding: .45rem .8rem;
    transition: background .15s ease, color .15s ease;
}

.pb-nav .nav-link:hover { background: #eef2f8; color: var(--pb-ink); }
.pb-nav .nav-link.active { background: #e7f0ff; color: var(--pb-primary-dark); }

.pb-user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .7rem .3rem .35rem;
    border: 1px solid var(--pb-line);
    border-radius: 999px;
    background: #fff;
}

.pb-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
    color: #fff;
    display: grid; place-items: center;
    font-size: .78rem; font-weight: 700;
}

/* ---------- generic surfaces ---------- */
.pb-card {
    background: #fff;
    border: 1px solid var(--pb-line);
    border-radius: var(--pb-radius);
    box-shadow: var(--pb-shadow);
}

.pb-page-title { font-weight: 800; letter-spacing: -.5px; }
.pb-subtitle { color: var(--pb-muted); }

/* ---------- animated entrance (no library needed) ---------- */
@keyframes pbRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.pb-rise { animation: pbRise .45s cubic-bezier(.22, .61, .36, 1) both; }

.pb-stagger > * { animation: pbRise .45s cubic-bezier(.22, .61, .36, 1) both; }
.pb-stagger > *:nth-child(1) { animation-delay: .03s }
.pb-stagger > *:nth-child(2) { animation-delay: .07s }
.pb-stagger > *:nth-child(3) { animation-delay: .11s }
.pb-stagger > *:nth-child(4) { animation-delay: .15s }
.pb-stagger > *:nth-child(5) { animation-delay: .19s }
.pb-stagger > *:nth-child(6) { animation-delay: .23s }
.pb-stagger > *:nth-child(7) { animation-delay: .27s }
.pb-stagger > *:nth-child(8) { animation-delay: .31s }
.pb-stagger > *:nth-child(9) { animation-delay: .35s }
.pb-stagger > *:nth-child(10){ animation-delay: .39s }
.pb-stagger > *:nth-child(n+11) { animation-delay: .42s }

@media (prefers-reduced-motion: reduce) {
    .pb-rise, .pb-stagger > * { animation: none !important; }
    * { transition: none !important; }
}

/* ---------- selectable / clickable tiles ---------- */
.pb-tile {
    display: block;
    background: #fff;
    border: 1px solid var(--pb-line);
    border-radius: var(--pb-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--pb-shadow);
    transition: transform .18s cubic-bezier(.22,.61,.36,1), box-shadow .18s ease, border-color .18s ease;
}

.pb-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--pb-shadow-lg);
    border-color: #c9d8f5;
    color: inherit;
}

.pb-tile:active { transform: translateY(-1px); }

.pb-tile-media {
    aspect-ratio: 16 / 10;
    background: #f0f3f8;
    overflow: hidden;
}

.pb-tile-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s cubic-bezier(.22,.61,.36,1);
}

.pb-tile:hover .pb-tile-media img { transform: scale(1.05); }
.pb-tile-body { padding: .9rem 1rem; }

/* ---------- notes / announcements ---------- */
.pb-note {
    border: 1px solid var(--pb-line);
    border-left-width: 5px;
    border-radius: 12px;
    background: #fff;
    padding: 1rem 1.15rem;
    box-shadow: var(--pb-shadow);
}

.pb-note.info    { border-left-color: var(--pb-primary); }
.pb-note.success { border-left-color: var(--pb-accent); }
.pb-note.warning { border-left-color: #e8a33d; }
.pb-note.danger  { border-left-color: #dc3545; }
.pb-note .pb-note-title { font-weight: 700; margin-bottom: .25rem; }
.pb-note .pb-note-body  { color: #44546a; white-space: pre-line; margin: 0; }

.pb-note.pinned::after {
    content: "\f08d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    float: right;
    color: #c3ccd9;
    margin-top: -1.4rem;
}

/* ---------- search ---------- */
.pb-search {
    position: relative;
}

.pb-search input {
    height: 52px;
    border-radius: 999px;
    padding-left: 3rem;
    border: 1px solid var(--pb-line);
    box-shadow: var(--pb-shadow);
    font-size: 1.02rem;
}

.pb-search input:focus {
    border-color: var(--pb-primary);
    box-shadow: 0 0 0 4px rgba(11, 94, 215, .12);
}

.pb-search .fa-search {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pb-muted);
}

/* ---------- badges & chips ---------- */
.pb-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 600;
    padding: .22rem .6rem;
    border-radius: 999px;
    background: #eef2f8;
    color: #4a5b70;
}

.pb-chip.ok    { background: #e6f7f1; color: #0a7355; }
.pb-chip.warn  { background: #fdf3e3; color: #96631a; }
.pb-chip.dang  { background: #fdecec; color: #9d2727; }

/* ---------- "NEW" sticker on a freshly uploaded promotion ---------- */
.pb-sticker {
    display: inline-block;
    background: #e8433d;
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .06em;
    padding: .16rem .42rem;
    border-radius: 5px;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(232, 67, 61, .35);
    animation: pbPulse 2.4s ease-in-out infinite;
}

@keyframes pbPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
}

/* ---------- product table: codes, prices, branch groups ---------- */

.product-codes {
    font-size: .74rem;
    color: #8a97a8;
    letter-spacing: .01em;
    margin-top: .15rem;
}

.product-codes .sep { margin: 0 .3rem; opacity: .55; }

/* The old price is crossed out in red, the promo price is green and bold,
   and the MyCoop price is purple, so the three are never confused. */
.price-was {
    color: #d13438 !important;
    text-decoration: line-through;
    font-size: .9rem;
}

.price-now {
    color: #0a7a52 !important;
    font-weight: 800;
    font-size: 1rem;
}

.price-coop {
    color: #6b3fa0 !important;
    font-weight: 800;
    font-size: 1rem;
}

.js-product-row.is-plain { background: #fcfdfe; }                                
.js-product-row.is-plain:hover { background: #f6f9ff; }                          
.pb-chip.plain {                                                                  
    background: transparent;                                                     
    color: #93a1b2;                                                               
    border: 1px dashed #d5dde7;                                                   
}                                                                                 

/* Branch groups get a stable colour each; "all stores" stays neutral. */
.cluster-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .2rem .55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.cluster-tag.cl-all { background: #eef2f8; color: #5a6a7e; }
.cluster-tag.cl-1   { background: #e2f0ff; color: #14548f; }
.cluster-tag.cl-2   { background: #fdeee2; color: #9a5220; }
.cluster-tag.cl-3   { background: #e6f7ee; color: #14663f; }
.cluster-tag.cl-4   { background: #f3e9fb; color: #5c3287; }
.cluster-tag.cl-5   { background: #fdf1f2; color: #99282e; }
.cluster-tag.cl-6   { background: #fff8dc; color: #7c6110; }

/* ---------- promotion types, colour-coded ----------------------------
   Each type carries its own tint, border and ink. The same three variables
   drive the column, its heading and the links inside it, so adding a colour
   later means editing one block rather than hunting through the markup.
   -------------------------------------------------------------------- */

.pt-0 { --pt-bg: #f7f9fc; --pt-line: #dfe6ef; --pt-ink: #4a5b70; }
.pt-1 { --pt-bg: #eaf3ff; --pt-line: #b9d5f7; --pt-ink: #10508c; }
.pt-2 { --pt-bg: #fdf0e6; --pt-line: #f6cfae; --pt-ink: #99521c; }
.pt-3 { --pt-bg: #e8f7ef; --pt-line: #b3e2c9; --pt-ink: #10643f; }
.pt-4 { --pt-bg: #f4ebfc; --pt-line: #d9c2f0; --pt-ink: #5b2f8a; }
.pt-5 { --pt-bg: #fdecee; --pt-line: #f5c2c8; --pt-ink: #96252f; }
.pt-6 { --pt-bg: #fff7dd; --pt-line: #f0dfa4; --pt-ink: #7a5c0c; }
.pt-7 { --pt-bg: #e6f6f8; --pt-line: #aadde4; --pt-ink: #0f5f6b; }
.pt-8 { --pt-bg: #f0f1fb; --pt-line: #c9ccef; --pt-ink: #3b3f8f; }

.promo-column {
    background: var(--pt-bg);
    border: 1px solid var(--pt-line);
    border-top: 4px solid var(--pt-ink);
    border-radius: var(--pb-radius);
    padding: .9rem;
    height: 100%;
}
.promo-column-banner,
.promo-column-noart {
    margin: -.9rem -.9rem .75rem;
    height: 74px;
    overflow: hidden;
    border-radius: calc(var(--pb-radius) - 1px) calc(var(--pb-radius) - 1px) 0 0;
    border-bottom: 1px solid var(--pt-line);
}

.promo-column-banner { background: #fff; }

.promo-column-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.promo-column-noart {
    background: var(--pt-bg);
    display: grid;
    place-items: center;
    color: var(--pt-ink);
    font-size: 1.6rem;
    opacity: .45;
}
.promo-column-title {
    color: var(--pt-ink);
    font-weight: 800;
    font-size: .86rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.promo-column .pb-chip {
    background: #fff;
    color: var(--pt-ink);
    border: 1px solid var(--pt-line);
}

/* A promotion inside a coloured column. */
.promo-column .promo-link,
.promo-card {
    background: #fff;
    border: 1px solid var(--pt-line);
    border-left: 3px solid var(--pt-ink);
    border-radius: 10px;
    padding: .55rem .7rem;
    margin-bottom: .45rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform .15s ease, box-shadow .15s ease;
}

.promo-column .promo-link:hover,
.promo-card:hover {
    background: #fff;
    transform: translateX(3px);
    box-shadow: var(--pb-shadow);
    color: inherit;
}

.promo-column .btn-see-more {
    background: #fff;
    border: 1px solid var(--pt-line);
    color: var(--pt-ink);
    font-weight: 600;
    font-size: .82rem;
    width: 100%;
    border-radius: 9px;
    padding: .35rem;
}

.promo-column .btn-see-more:hover { background: var(--pt-bg); }

/* ---------- a list locked because the other kind is in play ---------- */
[data-kind].is-locked {
    opacity: .5;
    filter: grayscale(.6);
}

[data-kind].is-locked .table-responsive { pointer-events: none; }

.locked-note {
    background: #fdf3e3;
    color: #96631a;
    font-size: .84rem;
    font-weight: 600;
    padding: .6rem 1rem;
    border-bottom: 1px solid #f3e2c4;
}

/* ---------- section logo ---------- */
.section-logo {
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--pb-line);
    background: #fff;
    flex: none;
}

/* ---------- offer links on the promotion contents page ---------- */
.offer-link {
    border: 1px solid var(--pb-line);
    border-radius: 10px;
    padding: .55rem .75rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.offer-link:hover {
    border-color: #c9d8f5;
    background: #f6f9ff;
    color: inherit;
    transform: translateX(2px);
}

.offer-link.coop:hover {
    border-color: #a8e2cd;
    background: #f3fbf8;
}

/* ---------- promotion links inside the home-page columns ---------- */
.promo-link {
    border: 1px solid var(--pb-line);
    border-radius: 10px;
    padding: .5rem .6rem;
    margin-bottom: .4rem;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.promo-link:hover {
    border-color: #c9d8f5;
    background: #f6f9ff;
    transform: translateX(2px);
}

/* ---------- dirham symbol ---------- */
.dirham {
    display: inline-block;
    vertical-align: -.09em;
    line-height: 1;
}

.dirham svg { width: 100%; height: 100%; display: block; }
.currency-fallback { font-weight: 600; }

/* ---------- tables ---------- */
.pb-table thead th {
    background: #f7f9fc;
    color: var(--pb-muted);
    font-size: .76rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--pb-line);
    white-space: nowrap;
}

.pb-table tbody tr { transition: background .12s ease; }
.pb-table tbody tr:hover { background: #f8fbff; }

/* ---------- empty state ---------- */
.pb-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--pb-muted);
}

.pb-empty i { font-size: 2.6rem; opacity: .35; margin-bottom: .8rem; display: block; }

/* ---------- footer ---------- */
.pb-footer {
    color: var(--pb-muted);
    font-size: .85rem;
    padding: 2rem 0 1.2rem;
}


/* An uploaded logo replaces the gradient mark, filling the same square. */
.pb-brand .mark.has-logo {
    background: transparent;
    padding: 0;
    overflow: hidden;
}

.pb-brand .mark.has-logo img,
.login-mark.has-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-mark.has-logo {
    background: transparent !important;
    overflow: hidden;
}

/* The preview on the branding screen. */
.brand-preview {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 14px;
    border: 1px solid var(--pb-line);
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--pb-muted);
    overflow: hidden;
}

.brand-preview img { width: 100%; height: 100%; object-fit: contain; }