/**
 * FBT (Frequently Bought Together) Widget Styles
 *
 * @package StoredashCheckout
 * @version 2.0.0
 */

/* Container */
.storedash-fbt-bundle {
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
}

.storedash-fbt-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Compact List Layout */
.storedash-fbt-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.storedash-fbt-compact-item {
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 12px 8px;
    transition: all 0.2s ease;
    position: relative;
}

/* Divider above each item (including first) */
body .storedash-fbt-compact-item::before,
.elementor-widget-storedash-fbt .storedash-fbt-compact-item::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--fbt-divider-thickness, 1px);
    background: var(--fbt-divider-color, #e5e7eb);
    z-index: 0;
}

/* Divider below last item */
body .storedash-fbt-compact-item:last-child::after,
.elementor-widget-storedash-fbt .storedash-fbt-compact-item:last-child::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--fbt-divider-thickness, 1px);
    background: var(--fbt-divider-color, #e5e7eb);
    z-index: 0;
}

body .storedash-fbt-compact-item:hover,
.elementor-widget-storedash-fbt .storedash-fbt-compact-item:hover {
    background: #f9fafb;
}

body .storedash-fbt-compact-label,
.elementor-widget-storedash-fbt .storedash-fbt-compact-label {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px;
    cursor: pointer;
    margin: 0;
    text-align: left !important;
}

/* Checkbox */
.storedash-fbt-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.storedash-fbt-compact-checkbox-visual {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.storedash-fbt-checkbox:checked + .storedash-fbt-compact-checkbox-visual {
    background: #3b82f6;
    border-color: #3b82f6;
}

.storedash-fbt-checkbox:checked + .storedash-fbt-compact-checkbox-visual::after {
    content: "";
    position: absolute;
    left: var(--checkmark-left, 30%);
    top: var(--checkmark-top, 10%);
    width: var(--checkmark-width, 25%);
    height: var(--checkmark-height, 50%);
    border: solid white;
    border-width: 0 var(--checkmark-thickness, 2px) var(--checkmark-thickness, 2px) 0;
    transform: rotate(45deg);
}

/* Product Image */
.storedash-fbt-compact-image {
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
}

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

/* Product Name */
body .storedash-fbt-compact-name,
.elementor-widget-storedash-fbt .storedash-fbt-compact-name {
    flex: 1 1 auto !important;
    min-width: 0;
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left !important;
}

.storedash-fbt-compact-qty {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Price */
body .storedash-fbt-compact-price,
.elementor-widget-storedash-fbt .storedash-fbt-compact-price {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    flex-shrink: 0 !important;
    margin-left: auto;
    white-space: nowrap;
}

/* Pricing Section */
body .storedash-fbt-pricing-section,
.elementor-widget-storedash-fbt .storedash-fbt-pricing-section {
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 16px;
    width: 100%;
}

body .storedash-fbt-items-total-row,
.elementor-widget-storedash-fbt .storedash-fbt-items-total-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px;
    width: 100% !important;
    min-width: 100%;
}

body .storedash-fbt-items-label,
.elementor-widget-storedash-fbt .storedash-fbt-items-label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    flex: 0 0 auto;
    margin-right: auto;
}

body .storedash-fbt-items-total,
.elementor-widget-storedash-fbt .storedash-fbt-items-total {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

body .storedash-fbt-total,
.elementor-widget-storedash-fbt .storedash-fbt-total {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 100%;
}

body .storedash-fbt-total-label,
.elementor-widget-storedash-fbt .storedash-fbt-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    flex: 0 0 auto;
    margin-right: auto;
}

body .storedash-fbt-total-price,
.elementor-widget-storedash-fbt .storedash-fbt-total-price {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

/* Add All Button */
.storedash-fbt-add-all {
    width: 100%;
    padding: 12px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.storedash-fbt-add-all:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.storedash-fbt-add-all:disabled,
.storedash-fbt-add-all.adding {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.storedash-fbt-add-all.added {
    background: #10b981;
}

/* Loading State */
.storedash-fbt-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

/* Empty State */
.storedash-fbt-empty,
.storedash-fbt-error {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.storedash-fbt-error {
    color: #dc2626;
}

/* Editor Notice (Elementor) */
.storedash-fbt-editor-notice {
    padding: 40px 20px;
    text-align: center;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .storedash-fbt-bundle {
        padding: 16px;
    }

    .storedash-fbt-title {
        font-size: 18px;
    }

    .storedash-fbt-compact-label {
        gap: 8px;
    }

    .storedash-fbt-compact-name {
        font-size: 13px;
    }

    .storedash-fbt-compact-price {
        font-size: 14px;
    }
}
