/**
 * BundlePress — Buy X Get Y (SSR) Styles
 */

/* ── Wrapper ── */
.bundlepress-bxgy-wrapper {
    font-family: inherit;
    margin: 24px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    transition: background 0.2s;
}

/* ── Header ── */
.bp-bxgy-header {
    padding: 16px 20px 12px;
}

.bp-bxgy-heading {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
    color: var(--bp-bxgy-header-color, #805AD5);
    line-height: 1.2;
}

/* ── Products row ── */
.bp-bxgy-products-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}

/* ── Section label ── */
.bp-bxgy-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 6px;
}

.bp-bxgy-section-label.is-buy {
    color: var(--bp-bxgy-section-title-color, #718096);
}
.bp-bxgy-section-label.is-get {
    color: var(--bp-bxgy-free-badge-bg, #38A169);
}

/* ── Cards wrapper ── */
.bp-bxgy-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Arrow divider ── */
.bp-bxgy-arrow {
    font-size: 20px;
    color: var(--bp-bxgy-header-color, #805AD5);
    opacity: 0.6;
    align-self: center;
    padding-top: 26px;
    flex-shrink: 0;
}

/* ── Product card ── */
.bp-bxgy-card {
    position: relative;
    width: 100px;
    min-width: 100px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid var(--bp-bxgy-item-border, #E2E8F0);
    background: var(--bp-bxgy-item-bg, #FFFFFF);
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.bp-bxgy-card.is-free {
    border-color: var(--bp-bxgy-free-item-border, #9AE6B4);
    background: var(--bp-bxgy-free-item-bg, #F0FFF4);
}

/* ── Card badge (top-right) ── */
.bp-bxgy-card-badge {
    position: absolute;
    top: -8px;
    right: -6px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    background: var(--bp-bxgy-free-badge-bg, #38A169);
}

.bp-bxgy-card-badge.is-discount {
    background: #ED8936;
    left: -6px;
    right: auto;
}

/* ── Card quantity badge (top-right) ── */
.bp-bxgy-card-qty-badge {
    position: absolute;
    top: -8px;
    right: -6px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: var(--bp-bxgy-header-color, #805AD5);
    z-index: 2;
}

/* ── Card image ── */
.bp-bxgy-card-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.bp-bxgy-card-img-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* ── Card name ── */
.bp-bxgy-card-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bp-bxgy-item-name-color, #2D3748);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Card price ── */
.bp-bxgy-card-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--bp-bxgy-item-price-color, #2D3748);
    margin: 0;
}

.bp-bxgy-card-price.is-free-price {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.bp-bxgy-card-price-original {
    font-size: 12px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.bp-bxgy-card-price-free {
    font-size: 13px;
    font-weight: 700;
    color: var(--bp-bxgy-free-badge-bg, #38A169);
}

/* ── Variation select ── */
.bp-bxgy-variation-select {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    padding: 4px 6px;
    background: #fff;
    cursor: pointer;
    margin-top: 2px;
    height: 32px;
    min-height: 32px;
}

.bp-bxgy-variation-select:hover {
    border-color: #805AD5;
}

.bp-bxgy-variation-select:focus {
    outline: none;
    border-color: #805AD5;
    box-shadow: 0 0 0 2px rgba(128,90,213,0.2);
}

/* ── Free shipping note ── */
.bp-bxgy-shipping-note {
    font-size: 13px;
    color: #3182CE;
    margin: 0;
    align-self: center;
    padding-top: 26px;
}

/* ── Action button ── */
.bp-bxgy-footer {
    padding: 0 20px 20px;
}

.bp-bxgy-btn {
    display: block;
    width: 100%;
    height: 44px;
    background: var(--bp-bxgy-button-bg, #805AD5);
    color: var(--bp-bxgy-button-color, #FFFFFF);
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bp-bxgy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    filter: brightness(1.08);
}

.bp-bxgy-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bp-bxgy-btn.is-done {
    background: #38A169;
    color: #fff;
}

/* ── Spinner ── */
.bp-bxgy-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bp-bxgy-spin 0.7s linear infinite;
}

@keyframes bp-bxgy-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .bp-bxgy-products-row {
        flex-direction: column;
        align-items: center;
    }
    .bp-bxgy-arrow {
        transform: rotate(90deg);
        padding-top: 0;
    }
}
