/* ============================================================
   Header dropdowns (src/Menu/MegaMenu.php, components/menu-mega*.php).
   After the canvas "Poster Bazaar — menu w nagłówku": columns under
   labels (12 px, capitals, grey: labels, never links), links 15 px,
   colour dots, the Komplet tile, latest guides; on phones the same
   groups as pills in WoodMart's accordion.
   ============================================================ */

.pb-mega,
.pb-mega-m {
    --wd-dropdown-padding: 28px 32px 24px;
    --pb-ink: #23231f;
    --pb-muted: #6b6a62;
    --pb-line: #e8e1d5;
    --pb-sand: #f6f3ed;
}

/* ---- Wide screens ----------------------------------------- */

.wd-nav-main .pb-mobile-only {
    display: none !important;
}

.pb-mega.wd-dropdown-menu {
    /* Sized by its inner box (components/menu-mega.php sets its width). */
    width: auto !important;
    max-width: calc(100vw - 30px);
}

.pb-mega .pb-mega__inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 196px;
    max-width: calc(100vw - 94px);
    padding: 0 !important;
}

.pb-mega__cols {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.pb-mega__col {
    flex: 1 1 0;
    min-width: 150px;
}

.pb-mega__col--posts {
    flex-grow: 3;
    min-width: 400px;
}

.pb-mega .pb-mega__label,
.pb-mega-m .pb-mega-m__label {
    margin: 0 0 12px;
    color: var(--pb-muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.pb-mega__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pb-mega__list--two {
    column-count: 2;
    column-gap: 40px;
}

.pb-mega__list li {
    margin: 0;
    padding: 0;
    break-inside: avoid;
}

.pb-mega .pb-mega__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    color: var(--pb-ink);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.pb-mega .pb-mega__link:hover,
.pb-mega .pb-mega__link.is-current {
    color: var(--color-primary);
}

.pb-mega .pb-mega__link.is-current {
    font-weight: 600;
}

.pb-mega__dot {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

/* Latest guides. */
.pb-mega__posts {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pb-mega .pb-mega__post {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--pb-ink);
    text-decoration: none;
}

.pb-mega__thumb {
    flex: none;
    width: 96px;
    height: 72px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--pb-sand);
}

.pb-mega__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-mega__post-title {
    font-size: 15px;
    line-height: 1.4;
}

.pb-mega .pb-mega__post:hover .pb-mega__post-title {
    color: var(--color-primary);
}

/* The Komplet tile: best sellers framed on a shelf, discounts large. */
.pb-mega .pb-mega__tile {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: 12px;
    width: 280px;
    padding: 14px 14px 18px;
    border-radius: 10px;
    background: var(--pb-sand);
    color: var(--pb-ink);
    text-decoration: none;
    box-sizing: border-box;
}

.pb-mega__wall {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    height: 128px;
    padding: 0 16px 22px;
    border-radius: 6px;
    background: linear-gradient(180deg, #efe8dc, #e6dccb);
    overflow: hidden;
}

.pb-mega__frame {
    position: relative;
    z-index: 1;
    flex: none;
    width: 24%;
    aspect-ratio: 5 / 7;
    padding: 3px;
    border: 2px solid #2b2925;
    background: #fff;
    box-shadow: 2px 4px 8px rgba(35, 35, 31, .22);
    box-sizing: border-box;
    transition: transform .3s;
}

.pb-mega__frame--1 {
    order: 2;
    width: 31%;
}

.pb-mega__frame--2 {
    order: 3;
}

.pb-mega__frame--3 {
    order: 1;
    width: 21%;
}

.pb-mega__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-mega__shelf {
    position: absolute;
    right: 10px;
    bottom: 16px;
    left: 10px;
    height: 6px;
    border-radius: 2px;
    background: #b89f7c;
    box-shadow: 0 3px 6px rgba(35, 35, 31, .18);
}

.pb-mega .pb-mega__tile:hover .pb-mega__frame--1 {
    transform: translateY(-3px);
}

.pb-mega__tile-title {
    padding: 0 6px;
    font-family: var(--font-heading);
    font-size: 20px;
    line-height: 1.25;
}

.pb-mega__tiers {
    display: flex;
    padding: 0 6px;
}

.pb-mega__tier {
    display: flex;
    flex-direction: column;
    color: var(--pb-muted);
    font-size: 13px;
    line-height: 1.3;
}

.pb-mega__tier + .pb-mega__tier {
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid #ddd3c2;
}

.pb-mega__tier b {
    color: var(--color-primary-dark);
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.1;
}

.pb-mega__tile-link {
    padding: 0 6px;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 700;
}

.pb-mega .pb-mega__tile:hover .pb-mega__tile-link {
    color: var(--color-primary-dark);
}

/* Room tiles: icon, name, how many posters. */
.pb-mega__tiles {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pb-mega .pb-mega__tile-link-item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--pb-ink);
    text-decoration: none;
    transition: background-color .2s;
}

.pb-mega .pb-mega__tile-link-item:hover,
.pb-mega .pb-mega__tile-link-item.is-current {
    background: var(--pb-sand);
}

.pb-mega__icon {
    display: flex;
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--pb-sand);
    color: var(--color-primary);
}

.pb-mega__tile-link-item:hover .pb-mega__icon {
    background: #fff;
}

.pb-mega__icon svg {
    width: 24px;
    height: 24px;
}

.pb-mega__tile-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.pb-mega__tile-count {
    color: var(--pb-muted);
    font-size: 13px;
    line-height: 1.3;
}

.pb-mega .pb-mega__note {
    margin: 0;
    color: var(--pb-muted);
    font-size: 13px;
}

/* A caret on the items that open a dropdown. */
.wd-nav-main .pb-nav-caret {
    width: 12px;
    height: 12px;
    margin-left: 5px;
    vertical-align: middle;
    transition: transform .2s;
}

.wd-nav-main > li:hover .pb-nav-caret,
.wd-nav-main > li:focus-within .pb-nav-caret {
    transform: rotate(180deg);
}

.pb-mega__foot {
    padding-top: 16px;
    border-top: 1px solid var(--pb-line);
}

.pb-mega .pb-mega__all {
    white-space: nowrap;
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- Phones: WoodMart's side panel ------------------------ */

/* Room for two columns of tiles. */
.mobile-nav.wd-side-hidden {
    --wd-side-hidden-w: min(340px, 88vw);
}

/* Top items as on the canvas: 16 px semibold, no capitals. */
.wd-nav-mobile > li > .wd-nav-opener {
    top: 0;
    height: 54px;
}

.wd-nav-mobile > li > a.woodmart-nav-link {
    min-height: 54px;
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.wd-nav-mobile .pb-mega-m {
    padding: 0 20px 18px;
}

.pb-mega-m .pb-mega-m__label {
    margin: 14px 0 8px;
}

.pb-mega-m__pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.wd-nav-mobile .pb-mega-m .pb-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 48px;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: #f7f4ee;
    color: var(--pb-ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    hyphens: auto;
    overflow-wrap: break-word;
    text-transform: none;
    box-sizing: border-box;
}

.wd-nav-mobile .pb-mega-m .pb-pill.is-current {
    border-color: var(--pb-ink);
    background: var(--pb-ink);
    color: #fff;
}

.wd-nav-mobile .pb-mega-m .pb-mega-m__all {
    display: inline-block;
    margin-top: 14px;
    padding: 0;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-transform: none;
}

.wd-nav-mobile .pb-menu-komplet > a {
    color: var(--color-primary) !important;
    font-weight: 700;
}

/* Shortcuts under the menu. */
.wd-nav-mobile .pb-shortcuts {
    padding: 16px 20px 24px;
    border-bottom: 0 !important;
}

.pb-shortcuts__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wd-nav-mobile .pb-shortcuts__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 6px;
    border-radius: 8px;
    background: #f6f3ed;
    color: #23231f;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-transform: none;
}

/* "Bon podarunkowy": the one top item with an icon on the desktop. */
.wd-nav-main .pb-menu-gift .pb-nav-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: #5e6a46;
    vertical-align: -3px;
}

/* Below 1366px the top row has no room for the words: the gift icon
   alone (its name stays for screen readers and as the link's title). */
@media (min-width: 1025px) and (max-width: 1365px) {
    .wd-nav-main .pb-menu-gift .nav-link-text {
        font-size: 0;
    }
    .wd-nav-main .pb-menu-gift .pb-nav-icon {
        width: 20px;
        height: 20px;
        margin-right: 0;
        vertical-align: -5px;
    }
}

/* ---- Phones: icons, room pills, sizes, Komplet card ------- */

.wd-nav-mobile .pb-nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: var(--color-primary);
    vertical-align: -4px;
}

.wd-nav-mobile .pb-menu-gift > a {
    display: flex;
    align-items: center;
}
.wd-nav-mobile .pb-menu-gift .nav-link-text {
    flex: 1 1 auto;
}
.wd-nav-mobile .pb-menu-note {
    flex: 0 0 auto;
    margin-left: 12px;
    font-size: 13px;
    font-weight: 400;
    color: #6b6a62;
    text-transform: none;
}

.wd-nav-mobile .pb-mega-m {
    padding-top: 6px;
}

.pb-mega-m > :first-child {
    margin-top: 6px;
}

.wd-nav-mobile .pb-mega-m .pb-pill__icon {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

.wd-nav-mobile .pb-mega-m .pb-pill.is-current .pb-pill__icon {
    color: #fff;
}

.wd-nav-mobile > li.pb-menu-komplet {
    padding: 16px 20px 8px;
    border-bottom: 0 !important;
}

.wd-nav-mobile .pb-mcard {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 10px;
    background: #f6f3ed;
    color: #23231f;
    text-transform: none;
}

.pb-mcard .pb-mcard__wall {
    height: 92px;
    padding: 0 10px 16px;
}

.pb-mcard .pb-mega__shelf {
    bottom: 11px;
    height: 5px;
}

.pb-mcard__copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pb-mcard__title {
    color: var(--color-primary-dark);
    font-family: var(--font-heading);
    font-size: 18px;
    line-height: 1.2;
}

.pb-mcard__tiers {
    display: flex;
    flex-direction: column;
    color: #6b6a62;
    font-size: 13px;
    line-height: 1.35;
}

.pb-mcard__tiers b {
    color: #23231f;
}

/* Shortcuts and the login at the panel's foot: the list is at least the
   screen's height (less the search box), the shortcuts take what is left. */
.mobile-nav .wd-nav-mobile.wd-active {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    min-height: calc(100dvh - 70px);
}

.mobile-nav .wd-nav-mobile.wd-active > li {
    flex: none;
    width: 100%;
}

.wd-nav-mobile .pb-shortcuts {
    margin-top: auto;
}

/* A small poster in category tiles on phones. */
.pb-pill__thumb {
    flex: none;
    width: 27px;
    height: 36px;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(35, 35, 31, .22);
}

.pb-pill__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Sizes: the size's letter (S, M, L, XL) where other tiles have an icon. */
.pb-mega__icon--size,
.pb-pill__mark {
    color: var(--color-primary-dark);
    font-family: var(--font-heading);
    line-height: 1;
}

.pb-mega__icon--size {
    font-size: 19px;
}

.pb-pill__mark {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fff;
    font-size: 15px;
}

.pb-pill__text {
    display: flex;
    flex-direction: column;
}

.pb-pill__text small {
    color: #6b6a62;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.25;
}

.wd-nav-mobile .pb-mega-m .pb-pill.is-current .pb-pill__text small {
    color: #e8e1d5;
}

.wd-nav-mobile .pb-mega-m .pb-pill.is-current .pb-pill__mark {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

/* Sizes to one scale above a sideboard (components/menu-size-scene.php). */
.pb-sizes-scene {
    --cm: 1.35px;
    position: relative;
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    order: 2;
    padding: 18px 16px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f3eee5, #ebe3d5);
}

.pb-sizes-scene__wall {
    display: flex;
    align-items: flex-end;
    gap: calc(6 * var(--cm));
    margin: 0 !important;
    padding: 0 0 20px !important;
    list-style: none;
}

.pb-sizes-scene__poster {
    position: relative;
    width: calc(var(--w) * var(--cm));
    height: calc(var(--h) * var(--cm));
    margin: 0 !important;
    padding: 0 !important;
    border: 2px solid #2b2925;
    background: #fff;
    box-shadow: 2px 4px 8px rgba(35, 35, 31, .18);
    box-sizing: border-box;
}

.pb-sizes-scene__poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-sizes-scene__poster.is-current {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.pb-sizes-scene__label {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    color: #3a3a34;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
}

.pb-sizes-scene__sideboard {
    display: block;
    width: calc(160 * var(--cm));
    height: calc(26 * var(--cm));
    margin-top: 0;
    border-top: 4px solid #a88b67;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(180deg, #c6ab86, #b59870);
}

.pb-sizes-scene__caption {
    margin-top: 8px;
    color: #6b6a62;
    font-size: 11.5px;
    line-height: 1.3;
}

.pb-mega .pb-mega__cols:has(.pb-sizes-scene) {
    align-items: center;
}

/* On phones: under the tiles, the panel's width. */
.wd-nav-mobile .pb-mega-m .pb-sizes-scene {
    --cm: 1.12px;
    order: 0;
    margin: 6px 0 10px;
}
