/* =========================================================
   PosterBazaar Gallery Wizard — style.css (redesign)
   ========================================================= */

#pb-gw {
    font-family: 'Hanken Grotesk', Arial, Helvetica, sans-serif;
    color: #4c4c4c;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Progress bar (tab strip) --------------------------------- */

.pb-gw__progress {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff !important;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.pb-gw__progress-inner {
    display: flex;
    width: 100%;
}

.pb-gw__progress-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    background: #fff !important;
    border: none;
    border-right: 1px solid rgba(0,0,0,0.1);
    cursor: default !important;
    font-family: 'Hanken Grotesk', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #767676;
    padding: 0 12px;
    position: relative;
    transition: color 0.22s ease, background 0.22s ease;
    white-space: nowrap;
    user-select: none;
}

.pb-gw__progress-step:last-child { border-right: none; }

.pb-gw__progress-step::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.22s ease;
}

.pb-gw__progress-step--active {
    color: #2a2a2a;
    font-weight: 700;
}

.pb-gw__progress-step--active::after {
    background: #5e6a46;
}

.pb-gw__progress-step--done,
.pb-gw__progress-step--reachable {
    cursor: pointer !important;
}

.pb-gw__progress-step--done {
    color: #4c4c4c;
}

.pb-gw__progress-step--done:hover,
.pb-gw__progress-step--reachable:hover {
    background: rgba(143,151,121,0.05) !important;
    color: #3f4830;
}

.pb-gw__progress-step-num {
    font-size: 11px;
    font-weight: 400;
    color: #767676;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
}

.pb-gw__progress-step-label { font-size: 13px; }

/* --- Main layout ---------------------------------------------- */

.pb-gw__main {
    display: grid;
    grid-template-columns: 68% 32%;
    align-items: start;
}

/* --- Preview (left column, sticky) ---------------------------- */

.pb-gw__preview {
    position: sticky;
    top: 52px;
    background: #eceae5;
    overflow: hidden;
}

.pb-gw__preview-inner {
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    background: #eceae5;
}

.pb-gw__canvas-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background-image 0.35s ease;
}

.pb-gw__canvas-frames {
    position: absolute;
    inset: 0;
}

/* --- Panel (right column) ------------------------------------- */

.pb-gw__panel {
    border-left: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding: 40px 36px 64px;
}

/* --- Panel interior ------------------------------------------- */

.pb-gw__step-panel-header {
    margin-bottom: 28px;
}

.pb-gw__step-panel-header h2 {
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    color: #2a2a2a;
    line-height: 1.2;
    margin: 0 0 8px;
}

.pb-gw__step-panel-header p {
    font-size: 15px;
    color: #767676;
    margin: 0;
    line-height: 1.6;
}

.pb-gw__step-panel-body {
    flex: 1;
}

.pb-gw__step-panel-nav {
    padding-top: 24px;
    margin-top: 32px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;

    button.button {
        background-color: var(--color-primary);
        color: var(--color-white);
        border-radius: var(--radius-base);

        &:hover {
            background-color: var(--color-primary-dark);
        }
    }

    button.button.alt {
        color: var(--color-primary);
        border: 1px solid var(--color-primary);
        background-color: transparent;

        &:hover {
            background-color: var(--color-primary);
            color: var(--color-white);
        }
    }
}

/* --- Room grid (step 1) --------------------------------------- */

.pb-gw__room-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.pb-gw__room-card {
    aspect-ratio: 3 / 2;
    border: 2.5px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f0f0ee;
    padding: 0;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.pb-gw__room-card:hover {
    border-color: rgba(143,151,121,0.5);
    transform: scale(1.02);
}

.pb-gw__room-card--selected {
    border-color: #5e6a46;
    box-shadow: 0 0 0 1px #5e6a46;
}

.pb-gw__room-card-inner {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.pb-gw__room-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5e6a46;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
}

.pb-gw__room-card--selected .pb-gw__room-card-check { opacity: 1; }

.pb-gw__room-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 8px 7px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    font-size: 11px;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

/* --- Layout tabs (step 2) ------------------------------------- */

.pb-gw__layout-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.pb-gw__layout-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border: none;
    border-right: 1px solid rgba(0,0,0,0.1);
    background: transparent !important;
    font-family: 'Hanken Grotesk', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #767676;
    cursor: pointer;
    position: relative;
    transition: color 0.22s ease;
    white-space: nowrap;
    user-select: none;
    padding: 0;
}

.pb-gw__layout-tab:last-child { border-right: none; }

.pb-gw__layout-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.22s ease;
}

.pb-gw__layout-tab:hover { color: #2a2a2a; background: rgba(0,0,0,0.03) !important; }

.pb-gw__layout-tab--active {
    color: #2a2a2a;
    font-weight: 700;
}

.pb-gw__layout-tab--active::after {
    background: #5e6a46;
}

/* --- Layout list (step 2) ------------------------------------- */

.pb-gw__layout-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pb-gw__layout-card {
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 5px;
    padding: 14px 16px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.22s ease, background 0.22s ease;
    position: relative;
}

.pb-gw__layout-badge {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: #5e6a46;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
}

.pb-gw__layout-card:hover { border-color: #5e6a46; }

.pb-gw__layout-card--selected {
    border-color: #5e6a46;
    border-width: 2px;
    background: rgba(143,151,121,0.04);
}

.pb-gw__layout-card-body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pb-gw__layout-card-diagram {
    width: 110px;
    height: 80px;
    flex-shrink: 0;
    background: transparent;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.pb-gw__layout-preview-frame {
    position: absolute;
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary);
    border-radius: 1px;
}

.pb-gw__layout-card-text { flex: 1; min-width: 0; }

.pb-gw__layout-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #2a2a2a;
    margin-bottom: 0;
}

.pb-gw__layout-card-dim {
    font-size: 12px;
    font-weight: 600;
    color: #5e6a46;
    margin-bottom: 6px;
}

.pb-gw__layout-card-desc {
    font-size: 12px;
    color: #767676;
    line-height: 1.5;
}

/* --- Slot accordion (step 3) ---------------------------------- */

.pb-gw__slot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

/* --- Compact step 3 header ------------------------------------ */

.pb-gw__step-panel-header--compact {
    margin-bottom: 14px;
}

.pb-gw__step-panel-header--compact h2 {
    font-size: 22px;
}

.pb-gw__step-panel-header--compact p {
    display: none;
}

/* --- Shared poster picker (step 3 redesign) ------------------- */

.pb-gw__shared-picker {
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
}

.pb-gw__shared-picker .pb-gw__slot-picker {
    border-top: none;
    padding: 0;
}

/* --- Step 3: panel fixed-height on desktop so picker is always visible --- */

@media (min-width: 1024px) {
    .pb-gw__panel--step3 {
        position: sticky;
        top: 52px;
        height: calc(100vh - 52px);
        padding-bottom: 0 !important;
        overflow: hidden;
    }

    .pb-gw__panel--step3 .pb-gw__step-panel-body {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .pb-gw__panel--step3 .pb-gw__shared-picker {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Slot picker: flex column; grid-wrap is the scroll boundary */
    .pb-gw__panel--step3 .pb-gw__slot-picker {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    /* Grid-wrap scrolls; grid renders at natural height inside */
    .pb-gw__panel--step3 .pb-gw__poster-grid-wrap {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .pb-gw__panel--step3 .pb-gw__poster-grid {
        max-height: none;
        overflow-y: visible;
    }

    .pb-gw__panel--step3 .pb-gw__step-panel-nav {
        flex-shrink: 0;
        padding-top: 16px;
        margin-top: 0;
    }
}

.pb-gw__slot-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.22s ease, background 0.22s ease;
    user-select: none;
}

.pb-gw__slot-card:hover { border-color: rgba(143,151,121,0.5); }

.pb-gw__slot-card--active {
    border-color: #5e6a46;
    border-left-width: 3px;
    background: rgba(143,151,121,0.03);
}

.pb-gw__slot-card--filled { border-color: rgba(143,151,121,0.45); }
.pb-gw__slot-card--active.pb-gw__slot-card--filled { border-color: #5e6a46; }

/* .pb-gw__slot-card-header no longer used (compact row design) */

.pb-gw__slot-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #4c4c4c;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pb-gw__slot-card--active .pb-gw__slot-num,
.pb-gw__slot-card--filled .pb-gw__slot-num {
    background: #5e6a46;
    color: #fff;
    border-color: #5e6a46;
}

.pb-gw__slot-card-title {
    flex: 1;
    min-width: 0;
    margin-left: 10px;
}

.pb-gw__slot-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #2a2a2a;
    display: block;
    margin-bottom: 3px;
    text-align: left;
}

.pb-gw__slot-card-size {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #5e6a46;
    background: rgba(143,151,121,0.1);
    border-radius: 100px;
    padding: 2px 8px;
    float: left;
}

.pb-gw__slot-chevron {
    flex-shrink: 0;
    color: #767676;
    transition: transform 0.22s;
}

.pb-gw__slot-card--active .pb-gw__slot-chevron { transform: rotate(180deg); }

/* Mini thumbnail inline in compact slot card */
.pb-gw__slot-mini-thumb {
    width: 26px;
    height: 35px;
    border-radius: 2px;
    background: #f0f0ee center/cover no-repeat;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
    margin-left: auto;
}

/* Picker (expanded) */
.pb-gw__slot-picker {
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 14px 16px;
}

/* Chips wrapper with scroll arrows */
.pb-gw__chips-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 10px;
}

.pb-gw__chips-wrapper--full { width: 100%; }

.pb-gw__chips-wrapper .pb-gw__filter-chips {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.pb-gw__chips-arrow {
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    color: #767676 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.15s !important;
    line-height: 1 !important;
}

.pb-gw__chips-arrow:hover { color: #2a2a2a !important; }
.pb-gw__chips-arrow[hidden] { display: none !important; }


.pb-gw__filter-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.pb-gw__filter-chips::-webkit-scrollbar { display: none; }

.pb-gw__filter-chip {
    background: transparent !important;
    border: 1.5px solid rgba(0,0,0,0.2) !important;
    border-radius: 100px !important;
    padding: 3px 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    font-family: 'Hanken Grotesk', Arial, sans-serif !important;
    color: #767676 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease !important;
}

.pb-gw__filter-chip:hover {
    border-color: #c5cbb4 !important;
    color: #5e6a46 !important;
}

.pb-gw__filter-chip--active {
    background: #5e6a46 !important;
    border-color: #5e6a46 !important;
    color: #fff !important;

    &:hover {
        color: #fff !important;
        background: var(--color-primary-dark) !important;
    }
}

.pb-gw__poster-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.pb-gw__poster-item {
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.22s ease, transform 0.22s ease;
}

.pb-gw__poster-item:hover {
    border-color: rgba(143,151,121,0.5);
    transform: translateY(-1px);
}

.pb-gw__poster-item--selected { border-color: #5e6a46; }

.pb-gw__poster-item-img {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f0f0ee;
}

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

.pb-gw__poster-item-info { padding: 6px 8px; }

.pb-gw__poster-item-name {
    display: none;
}

.pb-gw__poster-item-price {
    font-size: 11px;
    font-weight: 700;
    color: #5e6a46;
}

/* --- Canvas drag ---------------------------------------------- */

.pb-gw__canvas-frames.is-draggable { cursor: grab; }
.pb-gw__canvas-frames.is-dragging  { cursor: grabbing !important; }

.pb-gw__drag-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.48);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 13px 5px 10px;
    border-radius: 100px;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pb-gw__drag-hint.is-visible { opacity: 1; }

/* --- Canvas frames -------------------------------------------- */

.pb-gw__frame {
    position: absolute;
    background: #fff;
    box-shadow: 2px 4px 12px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-gw__frame.is-empty {
    background: rgba(255,255,255,0.5);
    border: 1.5px dashed rgba(0,0,0,0.3);
    box-shadow: none;
}

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

.pb-gw__frame-label {
    font-size: 9px;
    color: rgba(0,0,0,0.4);
    text-align: center;
    padding: 4px;
    line-height: 1.3;
}

/* Step 3: frames are click-to-select. Drag still works (guarded in JS). */
.pb-gw__canvas-frames.is-draggable .pb-gw__frame.is-selectable { cursor: pointer; }

.pb-gw__frame.is-selectable:hover {
    outline: 2px solid #5e6a46;
    outline-offset: 1px;
}

/* --- Step 4 summary ------------------------------------------- */

.pb-gw__summary-section { margin-bottom: 20px; }

.pb-gw__summary-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #767676;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.pb-gw__summary-value {
    font-size: 15px;
    font-weight: 600;
    color: #2a2a2a;
}

.pb-gw__summary-value-sub {
    font-size: 13px;
    font-weight: 400;
    color: #767676;
    margin-top: 2px;
}

.pb-gw__summary-poster-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.pb-gw__summary-poster-row:last-child { border-bottom: none; }

.pb-gw__summary-poster-thumb {
    width: 48px;
    height: 64px;
    border-radius: 2px;
    background: #f0f0ee center/cover no-repeat;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.pb-gw__summary-poster-info { flex: 1; min-width: 0; }

.pb-gw__summary-poster-slot {
    font-size: 11px;
    font-weight: 600;
    color: #767676;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 3px;
}

.pb-gw__summary-poster-name {
    font-size: 14px;
    font-weight: 600;
    color: #2a2a2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.pb-gw__summary-poster-size {
    font-size: 12px;
    color: #767676;
    margin-top: 2px;
}

.pb-gw__summary-poster-price {
    font-size: 15px;
    font-weight: 700;
    color: #2a2a2a;
    white-space: nowrap;
    flex-shrink: 0;
}

.pb-gw__summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 28px;
    border-top: 2px solid #2a2a2a;
}

.pb-gw__summary-total span {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2a2a2a;
}

.pb-gw__summary-total strong {
    font-size: 24px;
    font-weight: 700;
    color: #2a2a2a;
}

/* --- Cart feedback -------------------------------------------- */

.pb-gw__cart-success {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(74,124,89,0.12);
    border: 1px solid rgba(74,124,89,0.35);
    border-radius: 5px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #2d5c3a;
}

.pb-gw__cart-success-link {
    margin-left: auto !important;
    color: #2a2a2a !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.pb-gw__cart-error {
    font-size: 13px;
    color: #b91c1c;
    background: rgba(185,28,28,0.06);
    border: 1px solid rgba(185,28,28,0.2);
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

/* --- S4 nav ---------------------------------------------------- */

/* Cart action sits inside the body, flush below the total */
.pb-gw__step-panel-body > .pb-gw__cart-success,
.pb-gw__step-panel-body > .button.single_add_to_cart_button {
    margin-top: 8px;
}

.pb-gw__step-panel-body > .button.single_add_to_cart_button {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

/* Secondary nav (start over + back) separated by existing border-top */
.pb-gw__s4-secondary {
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pb-gw__s4-secondary button.button {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-base);
}

.pb-gw__s4-secondary button.button:hover {
    background-color: var(--color-primary-dark);
}

.pb-gw__s4-secondary button.button.alt {
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    background-color: transparent;
}

.pb-gw__s4-secondary button.button.alt:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.pb-gw__s4-back {
    background: none !important;
    border: none !important;
    font-size: 14px !important;
    color: #767676 !important;
    cursor: pointer !important;
    padding: 0 !important;
    font-family: 'Hanken Grotesk', Arial, sans-serif !important;
    text-align: left !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.pb-gw__s4-back:hover { color: #5e6a46 !important; }

/* --- Confirm overlay ------------------------------------------ */

.pb-gw__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pb-gw__overlay[hidden] { display: none; }

.pb-gw__confirm-dialog {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    padding: 28px;
    animation: pb-gw-slide-up 0.2s ease;
}

@keyframes pb-gw-slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pb-gw__confirm-dialog h3 {
    margin: 0 0 10px;
    font-family: 'Libre Caslon Text', Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    color: #2a2a2a;
}

.pb-gw__confirm-dialog p { font-size: 14px; color: #4c4c4c; margin: 0; }

.pb-gw__confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* --- State helpers -------------------------------------------- */

.pb-gw__empty,
.pb-gw__loading {
    text-align: center;
    padding: 32px 16px;
    font-size: 14px;
    color: #767676;
}

/* --- Responsive ----------------------------------------------- */

@media (max-width: 1023px) {
    .pb-gw__main { grid-template-columns: 1fr; }

    .pb-gw__preview {
        position: static;
        width: 100%;
    }

    .pb-gw__panel {
        border-left: none;
        border-top: 1px solid rgba(0,0,0,0.1);
        padding: 32px 28px 48px;
        min-height: auto;
    }

    .pb-gw__room-grid { grid-template-columns: repeat(3, 1fr); }
    .pb-gw__poster-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Step 3 completion counter (#B) --------------------------- */

.pb-gw__step-counter {
    display: inline-block;
    font-family: 'Hanken Grotesk', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #5e6a46;
    background: rgba(143,151,121,0.1);
    border-radius: 100px;
    padding: 2px 10px;
    margin-left: 10px;
    vertical-align: middle;
}

/* --- Slot picker context header (#A) -------------------------- */

.pb-gw__slot-picker-header {
    font-size: 12px;
    font-weight: 700;
    color: #4c4c4c;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pb-gw__slot-picker-size {
    background: rgba(143,151,121,0.12);
    color: #5e6a46;
    border-radius: 100px;
    padding: 1px 8px;
    font-size: 11px;
    letter-spacing: 0;
    font-weight: 700;
    text-transform: none;
}

/* --- Auto-fill button --------------------------------------- */

.pb-gw__auto-fill-btn {
    display: block;
    width: 100%;
    margin: 0 0 14px !important;
    padding: 12px 16px !important;
    border: 1.5px solid #5e6a46 !important;
    border-radius: 6px;
    background: #5e6a46 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    font-family: 'Hanken Grotesk', Arial, sans-serif !important;
    cursor: pointer !important;
    text-align: center;
    box-shadow: 0 2px 8px rgba(143,151,121,0.35);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.pb-gw__auto-fill-btn:hover {
    background: #7c836a !important;
    border-color: #7c836a !important;
    box-shadow: 0 4px 12px rgba(143,151,121,0.45);
}

.pb-gw__auto-fill-btn:active {
    transform: translateY(1px);
}

/* --- Reset filters button (#C) -------------------------------- */

.pb-gw__filter-reset {
    background: transparent !important;
    border: 1.5px solid rgba(185,28,28,0.25) !important;
    border-radius: 100px !important;
    padding: 5px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: 'Hanken Grotesk', Arial, sans-serif !important;
    color: #b91c1c !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
}

.pb-gw__filter-reset:hover {
    background: rgba(185,28,28,0.06) !important;
    border-color: rgba(185,28,28,0.5) !important;
}

/* --- Remove slot button (#D) ---------------------------------- */

.pb-gw__slot-remove-btn {
    background: none !important;
    border: none !important;
    padding: 4px 6px !important;
    font-size: 13px !important;
    color: #b0b0b0 !important;
    cursor: pointer !important;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s ease !important;
}

.pb-gw__slot-remove-btn:hover { color: #b91c1c !important; }

/* --- Mini-summary strip (#F) ---------------------------------- */

.pb-gw__preview { overflow: visible; } /* allow mini-summary to render below canvas */

.pb-gw__mini-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 13px;
    color: #767676;
}

.pb-gw__mini-summary[hidden] { display: none; }

.pb-gw__mini-slots { font-weight: 500; }

.pb-gw__mini-total {
    font-weight: 700;
    color: #2a2a2a;
}

/* --- Frame insert animation (#I) ------------------------------ */

@keyframes pb-gw-frame-insert {
    0%   { opacity: 0.3; transform: scale(0.88); }
    60%  { transform: scale(1.04); }
    100% { opacity: 1;   transform: scale(1); }
}

.pb-gw__frame.is-inserted {
    animation: pb-gw-frame-insert 0.35s ease-out forwards;
}

/* --- Active frame highlight (#8) ------------------------------ */

@keyframes pb-gw-frame-pulse {
    0%, 100% { box-shadow: 0 0 0 2px #5e6a46, 2px 4px 12px rgba(0,0,0,0.2); }
    50%       { box-shadow: 0 0 0 4px rgba(143,151,121,0.55), 2px 4px 12px rgba(0,0,0,0.2); }
}

.pb-gw__frame.is-active {
    animation: pb-gw-frame-pulse 1.6s ease-in-out infinite;
}

.pb-gw__frame.is-active.is-empty {
    border-color: #5e6a46;
    background: rgba(143,151,121,0.1);
}

/* --- Poster grid scroll fade + count (#12) -------------------- */

.pb-gw__poster-grid-wrap {
    position: relative;
}

.pb-gw__grid-count {
    font-size: 11px;
    color: #a0a0a0;
    text-align: right;
    margin: 6px 0 0;
    padding: 0;
}

/* --- Poster skeleton (#13) ------------------------------------ */

@keyframes pb-gw-shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

.pb-gw__poster-skeleton {
    border-radius: 4px;
    overflow: hidden;
}

.pb-gw__poster-skeleton-img {
    aspect-ratio: 3 / 4;
    background: linear-gradient(90deg, #f0f0ee 25%, #e6e6e3 50%, #f0f0ee 75%);
    background-size: 200% 100%;
    animation: pb-gw-shimmer 1.5s infinite linear;
}

.pb-gw__poster-skeleton-name {
    height: 9px;
    margin: 8px 8px 4px;
    border-radius: 3px;
    background: linear-gradient(90deg, #f0f0ee 25%, #e6e6e3 50%, #f0f0ee 75%);
    background-size: 200% 100%;
    animation: pb-gw-shimmer 1.5s infinite linear;
}

.pb-gw__poster-skeleton-price {
    height: 9px;
    width: 42%;
    margin: 0 8px 8px;
    border-radius: 3px;
    background: linear-gradient(90deg, #f0f0ee 25%, #e6e6e3 50%, #f0f0ee 75%);
    background-size: 200% 100%;
    animation: pb-gw-shimmer 1.5s infinite linear;
}

/* --- Shipping bar (#4) ---------------------------------------- */

.pb-gw__shipping-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(143,151,121,0.07);
    border: 1px solid rgba(143,151,121,0.18);
    border-radius: 5px;
    padding: 12px 16px;
    margin-top: 16px;
    margin-bottom: 20px;
}

.pb-gw__shipping-bar--free {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #3f4830;
    background: rgba(143,151,121,0.12);
    border-color: rgba(143,151,121,0.35);
}

.pb-gw__shipping-bar-text {
    font-size: 13px;
    color: #4c4c4c;
}

.pb-gw__shipping-bar-text strong {
    color: #2a2a2a;
    font-weight: 700;
}

.pb-gw__shipping-bar-track {
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 100px;
    overflow: hidden;
}

.pb-gw__shipping-bar-fill {
    height: 100%;
    background: #5e6a46;
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* --- Step 4 per-poster Zmień button (#9) ---------------------- */

.pb-gw__s4-change-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
    flex-shrink: 0;
    white-space: nowrap;
    align-self: center;
}

/* --- Responsive ----------------------------------------------- */

@media (max-width: 767px) {
    /* Progress bar — show only active step label, others just dots */
    .pb-gw__progress-step {
        flex: 0 0 auto;
        width: 36px;
        height: 44px;
        border-right: none;
        padding: 0;
        overflow: hidden;
    }

    .pb-gw__progress-step--active {
        flex: 1 1 auto;
        width: auto;
        padding: 0 14px;
        border-right: none;
    }

    .pb-gw__progress-step-label { display: none; }

    .pb-gw__progress-step--active .pb-gw__progress-step-label {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Panel — prevent overflow */
    .pb-gw__panel {
        padding: 20px 16px 40px;
        min-width: 0;
        overflow: hidden;
    }

    /* Slot cards — prevent overflow */
    .pb-gw__slot-card,
    .pb-gw__slot-picker,
    .pb-gw__filter-chips {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .pb-gw__slot-search input,
    .pb-gw__slot-card-header {
        max-width: 100%;
        box-sizing: border-box !important;
    }

    .pb-gw__room-grid   { grid-template-columns: repeat(2, 1fr); }
    .pb-gw__poster-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Accessibility helpers ------------------------------------------- */

/* Visually hidden but accessible to screen readers */
.pb-gw__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for custom interactive div/button elements */
.pb-gw__slot-card:focus-visible,
.pb-gw__poster-item:focus-visible,
.pb-gw__layout-card:focus-visible {
    outline: 2px solid #5e6a46;
    outline-offset: 2px;
}

/* Ensure progress steps show focus ring */
.pb-gw__progress-step:focus-visible,
.pb-gw__room-card:focus-visible,
.pb-gw__filter-chip:focus-visible,
.pb-gw__layout-tab:focus-visible {
    outline: 2px solid #5e6a46;
    outline-offset: 2px;
}

/* --- Celebration overlay --------------------------------------------- */

.pb-gw__celebration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: pb-gw-fade-in 0.2s ease;
}

@keyframes pb-gw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pb-gw__celebration-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px 48px;
    max-width: 420px;
    width: calc(100% - 32px);
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: pb-gw-slide-up 0.25s ease;
}

@keyframes pb-gw-slide-up {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.pb-gw__celebration-icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
}

.pb-gw__celebration-title {
    font-size: 22px;
    font-weight: 700;
    color: #2a2a2a;
    margin: 0 0 10px;
}

.pb-gw__celebration-body {
    font-size: 15px;
    color: #666;
    margin: 0 0 28px;
    line-height: 1.55;
}

.pb-gw__celebration-cta {
    background: #5e6a46 !important;
    color: #fff !important;
    border: none !important;
    padding: 13px 28px !important;
    font-size: 15px !important;
    border-radius: 4px !important;
    cursor: pointer;
    width: 100%;
}

/* ===== AR preview ============================================== */

.pb-gw__ar-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

.pb-gw__ar-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pb-gw--no-scroll { overflow: hidden; }

.pb-gw__ar-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: min(720px, 100%);
    max-height: 90dvh;
    display: flex; flex-direction: column;
    overflow: hidden;
}

.pb-gw__ar-close {
    position: absolute; top: 8px; right: 8px;
    width: 36px; height: 36px;
    border: none; background: rgba(255,255,255,0.85);
    border-radius: 50%; font-size: 18px; cursor: pointer;
    z-index: 2;
}

.pb-gw__ar-body {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 320px;
    gap: 14px;
}

.pb-gw__ar-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e5e7eb; border-top-color: #be185d;
    border-radius: 50%;
    animation: pb-gw-ar-spin 0.9s linear infinite;
}
@keyframes pb-gw-ar-spin { to { transform: rotate(360deg); } }

.pb-gw__ar-status, .pb-gw__ar-hint {
    margin: 0; font-size: 0.9rem; color: #6b7280; text-align: center;
}
.pb-gw__ar-error { margin: 0; color: #b91c1c; text-align: center; }

.pb-gw__ar-viewer {
    width: 100%;
    height: min(60dvh, 480px);
    background: #f8f8f8;
    border-radius: 8px;
}

.pb-gw__ar-launch {
    position: absolute; bottom: 16px; left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    border: none; border-radius: 999px;
    background: #be185d; color: #fff;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    white-space: nowrap;
}
.pb-gw__ar-launch:hover { background: #9d174d; }
