/* assets/css/style.css - Mobile Sidebar Stopping Cleanly Above Bottom Nav Bar & Sleek UI */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eeeffe;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: #f1f5f9;
    --border-color: #e2e8f0;

    --text-dark: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;

    --topbar-height: 64px;
    --sidebar-collapsed-width: 68px;
    --sidebar-expanded-width: 270px;
    --sidebar-gap: 16px;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables - Synchronous Instant Render Protection */
html.dark-mode,
body.dark-mode {
    --bg-page: #0e0e11;
    --bg-surface: #18181a;
    --bg-sidebar: #18181a;
    --bg-hover: #242429;
    --border-color: rgba(255, 255, 255, 0.08);

    --text-dark: #ffffff;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.18);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

html.dark-mode body {
    background-color: #0e0e11 !important;
    color: #f1f5f9 !important;
}

/* Dark Mode Overrides for 100% Visual Harmony */
html.dark-mode .topbar,
body.dark-mode .topbar {
    background: #141416;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark-mode .sidebar,
body.dark-mode .sidebar {
    background: #18181a;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html.dark-mode .sidebar-handle-toggle,
body.dark-mode .sidebar-handle-toggle {
    background: #18181a;
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

html.dark-mode .sidebar-link.active,
body.dark-mode .sidebar-link.active {
    background: #252538;
    color: #818cf8;
    font-weight: 700;
}

html.dark-mode .search-box input,
body.dark-mode .search-box input {
    background: #121215;
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

html.dark-mode .search-box input:focus,
body.dark-mode .search-box input:focus {
    border-color: #6366f1;
    background: #18181a;
}

html.dark-mode .form-control,
body.dark-mode .form-control {
    background: #121215;
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

html.dark-mode .form-control:focus,
body.dark-mode .form-control:focus {
    background: #18181a;
    border-color: #6366f1;
}

html.dark-mode .hero-banner,
body.dark-mode .hero-banner {
    background: linear-gradient(135deg, #14141e 0%, #1e1e2d 50%, #12121a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

html.dark-mode .feature-pill-card,
html.dark-mode .prod-card,
html.dark-mode .bottom-stats-bar,
html.dark-mode .admin-card,
html.dark-mode .prod-detail-section-card,
html.dark-mode .prod-purchase-sticky-card,
body.dark-mode .feature-pill-card,
body.dark-mode .prod-card,
body.dark-mode .bottom-stats-bar,
body.dark-mode .admin-card,
body.dark-mode .prod-detail-section-card,
body.dark-mode .prod-purchase-sticky-card {
    background: #18181a;
    border-color: rgba(255, 255, 255, 0.08);
}

html.dark-mode .prod-thumb-wrap,
html.dark-mode .prod-detail-preview-box,
body.dark-mode .prod-thumb-wrap,
body.dark-mode .prod-detail-preview-box {
    background: #0e0e11;
}

html.dark-mode .tech-icon-badge,
html.dark-mode .tech-badge-item,
html.dark-mode .license-info-box,
body.dark-mode .tech-icon-badge,
body.dark-mode .tech-badge-item,
body.dark-mode .license-info-box {
    background: #121215;
    border-color: rgba(255, 255, 255, 0.08);
}

html.dark-mode .profile-dropdown-menu,
body.dark-mode .profile-dropdown-menu {
    background: #18181a;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

/* Category Filter Box Layout */
.category-filter-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm);
}

.filter-pills-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    max-width: 100%;
}

/* Team Cards Grid - 4 Columns Desktop */
.team-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1100px) {
    .team-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .team-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .team-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Ultra Modern Glassmorphic Bottom Stats Bar */
.bottom-stats-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.bottom-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.bottom-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    flex-shrink: 0;
}

.stat-num {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 2px;
}

.num-purple { background: linear-gradient(135deg, #818cf8, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.num-green { background: linear-gradient(135deg, #34d399, #10b981); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.num-blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.num-orange { background: linear-gradient(135deg, #fbbf24, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Product Detail Page Showcase Layout & Responsive Optimization */
.prod-detail-container {
    max-width: 1100px;
    margin: 0 auto;
}

.prod-breadcrumb {
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.prod-breadcrumb a {
    color: var(--text-muted);
}

.prod-breadcrumb span {
    color: var(--text-dark);
    font-weight: 700;
}

.prod-detail-header {
    margin-bottom: 20px;
}

.category-badge-pill {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--primary-light);
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: inline-block;
}

.prod-detail-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    margin: 0;
}

.prod-showcase-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
}

.prod-detail-preview-box {
    background: #0f172a;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.prod-detail-preview-box img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

.prod-detail-section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.prod-detail-section-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.prod-detail-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-line;
}

.features-check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.features-check-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.features-check-list li i {
    color: #10b981;
    margin-top: 3px;
    flex-shrink: 0;
}

.prod-purchase-sticky-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--topbar-height) + 20px);
}

.price-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}

.price-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
}

.price-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
}

.license-info-box {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    background: var(--bg-page);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.license-info-box i {
    color: #f59e0b;
    margin-inline-end: 4px;
}

.action-buttons-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.buy-now-btn, .demo-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.92rem;
}

.demo-btn {
    background: var(--bg-page);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.prod-specs-list {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.82rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
}

.spec-item span {
    color: var(--text-muted);
}

.tech-stack-wrap {
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.tech-stack-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.tech-stack-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-badge-item {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
}

.mobile-action-card {
    display: none;
}

.desktop-action-card {
    display: block;
}

/* Base resets & Strict Overflow Protection */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
}

body {
    font-family: var(--font-en);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

[dir="rtl"] body {
    font-family: var(--font-ar);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Form Controls & Input Styling */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.92rem;
    color: var(--text-dark);
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Custom File Upload Input Button */
input[type="file"].form-control {
    padding: 8px 12px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    margin-inline-end: 12px;
    transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
    opacity: 0.9;
}

/* App Layout Wrapper */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
}

/* Topbar Header Bar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.topbar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

[dir="ltr"] .search-box i { left: 14px; }
[dir="rtl"] .search-box i { right: 14px; }

.search-box input {
    width: 100%;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.88rem;
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
}

[dir="ltr"] .search-box input { padding-left: 40px; }
[dir="rtl"] .search-box input { padding-right: 40px; }

.search-box input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.action-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

/* User Profile Dropdown Menu in Topbar */
.profile-dropdown-container {
    position: relative;
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    z-index: 1050;
    padding: 8px 0;
}

[dir="ltr"] .profile-dropdown-menu { right: 0; left: auto; }
[dir="rtl"] .profile-dropdown-menu { left: 0; right: auto; }

.profile-dropdown-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-header-box {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.dropdown-header-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-dark);
}

.dropdown-header-email {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dropdown-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition);
}

.dropdown-item-link:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.dropdown-item-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 998;
    transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
    .app-layout.sidebar-expanded .sidebar-backdrop,
    html.sidebar-expanded .app-layout .sidebar-backdrop {
        display: block;
        z-index: 998 !important;
    }
}

/* Floating Sidebar Column */
.sidebar {
    width: var(--sidebar-collapsed-width);
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: calc(var(--topbar-height) + var(--sidebar-gap));
    bottom: var(--sidebar-gap);
    z-index: 999;
    transition: var(--transition);
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[dir="ltr"] .sidebar { left: var(--sidebar-gap); right: auto; }
[dir="rtl"] .sidebar { right: var(--sidebar-gap); left: auto; }

.sidebar.expanded,
html.sidebar-expanded .sidebar {
    width: var(--sidebar-expanded-width);
    padding: 12px 10px;
}

/* SEAMLESS INTEGRATED EDGE TOGGLE */
.sidebar-handle-toggle {
    position: absolute;
    top: 24px;
    width: 24px;
    height: 44px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
    z-index: 1001;
}

[dir="ltr"] .sidebar-handle-toggle {
    right: -23px;
    border-left: none;
    border-radius: 0 20px 20px 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
}

[dir="rtl"] .sidebar-handle-toggle {
    left: -23px;
    border-right: none;
    border-radius: 20px 0 0 20px;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-handle-toggle:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

[dir="ltr"] .sidebar.expanded .sidebar-handle-toggle i,
[dir="ltr"] html.sidebar-expanded .sidebar-handle-toggle i { transform: rotate(180deg); }

[dir="rtl"] .sidebar.expanded .sidebar-handle-toggle i,
[dir="rtl"] html.sidebar-expanded .sidebar-handle-toggle i { transform: rotate(180deg); }

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding-inline-end: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
    height: 0;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: var(--transition);
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link span {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar.expanded .sidebar-link span,
html.sidebar-expanded .sidebar .sidebar-link span {
    display: inline;
    opacity: 1;
}

/* Fixed Bottom Sidebar Footer (Pinned Logout) */
.sidebar-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.sidebar-link.logout-link {
    color: #ef4444 !important;
}

.sidebar-link.logout-link:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

/* Sidebar Submenu Group */
.sidebar-submenu {
    display: none;
    list-style: none;
    padding-inline-start: 14px;
    margin-top: 2px;
    flex-direction: column;
    gap: 2px;
}

.sidebar-submenu .sidebar-link {
    padding: 6px 10px;
    font-size: 0.82rem;
}

.sidebar-submenu.show {
    display: flex;
}

.sidebar-dropdown-toggle.open .submenu-arrow {
    transform: rotate(180deg);
}

/* Main Content Wrapper */
.main-wrapper {
    flex-grow: 1;
    margin-top: var(--topbar-height);
    transition: var(--transition);
    min-width: 0;
}

[dir="ltr"] .main-wrapper { margin-left: calc(var(--sidebar-collapsed-width) + (var(--sidebar-gap) * 2)); }
[dir="rtl"] .main-wrapper { margin-right: calc(var(--sidebar-collapsed-width) + (var(--sidebar-gap) * 2)); }

[dir="ltr"] .app-layout.sidebar-expanded .main-wrapper,
[dir="ltr"] html.sidebar-expanded .main-wrapper { margin-left: calc(var(--sidebar-expanded-width) + (var(--sidebar-gap) * 2)); }

[dir="rtl"] .app-layout.sidebar-expanded .main-wrapper,
[dir="rtl"] html.sidebar-expanded .main-wrapper { margin-right: calc(var(--sidebar-expanded-width) + (var(--sidebar-gap) * 2)); }

.page-body {
    padding: 32px;
}

/* Dashboard Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, #0e0a29 0%, #200f45 50%, #150930 100%);
    border-radius: var(--radius-lg);
    padding: 44px 48px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 10, 41, 0.3);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #ffffff;
}

.hero-title span { color: #a5b4fc; }

.hero-desc {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 460px;
}

.btn-hero {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.hero-mockup-container {
    display: flex;
    justify-content: center;
}

.hero-mockup-container img {
    max-height: 240px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
}

/* Feature 5 Pills Grid */
.feature-pills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.feature-pill-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.feature-pill-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.pill-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.pill-text h5 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.pill-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Section Heading Bar */
.section-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-top-bar h3 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
}

.view-all-btn {
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* PRODUCTS GRID: 3 DESKTOP / STRICTLY 2 MOBILE */
.products-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.prod-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.prod-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(99, 102, 241, 0.3);
}

.prod-thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0f172a;
    overflow: hidden;
}

.prod-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.prod-card:hover .prod-thumb-wrap img { transform: scale(1.04); }

.card-badge-pill {
    position: absolute;
    top: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    z-index: 2;
}

[dir="ltr"] .card-badge-pill { left: 10px; }
[dir="rtl"] .card-badge-pill { right: 10px; }

/* Heart Bookmark Icon */
.card-heart-btn {
    position: absolute;
    top: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 2;
}

[dir="ltr"] .card-heart-btn { right: 10px; }
[dir="rtl"] .card-heart-btn { left: 10px; }

.badge-purple { background: #6366f1; }
.badge-green { background: #10b981; }
.badge-blue { background: #3b82f6; }

.prod-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.prod-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3px;
    line-height: 1.3;
}

.prod-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.prod-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.prod-card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.prod-card-rating {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.prod-card-rating i { color: #f59e0b; }

.prod-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.tech-icons-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tech-icon-badge {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.more-dots-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.stat-circle-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.icon-purple { background: rgba(99, 102, 241, 0.14); color: #818cf8; }
.icon-green { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.icon-blue { background: rgba(59, 130, 246, 0.14); color: #60a5fa; }
.icon-orange { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }

.bottom-stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Mobile Sticky Bottom Nav Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    flex: 1;
    text-align: center;
    min-width: 0;
}

.mobile-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
    font-size: 0.68rem;
}

.mobile-nav-item i {
    font-size: 1.1rem;
}

.mobile-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

/* MOBILE RESPONSIVE MEDIA QUERIES */
@media (max-width: 768px) {
    .topbar {
        height: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .topbar-brand { order: 1; }
    .topbar-actions { order: 2; }

    .search-box {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .main-wrapper {
        margin-top: 110px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Mobile Sidebar Stops Cleanly Above Bottom Nav (Height: 60px) */
    .sidebar {
        top: calc(110px + var(--sidebar-gap));
        bottom: calc(60px + var(--sidebar-gap)) !important;
        z-index: 999 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
        transform: none !important;
    }

    [dir="ltr"] .sidebar {
        left: calc(-1 * var(--sidebar-collapsed-width));
        right: auto;
    }

    [dir="rtl"] .sidebar {
        right: calc(-1 * var(--sidebar-collapsed-width));
        left: auto;
    }

    [dir="ltr"] .sidebar.expanded,
    [dir="ltr"] html.sidebar-expanded .sidebar {
        left: var(--sidebar-gap);
    }

    [dir="rtl"] .sidebar.expanded,
    [dir="rtl"] html.sidebar-expanded .sidebar {
        right: var(--sidebar-gap);
    }

    .page-body {
        padding: 16px;
        padding-bottom: 80px;
    }

    /* Minimalist Mobile Category Filter Bar Styling */
    .category-filter-box {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin-bottom: 16px !important;
    }

    .category-filter-box .filter-header-info {
        display: none !important;
    }

    .filter-pills-row {
        width: 100%;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding: 4px 0 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-pills-row::-webkit-scrollbar {
        display: none;
    }

    .profile-grid-2col {
        grid-template-columns: 1fr !important;
    }

    .section-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-top-bar > div:last-child {
        width: 100%;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .section-top-bar .btn-hero {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
        flex-shrink: 0;
    }

    /* Mobile Hero Banner Optimization - Image First, Text Second */
    .hero-banner {
        display: flex !important;
        flex-direction: column !important;
        padding: 20px 16px !important;
        border-radius: var(--radius-md) !important;
        text-align: center !important;
        align-items: center !important;
    }

    .hero-mockup-container {
        order: 1 !important;
        display: flex !important;
        justify-content: center !important;
        margin-bottom: 16px !important;
        margin-top: 0 !important;
        width: 100% !important;
    }

    .hero-mockup-container img {
        max-height: 140px !important;
        object-fit: contain !important;
    }

    .hero-content {
        order: 2 !important;
        width: 100% !important;
    }

    .hero-title {
        font-size: 1.25rem !important;
        line-height: 1.35 !important;
        margin-bottom: 8px !important;
    }

    .hero-desc {
        font-size: 0.8rem !important;
        line-height: 1.45 !important;
        margin-bottom: 16px !important;
        max-width: 100% !important;
    }

    .hero-banner .btn-hero {
        padding: 8px 18px !important;
        font-size: 0.82rem !important;
        margin: 0 auto !important;
    }

    /* Mobile Product Detail Layout Optimization */
    .prod-showcase-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .prod-detail-header {
        margin-bottom: 14px !important;
        text-align: start !important;
    }

    .prod-detail-title {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
    }

    .prod-detail-preview-box {
        margin-bottom: 14px !important;
        border-radius: var(--radius-md) !important;
    }

    .prod-detail-preview-box img {
        max-height: 240px !important;
    }

    .mobile-action-card {
        display: block !important;
        position: static !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: var(--radius-md) !important;
    }

    .mobile-action-card .price-header-row {
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    .mobile-action-card .price-amount {
        font-size: 1.6rem !important;
    }

    .mobile-action-card .action-buttons-wrap {
        flex-direction: row !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
    }

    .mobile-action-card .buy-now-btn,
    .mobile-action-card .demo-btn {
        flex: 1 !important;
        padding: 10px 8px !important;
        font-size: 0.82rem !important;
    }

    .desktop-action-card {
        display: none !important;
    }

    .prod-detail-section-card {
        padding: 18px !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 14px !important;
    }

    .prod-detail-section-card h3 {
        font-size: 1.05rem !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
    }

    .prod-detail-text {
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
    }

    /* Hide 5 Features Section on Mobile Screens for Clean UI */
    .feature-pills-grid {
        display: none !important;
    }

    .products-cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .prod-card-body {
        padding: 12px;
    }

    .prod-card-title {
        font-size: 0.85rem;
    }

    .prod-card-sub {
        font-size: 0.72rem;
        margin-bottom: 8px;
    }

    .bottom-stats-bar {
        padding: 18px 16px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        border-radius: var(--radius-md);
    }

    .bottom-stat-divider {
        display: none;
    }

    .bottom-stat-item {
        justify-content: flex-start;
        gap: 12px;
    }

    .stat-num {
        font-size: 1.15rem;
    }

    .mobile-bottom-nav {
        display: flex;
    }
}
