/**
 * WIZ v2: Product By SKU ID — layout CSS only.
 *
 * Vertical (top-to-bottom) stack of horizontal product cards. Mirrors the
 * ViewSimilar drawer body layout. Card / atom styling lives in atoms.
 */

.wiz-plbi {
    width: 100%;
    box-sizing: border-box;
}

/* ========================================================
   Header — product count + Add All to Cart
   ======================================================== */
.wiz-plbi__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 16px;
    flex-wrap: wrap;
}

.wiz-plbi__count {
    margin: 0;
    font-weight: 500;
    color: var(--wiz-color-text, #333);
    font-size: 1.6rem;
}

.wiz-plbi__count-spacer {
    flex: 1;
}

.wiz-plbi__add-all-btn {
    cursor: pointer;
    border: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 10px 20px;
    font-family: var(--wiz-font-family);
    color: var(--primary-text);
    background-color: var(--primary);
}

.wiz-plbi__add-all-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.wiz-plbi__add-all-btn:disabled,
.wiz-plbi__add-all-btn.loading {
    cursor: not-allowed;
    opacity: 0.6;
}

.wiz-plbi__add-all-btn.loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wiz-plbi-spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes wiz-plbi-spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   Container — vertical column of cards (top → down)
   ======================================================== */
.wiz-plbi__container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: fit-content;
    box-sizing: border-box;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

/* Each card laid out as image-left / body-right (matches ViewSimilar) */
.wiz-plbi__container .wiz-grid__card {
    flex-direction: row;
    gap: 12px;
    align-items: stretch;
}

.wiz-plbi__container .wiz-grid__card-image-wrap {
    width: 120px;
    flex: 0 0 120px;
}

.wiz-plbi__container .wiz-grid__card-body {
    flex: 1;
    min-width: 0;
}

/* Wrapper inserted by wiz_v2_render_cards — let it occupy full row */
.wiz-plbi__container .product-listing-card-wrapper {
    width: 100%;
}

/* ========================================================
   Empty state
   ======================================================== */
.wiz-plbi--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    gap: 12px;
    color: var(--wiz-color-text-muted, #666);
}

.wiz-plbi__empty-img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.wiz-plbi__empty-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.wiz-plbi__empty-text {
    padding: 20px;
    text-align: center;
    color: #999;
}

/* ========================================================
   Mobile — keep image proportional
   ======================================================== */
@media (max-width: 480px) {
    .wiz-plbi__container .wiz-grid__card-image-wrap {
        width: 96px;
        flex: 0 0 96px;
    }
}
