/**
 * MN Bundled Product — Frontend Styles
 */

/* ── Bundle List Container ── */
.mnbp-bundle-list {
    margin: 20px 0;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.mnbp-bundle-list__title {
    margin: 0 0 16px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

/* ── Bundle Items ── */
.mnbp-bundle-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mnbp-bundle-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    transition: opacity 0.2s;
}

.mnbp-bundle-item:last-child {
    border-bottom: none;
}

.mnbp-bundle-item + .mnbp-bundle-item {
    border-top-color: #e5e7eb;
}

/* Out of stock item */
.mnbp-bundle-item--oos {
    opacity: 0.55;
}

/* ── Thumbnail ── */
.mnbp-bundle-item__thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 6px;
}

.mnbp-bundle-item__thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.mnbp-bundle-item__thumb a {
    display: block;
    line-height: 0;
}

/* ── Info ── */
.mnbp-bundle-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mnbp-bundle-item__name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s;
}

a.mnbp-bundle-item__name:hover {
    color: #2563eb;
}

/* Suggestions section wrapper */
.mnbp-bundle-item__suggestions-wrap {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Label above suggestion chips */
.mnbp-bundle-item__suggestions-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 2px;
}

/* Suggestion chips row */
.mnbp-bundle-item__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Each suggestion chip — vertical layout: name / price / button */
.mnbp-bundle-item__subtitle {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    font-size: 11px;
    font-style: normal;
    line-height: 1.4;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 6px 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.mnbp-bundle-item__subtitle.mnbp-subtitle--active {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
    background: #fde68a;
}

/* Suggestion product name link */
.mnbp-sug-name a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.mnbp-sug-name a:hover {
    text-decoration: underline;
}

/* Suggestion price */
.mnbp-sug-price {
    color: #b45309;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

.mnbp-sug-price del {
    color: #9ca3af;
    font-weight: 400;
}

.mnbp-sug-price ins {
    text-decoration: none;
}

/* "Pakai ini" button — sits below name+price as its own row */
.mnbp-sug-use-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    color: #fff;
    background: #d97706;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    align-self: stretch;
    text-align: center;
    transition: background 0.15s;
}

.mnbp-sug-use-btn:hover {
    background: #b45309;
}

/* ── Variation attribute selects ── */
.mnbp-bundle-item__variations {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mnbp-variation-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mnbp-variation-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    min-width: 48px;
    flex-shrink: 0;
}

.mnbp-variation-select {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    max-width: 160px;
    transition: border-color 0.15s;
}

.mnbp-variation-select:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15);
}

/* Inline stock badge shown after variation is resolved */
.mnbp-variation-stock {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    margin-top: 2px;
}

.mnbp-variation-stock.mnbp-stock--in  { background: #d1fae5; color: #065f46; }
.mnbp-variation-stock.mnbp-stock--out { background: #fee2e2; color: #991b1b; }

/* Add-to-cart controls visibility */
.mnbp-atc-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mnbp-atc--hidden {
    display: none !important;
}

/* Undo link */
.mnbp-sug-undo {
    display: inline-block;
    font-size: 11px;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 2px;
}

.mnbp-sug-undo:hover {
    color: #374151;
}

/* "Pilih opsi" button — same base as "Pakai ini" but different color */
.mnbp-sug-choose-btn {
    background: #2563eb;
}

.mnbp-sug-choose-btn:hover {
    background: #1d4ed8;
}

/* ── Quickview variation-select mode ── */
.mnbp-qv-variations {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mnbp-qv-variation-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mnbp-qv-variation-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    min-width: 60px;
    flex-shrink: 0;
}

.mnbp-qv-variation-select {
    flex: 1;
    font-size: 13px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    transition: border-color 0.15s;
}

.mnbp-qv-variation-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.mnbp-qv-variation-stock {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
}

.mnbp-qv-variation-stock.mnbp-stock--in  { background: #d1fae5; color: #065f46; }
.mnbp-qv-variation-stock.mnbp-stock--out { background: #fee2e2; color: #991b1b; }

/* Quickview action row: qty + Add to bundle */
.mnbp-qv-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.mnbp-qv-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    overflow: hidden;
}

.mnbp-qv-qty-btn {
    background: #f9fafb;
    border: none;
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    transition: background 0.15s;
}

.mnbp-qv-qty-btn:hover {
    background: #f3f4f6;
}

.mnbp-qv-qty-input {
    width: 40px;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    text-align: center;
    font-size: 13px;
    padding: 6px 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.mnbp-qv-qty-input::-webkit-outer-spin-button,
.mnbp-qv-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mnbp-qv-add-to-bundle {
    flex: 1;
    min-width: 0;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}

.mnbp-qv-add-to-bundle:hover:not(:disabled) {
    background: #15803d;
}

.mnbp-qv-add-to-bundle:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.mnbp-qv-variation-notice {
    font-size: 12px;
    color: #b91c1c;
    margin: 4px 0 0;
    min-height: 1em;
}

/* ── Quickview Modal ── */
.mnbp-qv-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mnbp-qv-modal[hidden] {
    display: none;
}

.mnbp-qv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.mnbp-qv-modal__box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: min(520px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
}

.mnbp-qv-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.mnbp-qv-modal__close:hover {
    color: #111;
    background: #f3f4f6;
}

/* Quickview product layout */
.mnbp-qv-product {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.mnbp-qv-product__image {
    flex-shrink: 0;
    width: 160px;
}

.mnbp-qv-product__image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.mnbp-qv-product__body {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mnbp-qv-product__name {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.mnbp-qv-product__name a {
    color: #111;
    text-decoration: none;
}

.mnbp-qv-product__name a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.mnbp-qv-product__price {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.mnbp-qv-product__stock {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.mnbp-qv-product__stock.mnbp-stock--in  { background: #d1fae5; color: #065f46; }
.mnbp-qv-product__stock.mnbp-stock--out { background: #fee2e2; color: #991b1b; }

.mnbp-qv-product__desc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

.mnbp-qv-product__link {
    display: inline-block;
    font-size: 12px;
    padding: 6px 14px;
    margin-top: 4px;
    align-self: flex-start;
}

.mnbp-qv-loading {
    text-align: center;
    padding: 32px;
    color: #6b7280;
    font-size: 13px;
}

.mnbp-qv-error {
    text-align: center;
    padding: 24px;
    color: #b91c1c;
    font-size: 13px;
}

body.mnbp-qv-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .mnbp-qv-product {
        flex-direction: column;
    }
    .mnbp-qv-product__image {
        width: 100%;
    }
}

/* ── Right column (price + stock) ── */
.mnbp-bundle-item__right {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.mnbp-bundle-item__price {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}

.mnbp-bundle-item__price del {
    color: #9ca3af;
    font-weight: 400;
}

.mnbp-bundle-item__price ins {
    text-decoration: none;
    color: #dc2626;
}

.mnbp-bundle-item__stock {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mnbp-stock--in {
    color: #16a34a;
}

.mnbp-stock--out {
    color: #dc2626;
}

/* ── Savings Badge ── */
.mnbp-bundle-savings {
    margin-top: 16px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    color: #065f46;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ── Elementor Editor Notice ── */
.mnbp-editor-notice {
    padding: 20px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    text-align: center;
    color: #856404;
}

.mnbp-editor-notice p {
    margin: 0;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .mnbp-bundle-list {
        padding: 14px;
    }

    .mnbp-bundle-item {
        gap: 10px;
    }

    .mnbp-bundle-item__thumb {
        width: 48px;
        height: 48px;
    }

    .mnbp-bundle-item__thumb img {
        width: 48px;
        height: 48px;
    }

    .mnbp-bundle-item__name {
        font-size: 13px;
    }

    .mnbp-bundle-item__price {
        font-size: 13px;
    }
}
