/* Modern Categories Page Styles */

/* Theme Override - Full Width Layout */
body.sm-force-full-width-page {
    overflow-x: hidden;
}

body.sm-force-full-width-page #content,
body.sm-force-full-width-page .site-content,
body.sm-force-full-width-page .ast-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

.sm-breakout-full-width {
    width: 100%;
    background: #f8f9fa;
}

.sm-modern-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
}

:root {
    --primary: #243E36;
    --primary-dark: #1B2F29;
    --primary-light: #2F5D50;
    --secondary: #ed8936;
    --success: #48bb78;
    --info: #4299e1;
    --warning: #ecc94b;
    --danger: #f56565;
    --dark: #2d3748;
    --gray: #718096;
    --light: #f7fafc;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



/* --- Filter Bar Container --- */
.sm-filter-bar {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

/* --- 1. Search Input Styling --- */
.sm-filter-search {
    flex: 1 1 280px;
    position: relative;
    display: block;
    min-width: 280px;
    max-width: 100%;
}

/* Category Detail Page Search Input - Unique Class to Avoid Conflicts */
.sm-category-detail-search-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #2d3748;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: block;
}

.sm-category-detail-search-input:focus {
    background-color: #ffffff;
    border-color: #243E36;
    box-shadow: 0 0 0 3px rgba(36, 62, 54, 0.1);
    outline: none;
}

.sm-category-detail-search-input::placeholder {
    color: #a0aec0;
    opacity: 1;
}

/* Legacy support for old class name */
.sm-filter-search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #2d3748;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    height: 40px;
    box-sizing: border-box;
}

.sm-filter-search-input:focus {
    background-color: #ffffff;
    border-color: #243E36;
    box-shadow: 0 0 0 3px rgba(36, 62, 54, 0.1);
    outline: none;
}

/* Search Icon Positioning - Right Side */
.sm-filter-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
    width: 18px;
    height: 18px;
    z-index: 2;
}

/* --- 2. Controls Group (Sort + Toggle) --- */
.sm-filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Sort Dropdown */
.sm-sort-dropdown {
    padding: 0 36px 0 16px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0aec0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    min-width: 160px;
    flex-shrink: 0;
}

/* --- 3. View Toggle Buttons (Grid/List) - Now inline with search and sort --- */
.sm-categories-view-toggle {
    display: flex;
    background: white;
    padding: 4px;
    border-radius: 8px;
    height: auto;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
    gap: 4px;
}

.sm-categories-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: white;
    border-radius: 6px;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.sm-categories-view-btn:hover {
    color: #243E36;
    background-color: #f1f5f9;
}

/* Active State (Dark Green) */
.sm-categories-view-btn.active {
    background-color: #243E36;
    color: #ffffff;
    box-shadow: none;
    font-weight: normal;
}

/* Ensure SVG icons are visible and properly sized */
.sm-categories-view-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.sm-categories-view-btn:hover svg {
    fill: currentColor;
}

.sm-categories-view-btn.active svg {
    fill: currentColor;
}

/* Hero Section */
.sm-hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2.5rem 0 2rem 0;
    position: relative;
    overflow: visible;
    width: 100%;
    z-index: 1;
    margin-bottom: 0;
}

.sm-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    right: -50%;
    bottom: 0;
    background-image: 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.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(60px); }
}

.sm-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.sm-hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
    animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sm-hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
    animation: fadeInUp 0.8s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Bar */
.sm-stats-bar {
    background: white;
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1.5rem;
    max-width: 800px;
    margin: -0.75rem auto 1.5rem;
    position: relative;
    z-index: 3;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.sm-stat-item { text-align: center; flex: 1; min-width: 120px; }
.sm-stat-number {
    font-size: 2.5rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 0.25rem;
}
.sm-stat-label { color: var(--gray); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* Search Section */
.sm-search-section { 
    padding: 1rem 0; 
    background: var(--light); 
    width: 100%;
    position: relative;
    z-index: 2;
}
.sm-search-container { max-width: 700px; margin: 0 auto; position: relative; }
.sm-search-input-wrapper { position: relative; display: flex; align-items: center; background: white; border-radius: 9999px; box-shadow: var(--shadow-lg); transition: var(--transition); }
.sm-search-input-wrapper:focus-within { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.sm-search-icon { position: absolute; right: 1.5rem; color: var(--gray); pointer-events: none; width: 20px; height: 20px; }
.sm-search-input { width: 100%; padding: 1.25rem 3.5rem 1.25rem 1.5rem; border: 2px solid transparent; border-radius: 9999px; font-size: 1rem; transition: var(--transition); background: transparent; }
.sm-search-input:focus { outline: none; }

/* Unique class for categories page search input */
.sm-categories-search-input { 
    width: 100%; 
    padding: 1.25rem 3.5rem 1.25rem 1.5rem; 
    border: 2px solid transparent; 
    border-radius: 9999px; 
    font-size: 1rem; 
    transition: var(--transition); 
    background: transparent; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
.sm-categories-search-input:focus { outline: none; }

.sm-search-clear { position: absolute; right: 1.5rem; background: var(--light); border: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; pointer-events: none; transition: var(--transition); }
.sm-search-clear.active { opacity: 1; pointer-events: all; }
.sm-search-clear:hover { background: var(--border); }

/* Filter Pills */
.sm-filter-pills { display: flex; gap: 0.75rem; margin-top: 0.75rem; justify-content: center; flex-wrap: wrap; }
.sm-filter-pill { padding: 0.5rem 1.25rem; background: white; border: 2px solid var(--border); border-radius: 9999px; font-size: 0.875rem; font-weight: 600; color: var(--gray); cursor: pointer; transition: var(--transition); display: inline-block; text-align: center; user-select: none; -webkit-user-select: none; }
.sm-filter-pill:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.sm-filter-pill.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: var(--shadow-lg); }

/* View Toggle */
.sm-view-toggle { display: flex; gap: 0.5rem; margin-left: auto; }
.sm-view-btn { padding: 0.5rem 0.75rem; background: white; border: 2px solid var(--border); border-radius: 0.5rem; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.sm-view-btn:hover { border-color: var(--primary); color: var(--primary); }
.sm-view-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* --- 3. View Toggle Buttons (Grid/List) - Categories Page --- */
.sm-view-toggle.sm-categories-view-toggle {
    display: flex;
    background: white;
    padding: 4px;
    border-radius: 8px;
    height: auto;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
    gap: 4px;
    margin-left: 0;
}

.sm-view-toggle.sm-categories-view-toggle .sm-categories-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    background: white;
    border-radius: 6px;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.sm-view-toggle.sm-categories-view-toggle .sm-categories-view-btn:hover {
    color: #243E36;
    background-color: #f1f5f9;
}

.sm-view-toggle.sm-categories-view-toggle .sm-categories-view-btn.active {
    background-color: #243E36;
    color: #ffffff;
    box-shadow: none;
}

.sm-view-toggle.sm-categories-view-toggle .sm-categories-view-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

/* View Toggle Button Container - Category Detail */
.sm-view-toggle-btn {
    display: flex;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 8px;
    height: auto;
    box-sizing: border-box;
    border: 2px solid #e2e8f0;
}

.sm-view-toggle-btn .sm-view-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: white;
    border-radius: 6px;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-view-toggle-btn .sm-view-btn:hover {
    color: #243E36;
    background-color: #f1f5f9;
}

.sm-view-toggle-btn .sm-view-btn.active {
    background-color: #243E36;
    color: #ffffff;
    box-shadow: none;
}

.sm-view-toggle-btn .sm-view-btn svg {
    width: 18px;
    height: 18px;
}

/* Categories Section */
.sm-categories-section { 
    padding: 2rem 0; 
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Featured Categories Section */
.sm-featured-categories-wrapper {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    margin-bottom: 3rem;
    padding-bottom: 2rem;
}

.sm-featured-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.sm-featured-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.sm-featured-categories-grid .sm-category-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--primary);
}

.sm-featured-categories-grid .sm-category-icon.featured-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

@media (max-width: 768px) {
    .sm-featured-categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .sm-featured-categories-grid .sm-category-card {
        margin: 0;
        border-radius: 12px;
    }
}

.sm-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.sm-section-title { font-size: 2rem; font-weight: 800; color: var(--dark); }

/* Category Grid */
.sm-categories-grid {
    display: grid;
    gap: 1.25rem;
    animation: fadeIn 0.6s ease;
}
.sm-categories-grid.grid-view { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.sm-categories-grid.list-view { grid-template-columns: 1fr; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Category Card */
.sm-category-card { background: white; border: 2px solid var(--border); border-radius: 1rem; padding: 1.75rem; transition: var(--transition); position: relative; overflow: hidden; cursor: pointer; }
.sm-category-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.sm-category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: transparent; }
.sm-category-card:hover::before { transform: scaleX(1); }
.sm-category-card.featured { background: linear-gradient(135deg, #243E3615 0%, #2F5D5015 100%); border-color: var(--primary); }

.sm-category-icon { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.5rem; }
.sm-category-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.sm-category-name { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin-bottom: 0.5rem; transition: color 0.3s ease; }
.sm-category-card:hover .sm-category-name { color: var(--primary); }
.sm-category-description { color: var(--gray); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.sm-category-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.sm-badge { padding: 0.375rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }
.sm-badge-primary { background: var(--primary); color: white; }
.sm-badge-success { background: #48bb7815; color: var(--success); border: 1px solid #48bb7830; }
.sm-badge-info { background: #4299e115; color: var(--info); border: 1px solid #4299e130; }
.sm-badge-new { background: linear-gradient(135deg, #f56565 0%, #ed8936 100%); color: white; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.8; } }

/* Subcategories */
.sm-subcategories { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.sm-subcategories-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); margin-bottom: 0.75rem; font-weight: 600; }
.sm-subcategories-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sm-subcategory-link { padding: 0.375rem 0.75rem; background: var(--light); border-radius: 0.5rem; font-size: 0.875rem; color: var(--dark); text-decoration: none; transition: var(--transition); display: inline-flex; align-items: center; gap: 0.25rem; }
.sm-subcategory-link:hover { background: var(--primary); color: white; transform: translateY(-1px); box-shadow: var(--shadow); }
.sm-subcategory-link.sm-search-match { background: #fbbf24; color: #1f2937; font-weight: 600; box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3); }
.sm-subcategory-link.sm-search-match:hover { background: #f59e0b; color: white; }
.sm-subcategory-count { background: white; color: var(--gray); padding: 0.125rem 0.375rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.sm-subcategory-link:hover .sm-subcategory-count { background: rgba(255, 255, 255, 0.2); color: white; }
.sm-subcategory-link.sm-search-match .sm-subcategory-count { background: rgba(31, 41, 55, 0.2); color: #1f2937; }

/* List View Styles */
.sm-categories-grid.list-view .sm-category-card { display: flex; align-items: center; gap: 2rem; padding: 1.5rem; }
.sm-categories-grid.list-view .sm-category-icon { margin-bottom: 0; }
.sm-categories-grid.list-view .sm-category-content { flex: 1; }
.sm-categories-grid.list-view .sm-category-description { -webkit-line-clamp: 1; }
.sm-categories-grid.list-view .sm-subcategories { border-top: none; padding-top: 0; margin-top: 0.5rem; }

/* No Results */
.sm-no-results { text-align: center; padding: 4rem 2rem; background: white; border-radius: 1rem; border: 2px dashed var(--border); }
.sm-no-results-icon { font-size: 4rem; margin-bottom: 1rem; }
.sm-no-results-title { font-size: 1.5rem; color: var(--dark); margin-bottom: 0.5rem; }
.sm-no-results-text { color: var(--gray); margin-bottom: 1.5rem; }

/* Skeleton Loading */
.sm-skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: loading 1.5s infinite; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Responsive */
@media (max-width: 768px) {
    .sm-hero-title { font-size: 2rem; }
    .sm-hero-subtitle { font-size: 1rem; }
    .sm-stats-bar { gap: 1rem; }
    .sm-stat-number { font-size: 1.75rem; }
    .sm-categories-grid.grid-view { 
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }
    .sm-modern-container { padding: 0 20px; }
    .sm-full-width-layout { background: #f8f9fa; }
    
    /* Full width on mobile */
    .sm-detail-layout {
        padding: 0 1rem 1rem 1rem;
        flex-direction: column;
    }
    
    /* Category card mobile optimization */
    .sm-category-card {
        margin: 0;
        border-radius: 12px;
        padding: 1.25rem;
    }
    
    .sm-category-name {
        font-size: 1.25rem;
    }
    
    .sm-category-description {
        font-size: 0.875rem;
    }
    
    .sm-sidebar {
        flex: 1;
        position: static;
        order: -1;
    }
    
    .sm-stats-cards {
        padding: 0 1rem;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sm-category-hero {
        padding: 2rem 0;
    }
    
    /* Stack filter controls on mobile */
    .sm-filter-bar {
        grid-template-columns: 1fr;
    }
    
    .sm-filter-search {
        grid-column: 1;
        width: 100%;
    }
    
    .sm-filter-controls {
        grid-column: 1;
        width: 100%;
    }
    
    .sm-sort-dropdown {
        flex: 1;
    }
}

/* Animations */
.sm-fade-in { animation: fadeIn 0.6s ease; }
.sm-slide-up { animation: slideUp 0.6s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px);} to { opacity: 1; transform: translateY(0);} }

/* Popular Badge Animation */
.sm-popular-badge { position: absolute; top: 1rem; right: 1rem; background: linear-gradient(135deg, #f56565 0%, #ed8936 100%); color: white; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; box-shadow: var(--shadow); animation: bounce 2s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Alphabetical Navigation */
.sm-alpha-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 0.5rem 0; }
.sm-alpha-btn { padding: 0.375rem 0.5rem; border: 1px solid var(--border); background: white; border-radius: 0.375rem; font-size: 0.8125rem; cursor: pointer; color: var(--gray); }
.sm-alpha-btn.active, .sm-alpha-btn:hover { border-color: var(--primary); color: var(--primary); }

.sm-results-info,
#sm-results-info { margin-bottom: 0.75rem; color: var(--gray); }

/* === COMPARE FUNCTIONALITY STYLES === */

/* CATEGORY PAGE SPECIFIC: sm-cat-* classes */

/* Compare Toggle Button (Category Page) */
.sm-cat-compare-toggle {
    position: static;
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}

.sm-cat-compare-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(36, 62, 54, 0.05);
}

.sm-cat-compare-toggle.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.sm-checkbox-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.sm-compare-label {
    display: inline;
}

/* Floating Compare Bar (Category Page) */
.sm-cat-floating-compare-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(36, 62, 54, 0.2);
    z-index: 9999;
    max-width: 90vw;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.sm-cat-compare-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.sm-cat-floating-compare-items {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    padding-right: 12px;
}

.sm-cat-floating-compare-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light);
    border-radius: 8px;
    padding: 4px 8px;
    position: relative;
    flex-shrink: 0;
}

.sm-cat-floating-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.sm-cat-floating-thumb.placeholder {
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sm-cat-floating-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--dark);
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-cat-floating-remove {
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s ease;
}

.sm-cat-floating-remove:hover {
    color: var(--danger);
}

.sm-cat-btn-compare {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.sm-cat-btn-compare:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 62, 54, 0.2);
}

.sm-cat-btn-compare:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Key Feature Highlight */
.sm-key-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(76, 175, 80, 0.1));
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid var(--success);
}

.sm-feature-icon {
    font-size: 12px;
    display: inline-block;
}

.sm-feature-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--dark);
}

/* Star Rating with Percentage Fill */
.sm-star-background {
    width: 100px;
    height: 16px;
    background: linear-gradient(90deg, #ddd 0%, #ddd 100%);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
}

.sm-star-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
    transition: width 0.3s ease;
}

.sm-review-count {
    font-size: 12px;
    color: var(--gray);
    margin-left: 4px;
}

/* Pricing Badge Enhancement */
.sm-pricing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--dark);
}

.sm-pricing-badge .sm-meta-icon {
    width: 16px;
    height: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sm-cat-floating-compare-bar {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    
    .sm-cat-compare-bar-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sm-cat-floating-compare-items {
        width: 100%;
        padding-right: 0;
    }
    
    .sm-cat-btn-compare {
        width: 100%;
        text-align: center;
    }
    
    .sm-cat-compare-toggle {
        padding: 8px 12px;
        font-size: 11px;
        width: 100%;
        margin-top: 12px;
    }
}

.sm-load-more {
    text-align: center;
    margin-top: 1rem;
}

.sm-load-more .sm-btn-modern {
    max-width: 240px;
}

.sm-btn-outline-secondary {
    margin-left: 10px;
}

.sm-software-logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
}

.sm-hidden {
    display: none;
}

/* === CATEGORY DETAIL PAGE STYLES === */

body.sm-full-width-page #primary,
body.sm-full-width-page .site-content,
body.sm-full-width-page .content-area {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.sm-full-width-page .primary-sidebar,
body.sm-full-width-page .sidebar,
body.sm-full-width-page aside:not(.sm-sidebar) {
    display: none;
}

body.sm-category-detail-page #primary,
body.sm-category-detail-page .site-content,
body.sm-category-detail-page .content-area {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.sm-category-detail-page .primary-sidebar,
body.sm-category-detail-page .sidebar,
body.sm-category-detail-page aside:not(.sm-sidebar) {
    display: none;
}

.sm-modern-detail-wrapper {
    width: 100%;
    overflow-x: hidden;
}

.sm-modern-detail-container {
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

/* --- HERO & STATS OVERLAP FIX --- */
.sm-category-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 4rem 2rem 8rem;
    position: relative;
    overflow: visible;
    width: 100%;
    z-index: 1;
    margin-bottom: -4rem;
}

.sm-category-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(255,255,255,0.1), transparent);
}

.sm-hero-content {
    position: relative;
    z-index: 1;
    padding: 0 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.sm-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.sm-breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.sm-breadcrumb a:hover {
    color: white;
}

.sm-breadcrumb-separator {
    color: rgba(255, 255, 255, 0.5);
}

.sm-category-hero .sm-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
    animation: fadeInDown 0.6s ease;
}

.sm-hero-description {
    font-size: 1.125rem;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.sm-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 0 auto 3rem;
    position: relative;
    z-index: 10;
    padding: 0 20px;
    max-width: 1200px;
    width: 100%;
}

.sm-stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.6s ease;
    transition: all 0.3s ease;
}

.sm-stat-card.highlight {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border: 2px solid #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.sm-stat-card.highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.sm-stat-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1.5rem;
}

.sm-stat-card-icon.primary {
    background: linear-gradient(135deg, #243E3615, #2F5D5015);
    color: var(--primary);
}

.sm-stat-card-icon.success {
    background: #48bb7815;
    color: var(--success);
}

.sm-stat-card-icon.info {
    background: #4299e115;
    color: var(--info);
}

.sm-stat-card-icon.warning {
    background: #ecc94b15;
    color: var(--warning);
}

.sm-stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.sm-stat-card-label {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Layout - Full width with padding */
.sm-detail-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    padding: 0 2rem 2rem 2rem;
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    box-sizing: border-box;
}

.sm-main-content {
    flex: 1;
    min-width: 0;
}

.sm-sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 1rem;
    height: fit-content;
}

/* Software Grid */
.sm-software-grid {
    display: grid;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

/* CATEGORY DETAIL PAGE - SOFTWARE GRID LAYOUT - HIGH SPECIFICITY */
body.sm-category-detail-page .sm-software-grid.grid-view,
.sm-modern-detail-wrapper .sm-software-grid.grid-view,
#sm-software-grid.grid-view {
    /* Default 3 cards per row with wider cards */
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 100% !important;
    gap: 2rem !important;
    width: 100% !important;
}

/* Ultra-wide screens - Maximum 4 columns */
@media (min-width: 2000px) {
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 2400px !important;
        margin: 0 auto !important;
        gap: 2.5rem !important;
    }
}

/* Very large screens - 3 columns */
@media (min-width: 1400px) and (max-width: 1999px) {
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 1800px !important;
        margin: 0 auto !important;
        gap: 2rem !important;
    }
}

/* Large screens - 3 columns */
@media (min-width: 1200px) and (max-width: 1399px) {
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 1600px !important;
        margin: 0 auto !important;
        gap: 1.5rem !important;
    }
}

.sm-software-grid.list-view {
    grid-template-columns: 1fr !important;
    display: grid !important;
    gap: 0.5rem !important;
}

/* ... existing code ...

/* Medium screens - 2 columns */
@media (max-width: 1199px) {
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

/* Tablet screens - Layout changes */
@media (max-width: 1024px) {
    .sm-detail-layout {
        flex-direction: column;
    }
    
    .sm-sidebar {
        flex: 1;
        position: static;
        order: -1;
    }
    
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .sm-hero-title {
        font-size: 1.75rem;
    }
    
    .sm-stats-cards {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -2rem;
    }
    
    .sm-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sm-filter-search {
        min-width: 100%;
    }
    
    .sm-filter-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .sm-software-grid.list-view .sm-software-card-modern {
        flex-direction: column;
    }
    
    .sm-software-grid.list-view .sm-software-card-header,
    .sm-software-grid.list-view .sm-software-card-footer {
        width: 100%;
        border: none;
    }
}



/* Software Card - Modern Design */
.sm-software-card-modern {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    min-height: 520px;
    width: 100%;
    max-width: 100%;
}

.sm-software-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.sm-software-card-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #f56565, #ed8936);
    color: white;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 1;
}

.sm-software-card-badge.sm-badge-updated {
    background: linear-gradient(135deg, #48bb78, #38a169);
    top: 0.75rem;
    right: 0.75rem;
}

/* Primary Category Badge - REMOVED as per user request */

.sm-software-card-header {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, var(--light), white);
    border-bottom: 1px solid var(--border);
}

.sm-software-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sm-software-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid var(--border);
}

.sm-software-title-info {
    flex: 1;
    min-width: 0;
}

.sm-software-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sm-software-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    max-width: 100%;
}

.sm-software-name a:hover {
    color: var(--primary);
}

.sm-software-vendor {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.sm-software-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sm-rating-stars {
    display: flex;
    gap: 0.125rem;
}

.sm-star {
    width: 16px;
    height: 16px;
    color: #fbbf24;
}

.sm-star.empty {
    color: #e5e7eb;
}

.sm-rating-text {
    font-size: 0.875rem;
    color: var(--gray);
}

.sm-software-card-body {
    padding: 1.5rem 1.5rem 2rem 1.5rem;
    flex: 1;
}

.sm-software-description {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sm-software-features {
    margin-bottom: 1rem;
}

.sm-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sm-feature-tag {
    padding: 0.25rem 0.625rem;
    background: var(--light);
    color: var(--dark);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.sm-software-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.sm-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--gray);
}

.sm-meta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sm-software-card-footer {
    padding: 1.5rem;
    background: var(--light);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.sm-btn-modern {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.sm-software-grid.list-view .sm-btn-modern {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-height: auto;
}

.sm-btn-primary-modern {
    background: var(--primary);
    color: white;
}

.sm-btn-primary-modern:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.sm-btn-outline-modern {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.sm-btn-outline-modern:hover {
    background: var(--primary);
    color: white;
}

/* List View Adjustments */
.sm-software-grid.list-view .sm-software-card-modern {
    flex-direction: row;
    min-height: auto;
    height: auto;
    margin-bottom: 0.5rem;
}

.sm-software-grid.list-view .sm-software-card-header {
    border-bottom: none;
    border-right: 1px solid var(--border);
    width: 250px;
    flex-shrink: 0;
    padding: 1rem;
}

.sm-software-grid.list-view .sm-software-card-body {
    padding: 1rem;
    flex: 1;
}

.sm-software-grid.list-view .sm-software-card-footer {
    padding: 1rem;
    border-top: none;
    border-left: 1px solid var(--border);
    flex-direction: column;
    width: 180px;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background: var(--light);
}

/* Sidebar Filters */
.sm-filter-panel {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sm-filter-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.sm-filter-header *,
.sm-filter-title,
.sm-filter-subtitle {
    color: #ffffff;
}

.sm-filter-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sm-filter-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.sm-filter-body {
    padding: 1.25rem;
}

.sm-filter-section {
    margin-bottom: 1.75rem;
}

.sm-filter-section:last-child {
    margin-bottom: 0;
}

.sm-filter-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sm-filter-info-icon {
    font-size: 0.875rem;
    opacity: 0.6;
    cursor: help;
    transition: opacity 0.2s ease;
}

.sm-filter-info-icon:hover {
    opacity: 1;
}

.sm-filter-count {
    background: var(--light);
    color: var(--gray);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.sm-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sm-filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s;
}

.sm-filter-option:hover {
    background: var(--light);
}

.sm-filter-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
}

.sm-filter-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--dark);
    cursor: pointer;
}

.sm-filter-badge {
    background: var(--border);
    color: var(--gray);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.sm-price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sm-price-input {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.sm-price-input:focus {
    outline: none;
    border-color: var(--primary);
}

.sm-clear-filters {
    width: 100%;
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--danger);
    color: var(--danger);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.sm-clear-filters:hover {
    background: var(--danger);
    color: white;
}

/* Related Categories */
.sm-related-section {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.sm-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.sm-related-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sm-related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem;
    background: var(--light);
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
}

.sm-related-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
}

.sm-related-item-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.sm-related-item-count {
    background: white;
    color: var(--gray);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.sm-related-item:hover .sm-related-item-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Loading State */
.sm-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.sm-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 0.75rem;
    border: 2px dashed var(--border);
}

.sm-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.sm-empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.sm-empty-text {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* RESPONSIVE DESIGN - HIGH SPECIFICITY OVERRIDES */
@media (max-width: 1024px) {
    .sm-detail-layout {
        flex-direction: column;
    }
    
    .sm-sidebar {
        flex: 1;
        position: static;
        order: -1;
    }
    
    /* Override any conflicting grid styles */
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .sm-hero-title {
        font-size: 1.75rem;
    }
    
    .sm-stats-cards {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -2rem;
    }
    
    .sm-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sm-filter-search {
        min-width: 100%;
    }
    
    .sm-filter-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Override any conflicting grid styles */
    body.sm-category-detail-page .sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-software-grid.grid-view,
    #sm-software-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .sm-software-grid.list-view .sm-software-card-modern {
        flex-direction: column;
    }
    
    .sm-software-grid.list-view .sm-software-card-header,
    .sm-software-grid.list-view .sm-software-card-footer {
        width: 100%;
        border: none;
    }
}



/* Place sidebar on the left on desktop */
@media (min-width: 1025px) {
    .sm-detail-layout {
        flex-direction: row-reverse;
    }
}
/* 
========================================
   CRITICAL GRID LAYOUT OVERRIDES
   ========================================
   These styles have maximum specificity to override any conflicting CSS
*/

/* FORCE GRID LAYOUT - MAXIMUM SPECIFICITY */
body.sm-category-detail-page .sm-modern-detail-wrapper .sm-main-content #sm-software-grid.sm-software-grid.grid-view,
.sm-modern-detail-wrapper .sm-main-content .sm-software-grid.grid-view,
body .sm-software-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ultra-wide screens - FORCE 4 columns maximum */
@media (min-width: 2000px) {
    body.sm-category-detail-page .sm-modern-detail-wrapper .sm-main-content #sm-software-grid.sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-main-content .sm-software-grid.grid-view,
    body .sm-software-grid.grid-view {
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 2400px !important;
        margin: 0 auto !important;
        gap: 2.5rem !important;
    }
}

/* Very large screens - FORCE 3 columns */
@media (min-width: 1400px) and (max-width: 1999px) {
    body.sm-category-detail-page .sm-modern-detail-wrapper .sm-main-content #sm-software-grid.sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-main-content .sm-software-grid.grid-view,
    body .sm-software-grid.grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 1800px !important;
        margin: 0 auto !important;
        gap: 2rem !important;
    }
}

/* Large screens - FORCE 3 columns */
@media (min-width: 1200px) and (max-width: 1399px) {
    body.sm-category-detail-page .sm-modern-detail-wrapper .sm-main-content #sm-software-grid.sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-main-content .sm-software-grid.grid-view,
    body .sm-software-grid.grid-view {
        grid-template-columns: repeat(3, 1fr) !important;
        max-width: 1600px !important;
        margin: 0 auto !important;
        gap: 1.5rem !important;
    }
}

/* Medium screens - FORCE 2 columns */
@media (max-width: 1199px) {
    body.sm-category-detail-page .sm-modern-detail-wrapper .sm-main-content #sm-software-grid.sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-main-content .sm-software-grid.grid-view,
    body .sm-software-grid.grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

/* Mobile - FORCE single column */
@media (max-width: 480px) {
    body.sm-category-detail-page .sm-modern-detail-wrapper .sm-main-content #sm-software-grid.sm-software-grid.grid-view,
    .sm-modern-detail-wrapper .sm-main-content .sm-software-grid.grid-view,
    body .sm-software-grid.grid-view {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Extra small screen optimizations */
    .sm-modern-container {
        padding: 0 16px !important;
    }
    
    .sm-category-card {
        padding: 1rem !important;
        margin: 0 !important;
        border-radius: 10px !important;
    }
    
    .sm-categories-grid.grid-view,
    .sm-featured-categories-grid {
        padding: 0 0.5rem !important;
        gap: 0.75rem !important;
    }
    
    .sm-category-name {
        font-size: 1.125rem !important;
    }
    
    .sm-category-description {
        font-size: 0.8125rem !important;
        line-height: 1.5 !important;
    }
    
    .sm-category-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
    }
    
    .sm-badge {
        font-size: 0.6875rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* PREVENT ANY FLEXBOX OR OTHER LAYOUT INTERFERENCE */
body.sm-category-detail-page .sm-software-grid.grid-view > *,
.sm-modern-detail-wrapper .sm-software-grid.grid-view > *,
#sm-software-grid.grid-view > * {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    display: block !important;
}/*
 FREE OPTIONS STAT CARD - SPECIAL STYLING */
/* FREE OPTIONS STAT CARD - HIGHLIGHT STYLING */
.sm-stat-card.highlight {
    background: linear-gradient(135deg, #48bb7815, #38a16915) !important;
    border: 2px solid #48bb78 !important;
    box-shadow: 0 4px 16px rgba(72, 187, 120, 0.2) !important;
}

.sm-stat-card.highlight:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.3) !important;
}

.sm-stat-card.highlight .sm-stat-card-icon.success {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3) !important;
}

.sm-stat-card.highlight .sm-stat-card-value {
    color: #2d3748 !important;
    font-weight: 800 !important;
}

.sm-stat-card.highlight .sm-stat-card-label {
    color: #48bb78 !important;
    font-weight: 600 !important;
}/* 
FREE OPTIONS - BORDER HIGHLIGHT ONLY */
.sm-stat-card.highlight-border {
    background: white !important;
    border: 2px solid #48bb78 !important;
    box-shadow: 0 4px 16px rgba(72, 187, 120, 0.15) !important;
}

.sm-stat-card.highlight-border:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.25) !important;
}

.sm-stat-card.highlight-border .sm-stat-card-icon.success {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3) !important;
}

.sm-stat-card.highlight-border .sm-stat-card-value {
    color: #2d3748 !important;
    font-weight: 800 !important;
}

.sm-stat-card.highlight-border .sm-stat-card-label {
    color: #48bb78 !important;
    font-weight: 600 !important;
}