/**
 * Merchant Powerpack - Product Bundles (frontend)
 *
 * All visual styles consume CSS variables emitted by Runtime::render_global_styles
 * so the Styling tab presets control bundle appearance. Hardcoded fallbacks
 * are present on every var so the module renders cleanly even when the
 * global style block is absent (e.g. headless or AMP contexts).
 */

.mpp-bundles-wrapper {
    margin-top: 30px;
    margin-bottom: 20px;
    border-top: 1px solid var(--merchant-powerpack-border, #eeeeee);
    padding-top: 20px;
    color: var(--merchant-powerpack-text, inherit);
}

.mpp-bundles-wrapper > h3 {
    margin-bottom: 15px;
}

.mpp-bundles-grid {
    display: grid;
    gap: 15px;
}

.mpp-bundle-card {
    position: relative;
    border: 2px solid var(--merchant-powerpack-bundle-border, #e5e7eb);
    background: var(--merchant-powerpack-bundle-bg, #ffffff);
    color: var(--merchant-powerpack-text, inherit);
    border-radius: var(--merchant-powerpack-radius, 8px);
    padding: 15px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.mpp-bundle-card.active {
    border-color: var(--merchant-powerpack-bundle-active, #2563eb);
}

.mpp-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--merchant-powerpack-bundle-badge, #2563eb);
    color: #ffffff;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mpp-bundle-header {
    display: flex;
    align-items: center;
}

.mpp-bundle-header > div:first-child {
    margin-right: 15px;
}

.mpp-bundle-header > div:nth-child(2) {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.mpp-bundle-thumbs {
    display: flex;
    gap: 5px;
    margin-right: 15px;
}

.mpp-bundle-thumbs img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--merchant-powerpack-border, #dddddd);
}

.mpp-bundle-info strong {
    font-size: 1.1em;
    display: block;
    color: var(--merchant-powerpack-bundle-heading, #111827);
}

.mpp-bundle-info .mpp-price del {
    opacity: 0.6;
    font-size: 0.9em;
}

.mpp-bundle-info .mpp-price ins {
    text-decoration: none;
    font-weight: bold;
    color: var(--merchant-powerpack-bundle-price, #059669);
    font-size: 1.2em;
    margin-left: 5px;
}

.mpp-bundle-options {
    margin-top: 15px;
    padding-left: 30px;
}

.mpp-bundle-item-row {
    margin-top: 10px;
    border-top: 1px dashed var(--merchant-powerpack-border, #eeeeee);
    padding-top: 10px;
}

.mpp-bundle-item-row > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.mpp-bundle-item-row img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
}

.mpp-bundle-item-row a {
    text-decoration: none;
    color: inherit;
}

.mpp-bundle-item-row .mpp-bundle-item-price {
    font-size: 0.9em;
    color: var(--merchant-powerpack-text, #555555);
    opacity: 0.85;
}

.mpp-bundle-attr {
    margin-top: 5px;
    margin-left: 40px;
}

.mpp-bundle-attr label {
    font-size: 0.85em;
    display: block;
}

.mpp-bundle-attr .mpp-bundle-select {
    width: 100%;
    font-size: 0.9em;
}

.mpp-bundle-add-row {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#mpp-bundle-qty-wrapper input[type="number"] {
    width: 70px;
    text-align: center;
}

#merchant_powerpack_add_bundle {
    flex-grow: 1;
    text-align: center;
    background-color: var(--merchant-powerpack-primary, #2563eb);
    border-color: var(--merchant-powerpack-primary, #2563eb);
    color: #ffffff;
    border-radius: var(--merchant-powerpack-radius, 8px);
}

#merchant_powerpack_add_bundle:hover {
    opacity: 0.92;
}

.mpp-bundle-attr .mpp-bundle-select.error,
.mpp-bundle-item-row .error {
    border-color: var(--merchant-powerpack-danger, #dc2626);
}
