/**
 * Shop Products - User-Facing Product Browse Page
 * Project: ContentFlows
 * Pure CSS - Dark Theme
 * 
 * Uses site CSS variables for consistency
 */

/* =====================================================
   PAGE LAYOUT
   ===================================================== */

.shop-products-page {
    padding: 1.5rem;
    min-height: 100vh;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    flex: 1;
    min-width: 200px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text, #e2e8f0);
    margin: 0 0 0.5rem 0;
}

.page-title i {
    color: var(--accent, #818cf8);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text2, #94a3b8);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* =====================================================
   PRODUCTS LAYOUT - MAIN + SIDEBAR
   ===================================================== */

.products-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.products-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.products-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

/* =====================================================
   FILTER BAR
   ===================================================== */

.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select {
    min-width: 160px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--text, #e2e8f0);
    background-color: var(--bg2, #1a1a2e);
    border: 1px solid var(--border, #2d2d44);
    border-radius: 0.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent, #818cf8);
}

.filter-select:hover {
    border-color: var(--text2, #94a3b8);
}

/* =====================================================
   PRODUCTS GRID
   ===================================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.product-item {
    background-color: var(--bg2, #1a1a2e);
    border: 1px solid var(--border, #2d2d44);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
    border-color: var(--accent, #818cf8);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   SIDEBAR PANEL
   ===================================================== */

.sidebar-panel {
    background-color: var(--bg2, #1a1a2e);
    border: 1px solid var(--border, #2d2d44);
    border-radius: 0.75rem;
    overflow: hidden;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    padding: 1rem 1.25rem;
    margin: 0;
    border-bottom: 1px solid var(--border, #2d2d44);
    background-color: rgba(255, 255, 255, 0.02);
}

.panel-title i {
    color: var(--accent, #818cf8);
    font-size: 1rem;
}

/* =====================================================
   STATS MINI (Sidebar)
   ===================================================== */

.stats-mini {
    padding: 1rem 1.25rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border, #2d2d44);
}

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

.stat-row .stat-label {
    font-size: 0.875rem;
    color: var(--text2, #94a3b8);
}

.stat-row .stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
}

.sidebar-panel > .button {
    margin: 0 1.25rem 1.25rem;
    width: calc(100% - 2.5rem);
}

/* =====================================================
   TOOL NAVIGATION
   ===================================================== */

.tool-nav {
    padding: 0.5rem 0;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text2, #94a3b8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.tool-link:hover {
    background-color: rgba(129, 140, 248, 0.08);
    color: var(--text, #e2e8f0);
    border-left-color: var(--accent, #818cf8);
}

.tool-link i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */

.empty-state {
    background-color: var(--bg2, #1a1a2e);
    border: 1px solid var(--border, #2d2d44);
    border-radius: 0.75rem;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2), rgba(99, 102, 241, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text2, #94a3b8);
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text, #e2e8f0);
    margin: 0 0 0.5rem 0;
}

.empty-text {
    font-size: 0.9375rem;
    color: var(--text2, #94a3b8);
    margin: 0 0 1.5rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   PAGINATION
   ===================================================== */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

.pagination-wrapper .pagination {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-wrapper .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    color: var(--text, #e2e8f0);
    background-color: var(--bg2, #1a1a2e);
    border: 1px solid var(--border, #2d2d44);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination-wrapper .page-item .page-link:hover {
    background-color: var(--bg3, #252540);
    border-color: var(--text2, #94a3b8);
}

.pagination-wrapper .page-item.active .page-link {
    background-color: var(--accent, #818cf8);
    border-color: var(--accent, #818cf8);
    color: #ffffff;
}

.pagination-wrapper .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.button-primary {
    background-color: var(--accent, #818cf8);
    color: #ffffff;
    border-color: var(--accent, #818cf8);
}

.button-primary:hover {
    background-color: var(--accent-hover, #6366f1);
    border-color: var(--accent-hover, #6366f1);
}

.button-outline {
    background-color: transparent;
    color: var(--text, #e2e8f0);
    border-color: var(--border, #2d2d44);
}

.button-outline:hover {
    background-color: var(--bg3, #252540);
    border-color: var(--text2, #94a3b8);
}

.button-full {
    width: 100%;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .products-sidebar {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .shop-products-page {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-actions .button {
        flex: 1;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .empty-state {
        padding: 2rem 1rem;
    }
}
