/**
 * Catalog Template Styles
 *
 * Used for ajax-chain tests.
 * Product grid layout with sequential loading.
 */

/* Catalog Container */
.catalog-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* Catalog Header */
.catalog-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.catalog-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.catalog-header .subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Slot */
.product-slot {
    background-color: var(--color-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.product-slot:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-slot.loading {
    opacity: 0.7;
}

.product-slot.loaded {
    border-color: var(--color-border-accent);
}

.product-slot.error {
    border-color: var(--color-error);
    opacity: 0.6;
}

.product-slot.error .slot-name {
    color: var(--color-error);
}

/* Product Slot Image */
.slot-image {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--color-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slot-image.loading {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Product Slot Content */
.slot-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slot-name {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 1rem;
    min-height: 1.5rem;
}

.slot-name.loading {
    background-color: var(--color-bg-tertiary);
    border-radius: 4px;
    color: transparent;
    width: 80%;
}

.slot-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    min-height: 1.5rem;
}

.slot-price.loading {
    background-color: var(--color-bg-tertiary);
    border-radius: 4px;
    color: transparent;
    width: 50%;
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Step Counter */
.step-counter {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
    background-color: var(--color-bg-secondary);
    border-radius: 8px;
}

.step-counter .current-step {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
}

.step-counter .total-steps {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* Test Info Box */
.test-info {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--color-bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid var(--color-accent);
}

.test-info h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.test-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.test-info p:last-child {
    margin-bottom: 0;
}

.test-info code {
    background-color: var(--color-bg-code);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.875em;
}

/* Navigation */
.catalog-nav {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.catalog-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--color-bg-secondary);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.catalog-nav a:hover {
    background-color: var(--color-bg-tertiary);
    text-decoration: none;
}
