/* ===============================
   Sahaj Woo Bundle Suggestions

   Deliberately restrained: this block sits inside someone else's theme, so it
   inherits type and colour rather than importing its own. Only spacing,
   structure and state are defined here.
================================ */

.swbs-block {
    --swbs-line: rgba(0, 0, 0, .12);
    --swbs-muted: rgba(0, 0, 0, .6);

    margin: 24px 0;
    padding: 16px 18px;
    border: 1px solid var(--swbs-line);
    border-radius: 10px;
}

.swbs-head {
    margin-bottom: 12px;
}

.swbs-title {
    margin: 0 0 2px;
    font-size: 1em;
    line-height: 1.3;
}

.swbs-sub {
    margin: 0;
    font-size: .8em;
    color: var(--swbs-muted);
}

.swbs-sub:empty {
    display: none;
}

/* -------------------------------
   Product list

   Cards are a fixed width (--swbs-thumb, set inline from the settings) and
   wrap. A stretching grid is what blew the covers up to half the viewport.
-------------------------------- */

.swbs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.swbs-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: var(--swbs-thumb, 96px);
    margin: 0;
    padding: 0;
}

.swbs-item-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
}

.swbs-item-thumb {
    display: block;
    line-height: 0;
}

/* Default: each cover keeps its own proportions. No object-fit, no
   max-height — nothing is ever cropped. The !important guards against theme
   rules that force product images to width:100% of their container. */
.swbs-item-thumb img {
    display: block;
    width: 100% !important;
    max-width: var(--swbs-thumb, 110px) !important;
    height: auto !important;
    border-radius: 4px;
}

/* Fixed height set in the settings: give every card the same box and fit the
   cover inside it. `contain` letterboxes; it does not crop. */
.swbs-block.has-fixed-height .swbs-item-thumb {
    height: var(--swbs-thumb-h);
    display: flex;
    align-items: center;
    justify-content: center;
}

.swbs-block.has-fixed-height .swbs-item-thumb img {
    width: auto !important;
    height: 100% !important;
    max-height: var(--swbs-thumb-h) !important;
    max-width: 100% !important;
    object-fit: contain;
}

.swbs-item-name {
    font-size: .8em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.swbs-item-price {
    font-size: .8em;
    color: var(--swbs-muted);
}

.swbs-item-price del {
    opacity: .6;
}

.swbs-block .swbs-item .swbs-add {
    margin-top: auto;
    width: 100%;
    padding: 5px 6px;
    font-size: .72em;
    line-height: 1.4;
    min-height: 0;
    height: auto;
    letter-spacing: normal;
}

.swbs-block .swbs-foot .swbs-add {
    padding: 7px 14px;
    font-size: .8em;
    line-height: 1.4;
    min-height: 0;
    height: auto;
    width: auto;
    letter-spacing: normal;
}

/* -------------------------------
   Add-all
-------------------------------- */

.swbs-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--swbs-line);
}

.swbs-anchor {
    display: none;
}

/* -------------------------------
   Alignment
-------------------------------- */

.swbs-block.is-center {
    text-align: center;
}

.swbs-block.is-center .swbs-list {
    justify-content: center;
}

.swbs-block.is-center .swbs-item-link {
    align-items: center;
}

.swbs-block.is-center .swbs-foot {
    display: flex;
    justify-content: center;
}

/* The saving sits on its own line inside the button, quieter than the label */
.swbs-add-all-saving {
    display: block;
    font-size: .8em;
    font-weight: 400;
    opacity: .85;
    text-transform: none;
    letter-spacing: normal;
}

.swbs-add-all-saving .amount {
    font-weight: 700;
}

.swbs-sub strong {
    font-weight: 700;
}

.swbs-add.loading {
    opacity: .6;
    cursor: progress;
}

.swbs-add[disabled] {
    cursor: not-allowed;
}

/* -------------------------------
   Status message
-------------------------------- */

.swbs-message {
    margin-top: 12px;
    font-size: .875em;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity .2s ease, max-height .2s ease;
}

.swbs-message.is-visible {
    opacity: 1;
    max-height: 4em;
}

.swbs-message.is-error {
    color: #b32d2e;
}

/* -------------------------------
   Cart page refresh state
-------------------------------- */

.woocommerce-cart-form.swbs-refreshing {
    opacity: .55;
    pointer-events: none;
}

/* -------------------------------
   Mini / slide cart
-------------------------------- */

.swbs-mini {
    margin: 14px 0;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, .12);
    font-size: .875em;
}

.swbs-mini-nudge {
    margin: 0 0 10px;
    font-weight: 600;
}

.swbs-mini-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.swbs-mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
}

.swbs-mini-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.swbs-mini-item img {
    width: 40px;
    height: auto;
    flex: 0 0 40px;
    border-radius: 4px;
}

.swbs-mini-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.swbs-mini-add {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 18px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.swbs-mini-add:hover,
.swbs-mini-add:focus-visible {
    background: rgba(0, 0, 0, .06);
}

/* -------------------------------
   Dark themes
-------------------------------- */

@media (prefers-color-scheme: dark) {
    .swbs-block {
        --swbs-line: rgba(255, 255, 255, .18);
        --swbs-muted: rgba(255, 255, 255, .65);
    }
}

/* -------------------------------
   Motion
-------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .swbs-message { transition: none; }
}

/* -------------------------------
   Narrow screens
-------------------------------- */

@media (max-width: 480px) {
    .swbs-block {
        padding: 14px;
    }

    .swbs-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .swbs-item {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    /* Centring an overflowing scroll row can make the first card
       unreachable, so the strip always starts at the left. */
    .swbs-block.is-center .swbs-list {
        justify-content: flex-start;
    }

    .swbs-foot .swbs-add {
        width: 100%;
    }
    .swbs-list {
        gap: 12px;
    }
}
