/**
 * StoreDash Recommendations Styles
 *
 * @package StoreDash\Recommendations
 * @since   1.0.0
 */

/* Base styles for recommendation sections */
.storedash-recommendations {
    margin: 2rem 0;
    padding: 1.5rem 0;
}

.storedash-recommendations-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: inherit;
}

/* Grid layout */
.storedash-layout-grid .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.storedash-layout-grid .products.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.storedash-layout-grid .products.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.storedash-layout-grid .products.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.storedash-layout-grid .products.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.storedash-layout-grid .products.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Slider layout */
.storedash-layout-slider .products {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 1rem;
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.storedash-layout-slider .products > li {
    flex: 0 0 calc(25% - 0.75rem);
    scroll-snap-align: start;
    min-width: 200px;
}

/* Hide scrollbar but allow scrolling */
.storedash-layout-slider .products::-webkit-scrollbar {
    height: 6px;
}

.storedash-layout-slider .products::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.storedash-layout-slider .products::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.storedash-layout-slider .products::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* FBT Bundle Styles */
.storedash-fbt-bundle {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.storedash-fbt-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
}

.storedash-fbt-products {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.storedash-fbt-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.storedash-fbt-item:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.storedash-fbt-item.storedash-fbt-main {
    border-color: #28a745;
    background: #f8fff9;
}

.storedash-fbt-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.storedash-fbt-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.storedash-fbt-item input[type="checkbox"]:disabled {
    opacity: 0.7;
    cursor: default;
}

.storedash-fbt-plus {
    font-size: 1.5rem;
    font-weight: 300;
    color: #6c757d;
    flex-shrink: 0;
}

.storedash-fbt-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.storedash-fbt-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.storedash-fbt-details {
    flex: 1;
    min-width: 0;
}

.storedash-fbt-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storedash-fbt-name:hover {
    color: #0066cc;
}

.storedash-fbt-price {
    font-size: 0.875rem;
    color: #28a745;
    font-weight: 600;
}

.storedash-fbt-price del {
    color: #999;
    font-weight: 400;
}

.storedash-fbt-price ins {
    text-decoration: none;
}

.storedash-fbt-total {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.storedash-fbt-total-label {
    color: #333;
}

.storedash-fbt-total-price {
    font-weight: 700;
    color: #28a745;
}

.storedash-fbt-add-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.storedash-fbt-add-all:hover {
    transform: translateY(-1px);
}

.storedash-fbt-add-all:active {
    transform: translateY(0);
}

.storedash-fbt-add-all.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Checkout upsells */
.storedash-checkout-upsells {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.storedash-checkout-upsells h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.storedash-checkout-upsells .products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Responsive styles */
@media (max-width: 991px) {
    .storedash-layout-grid .products,
    .storedash-checkout-upsells .products {
        grid-template-columns: repeat(3, 1fr);
    }

    .storedash-layout-slider .products > li {
        flex: 0 0 calc(33.333% - 0.67rem);
    }

    .storedash-fbt-products {
        flex-direction: column;
        align-items: stretch;
    }

    .storedash-fbt-item {
        max-width: none;
    }

    .storedash-fbt-plus {
        align-self: center;
    }
}

@media (max-width: 767px) {
    .storedash-layout-grid .products {
        grid-template-columns: repeat(2, 1fr);
    }

    .storedash-checkout-upsells .products {
        grid-template-columns: repeat(2, 1fr);
    }

    .storedash-layout-slider .products > li {
        flex: 0 0 calc(50% - 0.5rem);
    }

    .storedash-fbt-bundle {
        padding: 1rem;
    }
}

@media (max-width: 479px) {
    .storedash-layout-grid .products,
    .storedash-checkout-upsells .products {
        grid-template-columns: 1fr;
    }

    .storedash-layout-slider .products > li {
        flex: 0 0 100%;
    }

    .storedash-fbt-item {
        flex-direction: column;
        text-align: center;
    }

    .storedash-fbt-image {
        width: 80px;
        height: 80px;
    }
}
