/**
 * FBT Upsell Frontend Styles
 * Refined to match reference image UI
 */

/* Main Container */
.fbt-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    /* Added 5px margin from Add to Cart */
}

/* Title */
.fbt-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 25px 0;
    padding: 0;
    color: #000000;
    font-family: 'Inter', 'Roboto', sans-serif;
    white-space: nowrap;
}

/* Images Row */
.fbt-images-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.fbt-image-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* Remove padding for full image */
    border: none;
    /* Remove border */
    border-radius: 0;
    /* Remove border radius */
    background: transparent;
    /* Remove background */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fbt-image-link {
    display: block;
    overflow: hidden;
    border-radius: 4px;
}

.fbt-image-link img {
    transition: transform 0.3s ease;
    display: block;
}

.fbt-image-link:hover img {
    transform: scale(1.2);
}

.fbt-image-wrapper img {
    display: block;
    object-fit: cover;
    /* Changed to cover for full display */
    border-radius: 0;
    /* Remove border radius */
    transition: transform 0.3s ease;
}

.fbt-image-item:hover {
    transform: translateY(-2px);
}

.fbt-image-item:hover img {
    transform: scale(1.02);
    /* Subtle scale on hover */
}

.fbt-image-item.unchecked {
    opacity: 0.4;
    filter: grayscale(100%);
}

.fbt-plus {
    font-size: 18px;
    font-weight: 400;
    color: #333;
    margin: 0 5px;
}

/* Total Price & Button Area */
.fbt-total-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 5px 0;
    /* 5px padding top/bottom */
}

.fbt-total {
    font-size: 20px;
    color: #000;
}

.fbt-total-label {
    font-weight: 700;
    margin-right: 10px;
}

.fbt-total-price {
    font-weight: 700;
    color: #000;
}

.fbt-total-price .fbt-old-total {
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 0.85em;
    margin-right: 8px;
}

.fbt-total-price .fbt-new-total {
    color: #000;
    text-decoration: underline;
}

/* Original Price with strikethrough */
.fbt-original-price {
    color: #9ca3af;
    font-weight: 400;
    margin-right: 8px;
}

.fbt-original-price del {
    text-decoration: line-through;
}

.fbt-original-price .woocommerce-Price-amount {
    font-size: 0.9em;
}

/* Discount Badge */
.fbt-discount-badge {
    background: #ef4444;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
}

/* Add to Cart Button */
.fbt-add-to-cart {
    display: block;
    padding: 18px 50px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff !important;
    background: #000;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.fbt-add-to-cart:hover {
    opacity: 0.85;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.fbt-add-to-cart:active {
    transform: translateY(0);
}

.fbt-add-to-cart:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Products List */
.fbt-products-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: none;
    /* Removed border */
    padding-top: 7px;
    /* Reduced to 7px */
}

.fbt-product-row {
    display: flex;
    flex-direction: column;
    padding: 7px 0;
    /* Reduced to 7px */
    gap: 10px;
    border-bottom: none;
    /* Removed border */
}

.fbt-product-row:last-child {
    border-bottom: none;
}

/* Row Layout - 2 Rows: Name on top, Dropdowns+Price below */
.fbt-row-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.fbt-row-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Checkbox Alignment - Row 1 */
.fbt-product-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fbt-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #000;
    cursor: pointer;
    flex-shrink: 0;
}

.fbt-product-name {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    letter-spacing: 0.5px;
    cursor: pointer;
    line-height: 1.3;
    text-transform: uppercase;
}

/* Variations - Row 2 with Dropdowns */
.fbt-product-variations {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.fbt-variation-select,
.fbt-wcpa-select,
.fbt-spo-select {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23374151' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fbt-variation-select:hover,
.fbt-wcpa-select:hover {
    border-color: #000;
    background-color: #f9fafb;
}

.fbt-variation-select:focus,
.fbt-wcpa-select:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Individual Product Price */
.fbt-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    text-align: right;
    min-width: 80px;
    flex-shrink: 0;
    white-space: nowrap;
}

.fbt-product-price del {
    color: #9ca3af;
    font-weight: 400;
    margin-right: 5px;
    font-size: 14px;
}

.fbt-product-price ins {
    text-decoration: none;
    color: #dc2626;
}

/* Responsive */
@media (max-width: 991px) {
    .fbt-row-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .fbt-product-row {
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .fbt-section {
        padding: 25px;
        border-radius: 0;
    }

    .fbt-plus {
        display: none;
    }

    .fbt-images-row {
        justify-content: center;
        gap: 15px;
    }

    .fbt-add-to-cart {
        width: 100%;
        text-align: center;
    }

    .fbt-product-row {
        flex-direction: column;
    }

    .fbt-product-price {
        min-width: unset;
        width: 100%;
        text-align: left;
        margin-top: 5px;
    }

    .fbt-product-variations {
        width: 100%;
        flex-wrap: nowrap;
    }

    .fbt-variation-select,
    .fbt-wcpa-select {
        flex: 1 1 auto;
        min-width: 80px;
        max-width: calc((100% - 80px - 16px) / 3);
        font-size: 11px;
        padding: 6px 22px 6px 8px;
        background-size: 12px;
        background-position: right 5px center;
    }

    .fbt-product-price {
        font-size: 12px;
        min-width: 70px;
    }
}