/**
 * STORE-DIRECTORY.CSS - Directory/Archive Page Components
 * Archive pages, listings, directory-specific layouts
 * 
 * @package StileSalentino
 * @version 2.1.0
 */

/* =============================================================
   STORE DIRECTORY LAYOUT
   ============================================================= */

.store-directory {
    padding: var(--section-padding-y, 40px) 0;
}

.store-directory__header {
    text-align: center;
    margin-bottom: var(--space-3xl, 48px);
}

.store-directory__title {
    font-size: var(--font-size-4xl, 2.25rem);
    font-weight: 700;
    margin-bottom: var(--space-sm, 10px);
    color: var(--text-primary, #111827);
}

.store-directory__subtitle {
    font-size: var(--font-size-lg, 1.125rem);
    color: var(--text-secondary, #6b7280);
    max-width: 600px;
    margin: 0 auto var(--space-md, 16px);
}

.store-directory__count {
    font-size: var(--font-size-base, 1rem);
    color: var(--text-muted, #9ca3af);
    font-weight: 500;
}

/* =============================================================
   STORE LISTING COMPONENT
   ============================================================= */

.store-listing {
    width: 100%;
}

.store-listing__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md, 16px);
    margin-bottom: var(--space-lg, 24px);
    padding-bottom: var(--space-md, 16px);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.store-listing__count {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
}

.store-listing__view-toggle {
    flex-shrink: 0;
}

.store-listing__filters {
    margin-bottom: var(--space-lg, 24px);
}

.store-listing__sorting {
    margin-bottom: var(--space-md, 16px);
}

.store-listing__grid {
    margin-bottom: var(--space-xl, 32px);
}

/* Store Listing Layouts */
.store-listing--grid .store-listing__items {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.store-listing--list .store-listing__items {
    grid-template-columns: 1fr;
    gap: var(--space-md, 16px);
}

.store-listing--masonry .store-listing__items {
    columns: 3;
    column-gap: var(--space-lg, 24px);
}

.store-listing--cards .store-listing__items {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* =============================================================
   VIEW TOGGLE CONTROLS
   ============================================================= */

.view-toggle {
    display: flex;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    background: white;
    overflow: hidden;
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.view-toggle__option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs, 8px) var(--space-sm, 12px);
    background: transparent;
    border: none;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    height: 40px;
}

.view-toggle__option:hover {
    background: var(--color-background, #f3f4f6);
    color: var(--text-primary, #374151);
}

.view-toggle__option--active {
    background: var(--color-primary, #2563eb);
    color: white;
}

.view-toggle__icon {
    width: 16px;
    height: 16px;
}

/* =============================================================
   SORTING CONTROLS
   ============================================================= */

.store-sorting {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 12px);
}

.store-sorting__label {
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
    flex-shrink: 0;
}

.store-sorting__select {
    padding: var(--space-xs, 8px) var(--space-sm, 12px);
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-sm, 6px);
    background: white;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-primary, #111827);
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 150px;
}

.store-sorting__select:focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.store-listing__pagination {
    margin-top: var(--space-xl, 32px);
}

.store-listing__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: var(--space-xs, 8px) var(--space-sm, 12px);
    margin: 0 var(--space-xs, 4px);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    background: white;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    text-decoration: none;
    transition: all 0.2s ease;
}

.store-listing__pagination .page-numbers:hover {
    background: var(--color-background, #f3f4f6);
    border-color: var(--color-primary, #2563eb);
    color: var(--color-primary, #2563eb);
    transform: translateY(-1px);
}

.store-listing__pagination .page-numbers.current {
    background: var(--color-primary, #2563eb);
    border-color: var(--color-primary, #2563eb);
    color: white;
}

.store-listing__pagination .page-numbers.prev,
.store-listing__pagination .page-numbers.next {
    font-weight: 600;
    min-width: auto;
    padding: var(--space-xs, 8px) var(--space-md, 16px);
}

/* =============================================================
   EMPTY STATES
   ============================================================= */

.store-listing__empty {
    text-align: center;
    padding: var(--space-4xl, 64px) var(--space-md, 20px);
    background: var(--color-background, #f9fafb);
    border-radius: var(--radius-lg, 12px);
    border: 2px dashed var(--color-border, #e5e7eb);
}

.store-listing__empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md, 16px);
    opacity: 0.5;
}

.store-listing__empty-title {
    font-size: var(--font-size-xl, 1.25rem);
    font-weight: 600;
    color: var(--text-primary, #374151);
    margin-bottom: var(--space-sm, 8px);
}

.store-listing__empty-description {
    color: var(--text-secondary, #6b7280);
    margin-bottom: var(--space-lg, 24px);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.no-stores-found,
.no-featured-stores {
    text-align: center;
    padding: var(--space-4xl, 60px) var(--space-md, 20px);
    background: var(--color-background, #f9fafb);
    border-radius: var(--radius-md, 12px);
    color: var(--text-secondary, #6b7280);
    border: 2px dashed var(--color-border, #e5e7eb);
}

.no-stores-found h3,
.no-featured-stores h3 {
    margin-bottom: var(--space-md, 15px);
    color: var(--text-primary, #374151);
}

/* =============================================================
   LOADING STATES
   ============================================================= */

.store-listing--loading {
    position: relative;
}

.store-listing--loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.store-listing__loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border, #e5e7eb);
    border-top: 3px solid var(--color-primary, #2563eb);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Skeleton */
.store-listing__skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg, 24px);
}

.store-card--skeleton {
    background: white;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
}

.store-card--skeleton .skeleton-item {
    background: var(--color-background, #f3f4f6);
    animation: skeleton-pulse 1.5s ease-in-out infinite alternate;
}

.skeleton-item--image {
    width: 100%;
    height: 200px;
}

.skeleton-item--title {
    height: 20px;
    width: 70%;
    margin: var(--space-md, 16px) var(--space-md, 16px) var(--space-sm, 8px);
    border-radius: var(--radius-xs, 2px);
}

.skeleton-item--text {
    height: 14px;
    margin: 0 var(--space-md, 16px) var(--space-xs, 4px);
    border-radius: var(--radius-xs, 2px);
}

.skeleton-item--text:last-child {
    width: 60%;
    margin-bottom: var(--space-md, 16px);
}

@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

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

@media (max-width: 768px) {
    .store-directory__title {
        font-size: var(--font-size-3xl, 1.875rem);
    }
    
    .store-listing__header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm, 12px);
    }
    
    .store-listing__view-toggle {
        order: 2;
        align-self: center;
    }
    
    .store-listing__count {
        order: 1;
        text-align: center;
    }
    
    .store-listing--masonry .store-listing__items {
        columns: 1;
    }
    
    .view-toggle {
        align-self: center;
    }
    
    .store-sorting {
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .store-listing--masonry .store-listing__items {
        columns: 2;
    }
    
    .store-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================
   DARK MODE SUPPORT
   ============================================================= */

@media (prefers-color-scheme: dark) {
    .store-directory {
        --store-card-bg: #1f2937;
        --store-card-border-color: #374151;
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --color-background: #111827;
        --color-border: #374151;
    }
}
