/* =============================================
   FBT – Frequently Bought Together
   WC Bundle Deal – Frontend Styles
   ============================================= */

/* WRAP */
.fbt-wrap {
    border-radius: 20px;
    background: #fff;
}

.fbt-list .fbt-content {
    gap: 2px;
}

.fbt-list .fbt-meta {
    font-size: 13px;
}

.fbt-list .fbt-edit {
    margin: 0;
}

/* TITLE */
.fbt-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #140d5c;
}

/* GRID */
.fbt-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 10px;
    align-items: start;
}

/* MAIN PRODUCT */
.fbt-main {
    border: 2px solid #23176d;
    border-radius: 16px;
    padding: 14px;
    position: relative;
    background: #fff;
}

/* BADGE */
.fbt-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #23176d;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    padding: 8px 13px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* PRODUCT */
.fbt-product {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

/* CHECKBOX */
.fbt-check {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.fbt-check input {
    width: 18px;
    height: 18px;
    accent-color: #23176d;
}

/* IMAGE */
.fbt-image {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f3f3;
}

.fbt-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* CONTENT */
.fbt-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* NAME */
.fbt-name {
    font-size: 15px;
    line-height: 1.45;
    font-weight: 700;
    color: #140d5c;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 65px;
}

/* META */
.fbt-meta {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* VARIANT */
.fbt-variant {
    font-size: 13px;
    color: #140d5c;
    font-weight: 600;
}

/* PRICE */
.fbt-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.fbt-sale {
    font-size: 18px;
    font-weight: 700;
    color: #140d5c;
}

.fbt-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
}

/* RIGHT LIST */
.fbt-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ITEM */
.fbt-item {
    border: 1px solid #d6d6d6;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    position: relative;
    transition: .25s;
}

.fbt-item:hover {
    border-color: #23176d;
    transform: translateY(-2px);
}

.fbt-item--selected {
    border-color: #23176d;
}

.fbt-item[data-fbt-selected="0"] {
    opacity: .72;
    border-color: #d6d6d6;
}

.fbt-item[data-fbt-selected="0"]:hover {
    transform: none;
}

/* SMALL CARD TITLE */
.fbt-item .fbt-name {
    font-size: 14px;
    font-size: 13px;
    min-height: unset !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* SMALL CARD PRICE */
.fbt-item .fbt-sale {
    font-size: 16px;
}

/* EDIT BUTTON */
.fbt-edit {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #d8d8d8;
    font-size: 13px;
    font-weight: 600;
    color: #23176d;
    cursor: pointer;
    transition: .2s;
}

.fbt-edit:hover {
    background: #23176d;
    color: #fff;
}

/* BOTTOM */
.fbt-bottom {
    margin-top: 12px;
}

/* BUTTON */
.fbt-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 6px;
    background: #f56565;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: .25s;
    box-shadow: 0 8px 20px rgba(245, 101, 101, .25);
    margin: 0;
}

.fbt-btn:hover {
    opacity: .9;
    transform: translateY(-2px);
}

/* MOBILE */
@media(max-width:991px) {

    .fbt-grid {
        grid-template-columns: 1fr;
    }

    .fbt-list {
        grid-template-columns: 1fr;
    }

}

.fbt-btn:hover {
    background: #333;
}

.fbt-btn:active {
    transform: scale(.98);
}

.fbt-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* =============================================
   FBT Variant Popup / Modal
   ============================================= */
.fbt-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.fbt-popup-overlay.fbt-popup--open {
    display: flex;
}

.fbt-popup {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    animation: fbtPopupIn .22s ease;
}

@keyframes fbtPopupIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fbt-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .15s;
    margin: 0;
}

.fbt-popup-close:hover {
    background: #f0f0f0;
}

.fbt-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin-bottom: 16px;
    padding-right: 30px;
    line-height: 1.4;
}

/* Attribute group */
.fbt-attr-group {
    margin-bottom: 18px;
}

.fbt-attr-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.fbt-attr-label span {
    font-weight: 400;
    color: #888;
}

.fbt-attr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fbt-attr-option {
    padding: 6px 14px;
    border: 1.5px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s, color .15s;
    user-select: none;
}

.fbt-attr-option:hover {
    border-color: #999;
    background: #f7f7f7;
}

.fbt-attr-option.fbt-attr-option--selected {
    border-color: #111;
    background: #111;
    color: #fff;
}

.fbt-attr-option.fbt-attr-option--disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variant price inside popup */
.fbt-popup-price {
    margin: 14px 0;
    font-size: 15px;
    font-weight: 700;
    color: #e53935;
}

/* Confirm button */
.fbt-popup-confirm {
    width: 100%;
    padding: 12px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: background .2s;
    margin: 0;
}

.fbt-popup-confirm:hover {
    background: #333;
}

.fbt-popup-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 680px) {
    .fbt-grid {
        flex-direction: column;
    }

    .fbt-main {
        width: 100%;
        border-right: none;
        border-bottom: 2px dashed #e0e0e0;
        padding-right: 0;
        padding-bottom: 16px;
        margin-right: 0;
        margin-bottom: 16px;
    }
}