/* related-category.css */
:root {
    --primary-color: #2e2bb1;
    --secondary-color: #791291;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hero Section */
.category-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: relative;
    overflow: hidden;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-title {
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    opacity: 0.9;
    font-weight: 300;
}

.category-hero-image {
    max-width: 120px;
    margin: 0 auto;
}

.hero-category-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-item {
    position: relative;
    z-index: 2;
}

.stat-number {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--text-light);
    font-weight: 600;
}

/* Category Header */
.category-header {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.category-stores-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.category-stores-subtitle {
    font-size: 1rem;
}

.category-filter .form-select {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.category-filter .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(46, 43, 177, 0.25);
}

/* Store Cards */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.store-card-wrapper {
    /* This wrapper ensures proper grid behavior */
}

.store-card {
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.store-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.store-card-link {
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.store-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.store-image-container {
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: all 0.3s ease;
}

.store-card:hover .store-image {
    transform: scale(1.1);
}

.store-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(46, 43, 177, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.store-card:hover .store-overlay {
    opacity: 1;
}

.view-deals-btn {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.store-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.store-name {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.store-meta {
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Empty State */
.empty-category-state {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    border: 2px dashed #e2e8f0;
    grid-column: 1 / -1;
    padding: 3rem 2rem;
}

.empty-icon {
    color: #cbd5e0;
}

.empty-actions .btn {
    margin: 0.25rem;
}

/* Category Description */
.category-description {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
}

.category-content {
    line-height: 1.7;
    color: var(--text-dark);
}

.category-content h1, .category-content h2, .category-content h3,
.category-content h4, .category-content h5, .category-content h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-content p {
    margin-bottom: 1rem;
}

/* Related Categories */
.related-categories {
    background: white;
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
}

.related-categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.related-category-btn {
    background: var(--bg-light);
    color: var(--text-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.related-category-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #4a46d4);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #25219c, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 43, 177, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Animations */
.store-card {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 992px) {
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .category-hero {
        padding: 3rem 1rem !important;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .stores-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .category-header {
        padding: 1.5rem;
    }

    .category-stores-title {
        font-size: 1.5rem;
    }

    .store-image-container {
        height: 120px;
    }

    .store-name {
        font-size: 0.85rem;
        min-height: 36px;
    }

    .category-header .d-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .category-filter .form-select {
        max-width: 100% !important;
    }
}

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

    .store-image-container {
        height: 100px;
    }

    .empty-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .empty-actions .btn {
        width: 100%;
        margin: 0 !important;
    }

    .related-categories-grid {
        gap: 0.5rem;
    }

    .related-category-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Ensure good contrast and accessibility */
.store-card-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--border-radius);
}

.store-card-link:focus .store-card {
    box-shadow: 0 0 0 3px rgba(46, 43, 177, 0.3);
}
