/**
 * Product Catalog Modal Styles
 * All-in-one modal with categories on left, products on right
 */

/* Modal container */
.sbs-catalog-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sbs-catalog-modal.open {
    display: flex;
}

.sbs-catalog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.sbs-catalog-container {
    position: relative;
    z-index: 2;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 1200px;
    width: 100%;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.sbs-catalog-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.sbs-catalog-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.sbs-catalog-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sbs-catalog-close:hover {
    background: #f0f0f0;
    color: #000;
}

/* Main content area */
.sbs-catalog-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Sidebar - Categories */
.sbs-catalog-sidebar {
    width: 25%;
    border-right: 1px solid #e5e5e5;
    background: #fafafa;
    overflow-y: auto;
    padding: 20px;
}

.sbs-catalog-sidebar h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sbs-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Category button */
.sbs-category-btn {
    padding: 10px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sbs-category-btn:hover {
    background: #f5f5f5;
    border-color: #d2ae6d;
    color: #333;
}

.sbs-category-btn.active {
    background: #d2ae6d;
    border-color: #d2ae6d;
    color: white;
}

.sbs-category-count {
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 12px;
}

.sbs-category-btn.active .sbs-category-count {
    background: rgba(255, 255, 255, 0.4);
}

/* Main area - Products */
.sbs-catalog-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    background: white;
}

/* Products grid */
.sbs-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Product card */
.sbs-product-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sbs-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d2ae6d;
    transform: translateY(-2px);
}

/* Product image */
.sbs-product-image {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sbs-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sbs-product-image.no-image {
    background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
    font-size: 14px;
    color: #999;
}

/* Product info */
.sbs-product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sbs-product-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    flex-grow: 1;
}

.sbs-product-description {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sbs-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.sbs-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #d2ae6d;
}

/* Book button */
.sbs-product-book-btn {
    padding: 6px 12px;
    background: #d2ae6d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.sbs-product-book-btn:hover {
    background: #bf9a54;
    text-decoration: none;
    color: white;
}

/* Empty state */
.sbs-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.sbs-empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.sbs-empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #666;
}

.sbs-empty-state-text {
    font-size: 14px;
    color: #999;
}

/* Loading spinner */
.sbs-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.sbs-loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d2ae6d;
    border-radius: 50%;
    animation: sbs-spin 1s linear infinite;
}

@keyframes sbs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .sbs-catalog-container {
        max-width: 100%;
        max-height: 95vh;
    }

    .sbs-catalog-content {
        flex-direction: column;
    }

    .sbs-catalog-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        max-height: 150px;
        padding: 15px;
    }

    .sbs-categories-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
    }

    .sbs-category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .sbs-catalog-main {
        padding: 15px;
    }

    .sbs-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .sbs-product-image {
        height: 120px;
    }

    .sbs-product-info {
        padding: 10px;
    }

    .sbs-product-title {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .sbs-catalog-modal {
        padding: 10px;
    }

    .sbs-catalog-container {
        border-radius: 4px;
    }

    .sbs-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sbs-product-meta {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .sbs-product-book-btn {
        width: 100%;
    }
}
