/* ============================================================
   Theme Main Styles - RomanCity (Material Design)
   Version: 1.5.0 (Updated with Flat Grid & Material Fixes)
   ============================================================ */

/* ============================================================
   CSS Variables (Design Tokens) - Material Palette
   ============================================================ */
:root {
    --rc-primary: #8E24AA;
    --rc-primary-dark: #6A1B9A;
    --rc-primary-light: #AB47BC;
    --rc-primary-surface: #F3E5F5;
    --rc-primary-text: #FFFFFF;

    --rc-secondary: #FFB300;
    --rc-secondary-dark: #FF8F00;
    --rc-secondary-light: #FFCA28;
    --rc-secondary-surface: #FFF8E1;

    --rc-bg: #FAFAFA;
    --rc-surface: #FFFFFF;
    --rc-surface-dark: #212121;
    --rc-text: #212121;
    --rc-text-secondary: #757575;
    --rc-text-hint: #9E9E9E;
    --rc-divider: #E0E0E0;

    /* Material Shadows (Elevations) */
    --rc-shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --rc-shadow-2: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    --rc-shadow-3: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --rc-shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    --rc-shadow-5: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);

    /* Border Radius */
    --rc-radius-sm: 8px;
    --rc-radius-md: 12px;
    --rc-radius-lg: 16px;
    --rc-radius-btn: 24px; /* کپسولی */

    --rc-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --rc-font: "Vazirmatn", "Segoe UI", Tahoma, Arial, sans-serif;
}

/* ============================================================
   Reset & Base
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: var(--rc-font);
    font-size: 15px;
    line-height: 1.8;
    background: var(--rc-bg);
    color: var(--rc-text);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Typography & Links
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    color: var(--rc-text);
    margin-bottom: 12px;
}
h1 { font-size: 2rem; color: var(--rc-primary-dark); }
h2 { font-size: 1.6rem; color: var(--rc-primary); }
h3 { font-size: 1.3rem; }
a {
    color: var(--rc-primary);
    text-decoration: none;
    transition: color var(--rc-transition);
}
a:hover {
    color: var(--rc-primary-dark);
}

/* Reset Lists */
ul, ol {
    list-style: none;
}
.rc-product-content ul,
.rc-post-content ul,
.md-page-description ul {
    list-style: disc;
    padding-right: 24px;
    margin: 16px 0;
    color: var(--rc-text-secondary);
}
.rc-product-content ol,
.rc-post-content ol,
.md-page-description ol {
    list-style: decimal;
    padding-right: 24px;
    margin: 16px 0;
    color: var(--rc-text-secondary);
}
.rc-product-content li,
.rc-post-content li,
.md-page-description li {
    margin-bottom: 8px;
}

/* ============================================================
   Container
   ============================================================ */
.rc-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* ============================================================
   Material Buttons & Ripples
   ============================================================ */
.rc-add-to-cart,
.rc-btn,
button[type="submit"],
input[type="submit"],
.button,
.checkout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--rc-secondary);
    color: var(--rc-text) !important;
    padding: 12px 28px;
    border: none;
    border-radius: var(--rc-radius-btn);
    font-weight: 600;
    font-family: inherit;
    font-size: 14px;
    box-shadow: var(--rc-shadow-1);
    cursor: pointer;
    transition: all var(--rc-transition);
    position: relative;
    overflow: hidden;
}
.rc-add-to-cart:hover,
.rc-btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.button:hover,
.checkout-button:hover {
    box-shadow: var(--rc-shadow-2);
    background-color: var(--rc-secondary-dark);
    transform: translateY(-2px);
}
.button:disabled,
button[type="submit"]:disabled,
input[type="submit"]:disabled {
    background-color: var(--rc-divider) !important;
    color: var(--rc-text-hint) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

.md-icon-button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background var(--rc-transition);
    font-size: 20px;
}
.md-icon-button:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ============================================================
   Header (App Bar) - Material Design
   ============================================================ */
.md-header {
    background-color: var(--rc-primary);
    color: var(--rc-primary-text);
    box-shadow: var(--rc-shadow-2);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.md-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.md-logo a {
    color: var(--rc-primary-text);
    font-size: 22px;
    font-weight: bold;
}
.md-logo img {
    max-height: 40px;
    border-radius: 0;
}

.md-desktop-nav {
    flex-grow: 1;
    margin-right: 32px;
    display: none;
}
@media (min-width: 992px) {
    .md-desktop-nav {
        display: block;
    }
    .js-mobile-menu-trigger {
        display: none;
    }
}
.md-nav-list {
    display: flex;
    gap: 8px;
}
.md-nav-list li a {
    color: var(--rc-primary-text);
    padding: 10px 16px;
    border-radius: var(--rc-radius-btn);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background var(--rc-transition);
}
.md-nav-list li a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.md-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.md-header-actions .md-icon-button {
    color: var(--rc-primary-text);
}
.rc-menu-top {
    display: flex;
    align-items: center;
    gap: 16px;
}
.rc-menu-top li a {
    color: var(--rc-primary-text);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.rc-menu-top li.rc-cart a span {
    background: var(--rc-secondary);
    color: var(--rc-text);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    margin-right: 4px;
    font-weight: bold;
}

/* Unified Search Bar */
.md-search-bar {
    background: var(--rc-surface);
    box-shadow: var(--rc-shadow-2);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 16px 0;
    z-index: 999;
    display: none;
}
.md-search-bar .rc-search form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}
.md-search-bar input {
    width: 100%;
    padding: 14px 24px;
    border: 1px solid var(--rc-divider);
    border-radius: var(--rc-radius-btn);
    background: var(--rc-bg);
    font-family: inherit;
    font-size: 14px;
}
.md-search-bar input:focus {
    border-color: var(--rc-primary);
    background: var(--rc-surface);
    box-shadow: 0 0 0 2px var(--rc-primary-surface);
}
.md-search-bar button {
    position: absolute;
    left: 6px;
    top: 6px;
    background: var(--rc-primary);
    color: var(--rc-primary-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ============================================================
   FIX: Account Dropdown Menu (Fixed visibility issues)
   ============================================================ */
.rc-menu-account {
    position: relative;
}
.rc-menu-account > li {
    position: relative;
}
.rc-account-dropdown {
    position: absolute !important;
    top: calc(100% + 15px);
    left: 0;
    background: var(--rc-surface);
    color: var(--rc-text);
    min-width: 280px;
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-3);
    z-index: 99999;
    padding: 16px;
    border: 1px solid var(--rc-divider);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--rc-transition);
    display: block !important; 
}
.rc-menu-account > li:hover .rc-account-dropdown,
.rc-account-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.rc-account-dropdown form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rc-bg);
}
.rc-account-dropdown input[type="text"],
.rc-account-dropdown input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--rc-divider);
    border-radius: var(--rc-radius-sm);
    background: var(--rc-bg);
}
.rc-account-dropdown input:focus {
    border-color: var(--rc-primary);
}
.rc-account-dropdown button {
    width: 100%;
    background: var(--rc-primary);
    color: #fff;
    border-radius: var(--rc-radius-sm);
    padding: 12px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background var(--rc-transition);
}
.rc-account-dropdown button:hover {
    background: var(--rc-primary-dark);
}
.rc-account-dropdown li {
    padding: 8px 0;
    border: none;
}
.rc-account-dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rc-text-secondary);
    font-weight: 500;
    transition: color var(--rc-transition);
}
.rc-account-dropdown li a:hover {
    color: var(--rc-primary);
}
.rc-account-dropdown li i {
    width: 20px;
    text-align: center;
    color: var(--rc-divider);
}
.rc-account-dropdown li:hover i {
    color: var(--rc-primary);
}
.rc-account-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--rc-surface);
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.05));
}

/* ============================================================
   Mobile Drawer (Navigation Menu)
   ============================================================ */
.md-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
}
.md-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--rc-surface);
    z-index: 1002;
    box-shadow: var(--rc-shadow-4);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.md-drawer.is-open {
    right: 0;
}
.md-drawer-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--rc-divider);
    background: var(--rc-primary);
    color: var(--rc-primary-text);
}
.md-drawer-header .md-icon-button {
    color: var(--rc-primary-text);
}
.md-drawer-nav li a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: var(--rc-text);
    font-weight: 500;
    border-bottom: 1px solid var(--rc-bg);
    transition: background var(--rc-transition);
}
.md-drawer-nav li a:hover {
    background: var(--rc-primary-surface);
    color: var(--rc-primary);
}
.md-drawer-nav ul {
    display: none;
    background: var(--rc-bg);
}
.md-drawer-nav ul li a {
    padding-right: 56px;
    font-weight: normal;
    font-size: 14px;
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
.rc-breadcrumbs {
    background: transparent;
    padding: 16px 0;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--rc-text-hint);
}
.rc-breadcrumbs-icon {
    color: var(--rc-primary);
    font-size: 16px;
}
.rc-breadcrumb-trail a,
.rank-math-breadcrumb a {
    color: var(--rc-text-secondary);
    transition: color var(--rc-transition);
}
.rc-breadcrumb-trail a:hover,
.rank-math-breadcrumb a:hover {
    color: var(--rc-primary);
}
.rc-breadcrumb-sep,
.rank-math-breadcrumb .separator {
    color: var(--rc-divider);
    margin: 0 8px;
}
.rc-breadcrumb-current,
.rank-math-breadcrumb .last {
    color: var(--rc-text);
    font-weight: 600;
}

/* ============================================================
   Material Components (Global)
   ============================================================ */
.md-card {
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-1);
    transition: box-shadow var(--rc-transition), transform var(--rc-transition);
    overflow: hidden;
    margin-bottom: 24px;
}
.md-page-header {
    padding: 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--rc-surface) 0%, var(--rc-bg) 100%);
    border-bottom: 3px solid var(--rc-primary);
}
.md-page-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--rc-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.md-page-title i {
    color: var(--rc-primary);
}
.md-page-description {
    color: var(--rc-text-secondary);
    font-size: 15px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}
.md-archive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--rc-surface);
    border-radius: var(--rc-radius-sm);
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.md-archive-count {
    font-weight: 600;
    color: var(--rc-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.md-archive-count i {
    color: var(--rc-primary);
}

/* --- Material Pagination --- */
.md-pagination-wrap {
    margin: 40px 0;
    text-align: center;
}
.md-pagination {
    display: inline-flex;
    align-items: center;
    background: var(--rc-surface);
    padding: 8px 16px;
    border-radius: var(--rc-radius-btn);
    box-shadow: var(--rc-shadow-1);
    gap: 8px;
}
.md-pagination a, 
.md-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--rc-radius-btn);
    font-weight: 600;
    font-size: 14px;
    color: var(--rc-text);
    text-decoration: none;
    transition: all var(--rc-transition);
}
.md-pagination a:hover {
    background: var(--rc-primary-surface);
    color: var(--rc-primary);
}
.md-pagination span.current {
    background: var(--rc-primary);
    color: #fff;
    box-shadow: var(--rc-shadow-1);
}
.md-pagination-info {
    margin-left: 16px;
    color: var(--rc-text-hint);
    font-size: 13px;
}

/* ============================================================
   Flat Genre Grid (Homepage & Category Page)
   ============================================================ */
.md-categories-wrapper .md-section-title,
.rc-category-section .rc-section-title {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--rc-text);
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    padding-bottom: 0;
}
.md-categories-wrapper .md-section-title i,
.rc-category-section .rc-section-title i {
    color: var(--rc-primary);
}

.md-genre-grid,
.md-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.md-genre-card,
.md-cat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    transition: all var(--rc-transition);
    border: 1px solid var(--rc-divider);
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
}
.md-genre-card:hover,
.md-cat-card:hover {
    border-color: var(--rc-primary-light);
    background: #fffaf9; 
    box-shadow: var(--rc-shadow-2);
    transform: translateY(-2px);
}
.md-genre-icon,
.md-cat-icon {
    width: 56px;
    height: 56px;
    background: var(--rc-primary-surface);
    color: var(--rc-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-left: 16px; /* RTL margin */
    transition: all var(--rc-transition);
}
.md-genre-card:hover .md-genre-icon,
.md-cat-card:hover .md-cat-icon {
    background: var(--rc-primary);
    color: #fff;
    transform: scale(1.05);
}
.md-genre-content,
.md-cat-info {
    flex-grow: 1;
    text-align: right;
}
.md-genre-title,
.md-cat-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--rc-text);
}
.md-genre-count,
.md-cat-count {
    font-size: 13px;
    color: var(--rc-text-secondary);
    background: transparent;
    padding: 0;
}
.md-genre-arrow,
.md-cat-action {
    color: var(--rc-divider);
    font-size: 14px;
    transition: all var(--rc-transition);
}
.md-genre-card:hover .md-genre-arrow,
.md-cat-card:hover .md-cat-action {
    color: var(--rc-primary);
    transform: translateX(-4px); /* RTL Slide */
}

/* ============================================================
   Authors Grid
   ============================================================ */
.md-authors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}
.md-author-card:hover {
    box-shadow: var(--rc-shadow-2);
    transform: translateY(-4px);
    border-color: var(--rc-primary-light);
}
.md-author-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 0;
    text-decoration: none;
    height: 100%;
}
.md-author-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--rc-primary) 0%, var(--rc-primary-light) 100%);
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(142, 36, 170, 0.2);
}
.md-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}
.md-author-info {
    text-align: center;
    margin-bottom: 16px;
}
.md-author-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--rc-text);
    margin-bottom: 8px;
}
.md-author-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--rc-bg);
    padding: 4px 12px;
    border-radius: var(--rc-radius-md);
    font-size: 12px;
    color: var(--rc-text-secondary);
}
.md-author-bio {
    text-align: center;
    font-size: 14px;
    color: var(--rc-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}
.md-author-action {
    width: 100%;
    padding: 16px;
    background: var(--rc-bg);
    color: var(--rc-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background var(--rc-transition);
    border-top: 1px solid var(--rc-divider);
}
.md-author-card:hover .md-author-action {
    background: var(--rc-primary);
    color: #fff;
}

/* ============================================================
   Empty States & 404 Page
   ============================================================ */
.md-empty-state {
    padding: 64px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.md-empty-icon {
    font-size: 64px;
    color: var(--rc-divider);
    margin-bottom: 20px;
}
.md-empty-state h3 {
    font-size: 22px;
    color: var(--rc-text);
    margin-bottom: 12px;
}
.md-empty-state p {
    color: var(--rc-text-secondary);
    max-width: 500px;
}
.md-warning-state .md-empty-icon {
    color: var(--rc-secondary);
}

.md-404-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}
.md-404-card {
    padding: 64px 40px;
    max-width: 600px;
    text-align: center;
    margin: 0 auto;
}
.md-404-illustration {
    margin-bottom: 24px;
}
.md-404-heading {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--rc-primary) 0%, var(--rc-primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    text-shadow: 0 10px 20px rgba(142, 36, 170, 0.1);
}
.md-404-icon-wrap {
    font-size: 32px;
    color: var(--rc-divider);
    margin-bottom: 16px;
}
.md-404-title {
    font-size: 24px;
    color: var(--rc-text);
    margin-bottom: 16px;
}
.md-404-description {
    color: var(--rc-text-secondary);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 32px;
}
.md-404-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.md-btn-raised {
    background: var(--rc-primary);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: var(--rc-radius-sm);
    box-shadow: 0 4px 10px rgba(142, 36, 170, 0.3);
    transition: all var(--rc-transition);
    border: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.md-btn-raised:hover {
    background: var(--rc-primary-dark);
    box-shadow: 0 6px 15px rgba(142, 36, 170, 0.4);
}
.md-btn-outline {
    background: transparent;
    color: var(--rc-text-secondary);
    border: 2px solid var(--rc-divider);
    padding: 10px 24px;
    border-radius: var(--rc-radius-sm);
    transition: all var(--rc-transition);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.md-btn-outline:hover {
    background: var(--rc-bg);
    border-color: var(--rc-text-hint);
    color: var(--rc-text);
}

/* ============================================================
   Owl Carousel Structural & Material Overrides
   ============================================================ */
.owl-carousel {
    display: none;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}
.owl-carousel.owl-loaded {
    display: block;
}
.owl-carousel .owl-stage {
    position: relative;
    -ms-touch-action: pan-Y;
    touch-action: manipulation;
    -moz-backface-visibility: hidden;
    display: flex;
    align-items: stretch;
}
.owl-carousel .owl-stage:after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}
.owl-carousel .owl-stage-outer {
    position: relative;
    overflow: hidden;
    padding: 10px 5px 20px 5px;
    margin: -10px -5px -20px -5px;
}
.owl-carousel .owl-item {
    position: relative;
    min-height: 1px;
    display: flex;
    float: none !important;
}
.owl-carousel .item {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Placeholder قبل از لود JS */
.rc-product-carousel-slider:not(.owl-loaded) {
    display: flex;
    overflow: hidden;
    gap: 24px;
    padding: 10px 0;
}
.rc-product-carousel-slider:not(.owl-loaded) .item {
    flex: 0 0 calc(25% - 18px);
}

/* دکمه‌های ناوبری کاروسل */
.rc-product-carousel-slider .owl-nav {
    position: absolute;
    top: -70px;
    left: 20px;
    display: flex;
    gap: 8px;
    margin: 0;
}
.rc-product-carousel-slider .owl-nav button.owl-prev,
.rc-product-carousel-slider .owl-nav button.owl-next {
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    background: var(--rc-surface) !important;
    color: var(--rc-primary) !important;
    box-shadow: var(--rc-shadow-1);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    transition: all var(--rc-transition) !important;
    border: 1px solid var(--rc-divider) !important;
    cursor: pointer;
}
.rc-product-carousel-slider .owl-nav button.owl-prev:hover,
.rc-product-carousel-slider .owl-nav button.owl-next:hover {
    background: var(--rc-primary) !important;
    color: #fff !important;
    box-shadow: var(--rc-shadow-2);
    border-color: var(--rc-primary) !important;
    transform: translateY(-2px);
}
.rc-product-carousel-slider .owl-nav button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--rc-bg) !important;
    color: var(--rc-text-hint) !important;
    box-shadow: none;
    border-color: transparent !important;
    transform: none;
}
.owl-theme .owl-dots {
    text-align: center;
    margin-top: 16px;
}
.owl-theme .owl-dots .owl-dot {
    display: inline-block;
    zoom: 1;
    background: transparent;
    border: none;
    padding: 0;
}
.owl-theme .owl-dots .owl-dot span {
    width: 10px;
    height: 10px;
    margin: 5px 6px;
    background: var(--rc-divider);
    display: block;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.owl-theme .owl-dots .owl-dot.active span,
.owl-theme .owl-dots .owl-dot:hover span {
    background: var(--rc-primary);
    transform: scale(1.3);
}

/* ============================================================
   Product Cards
   ============================================================ */
.rc-block {
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-1);
    padding: 32px;
    margin-bottom: 32px;
}
.rc-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--rc-divider);
    padding-bottom: 12px;
}
.rc-block-header .rc-section-title {
    border: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rc-section-title i {
    color: var(--rc-primary);
    font-size: 24px;
}
.rc-section-title-link a {
    background: var(--rc-primary-surface);
    color: var(--rc-primary);
    padding: 8px 20px;
    border-radius: var(--rc-radius-btn);
    font-size: 13px;
    font-weight: bold;
    transition: var(--rc-transition);
}

/* Material Product Grid Wrapper */
.md-product-grid,
.rc-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.rc-product-card {
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-1);
    transition: box-shadow var(--rc-transition), transform var(--rc-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    width: 100%;
    margin: 0;
    border: 1px solid transparent;
}
.rc-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--rc-shadow-3);
    border-color: var(--rc-primary-light);
}
.rc-product-card a {
    display: flex;
    flex-direction: column;
    color: var(--rc-text);
    height: 100%;
}
.rc-product-card img {
    width: 100%;
    height: auto;
    border-radius: var(--rc-radius-md) var(--rc-radius-md) 0 0;
    object-fit: cover;
    aspect-ratio: 3/4;
}
.rc-product-title {
    font-size: 15px;
    font-weight: 700;
    padding: 16px 20px 8px;
    margin: 0;
    color: var(--rc-text);
    line-height: 1.5;
}
.rc-product-meta {
    padding: 0 20px 20px;
    margin-top: auto;
    font-size: 13px;
    color: var(--rc-text-secondary);
}
.rc-product-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.rc-product-meta li i {
    color: var(--rc-text-hint);
    width: 16px;
    text-align: center;
}
.rc-product-meta li:last-child {
    color: var(--rc-primary-dark);
    font-weight: bold;
    font-size: 15px;
    margin-top: 12px;
}
.rc-product-sale,
.rc-product-sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #E53935;
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--rc-radius-btn);
    font-size: 12px;
    font-weight: bold;
    box-shadow: var(--rc-shadow-1);
    z-index: 2;
}

/* ============================================================
   Single Product Layout
   ============================================================ */
.rc-product-single {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 32px;
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-1);
    padding: 32px;
    margin-bottom: 32px;
}
.rc-product-image img {
    width: 100%;
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-2);
}
.rc-product-info h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--rc-text);
    margin-bottom: 24px;
}
.rc-product-info-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.rc-product-info-list div {
    background: var(--rc-bg);
    padding: 16px;
    border-radius: var(--rc-radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--rc-text-secondary);
}
.rc-product-info-list i {
    color: var(--rc-primary);
    font-size: 20px;
}
.rc-product-price-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    background: var(--rc-primary-surface);
    padding: 24px;
    border-radius: var(--rc-radius-md);
    border-right: 4px solid var(--rc-primary);
}
.rc-product-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--rc-primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Content Sections */
.rc-product-content,
.rc-download-section,
.rc-author-box,
.rc-error-404,
.rc-comments-section {
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-1);
    padding: 32px;
    margin-bottom: 32px;
}
.rc-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--rc-text);
    border-bottom: 1px solid var(--rc-divider);
    padding-bottom: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.rc-section-title i {
    color: var(--rc-primary);
    font-size: 28px;
}

/* Downloads */
.rc-download-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.rc-download-item a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--rc-bg);
    border-radius: var(--rc-radius-sm);
    border: 1px solid var(--rc-divider);
    color: var(--rc-text);
    font-weight: 600;
    transition: all var(--rc-transition);
}
.rc-download-item a:hover {
    background: var(--rc-primary-surface);
    border-color: var(--rc-primary-light);
    color: var(--rc-primary-dark);
    box-shadow: var(--rc-shadow-1);
}
.rc-download-item i {
    font-size: 24px;
    color: var(--rc-primary);
}
.rc-download-locked {
    background: var(--rc-secondary-surface);
    padding: 32px;
    border-radius: var(--rc-radius-sm);
    text-align: center;
    border: 1px dashed var(--rc-secondary);
}

/* ============================================================
   Post Meta + Social Share (یکپارچه)
   ============================================================ */
.rc-post-meta-bottom {
    background: var(--rc-surface);
    border-radius: var(--rc-radius-md);
    box-shadow: var(--rc-shadow-1);
    padding: 32px;
    margin-bottom: 32px;
}
.rc-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 32px;
    color: var(--rc-text-secondary);
    font-size: 14px;
    margin: 0 0 20px 0;
    padding: 0;
    list-style: none;
}
.rc-post-meta li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.rc-post-meta li i {
    color: var(--rc-primary);
    width: 18px;
    text-align: center;
    font-size: 15px;
}
.rc-post-meta li a {
    color: var(--rc-text-secondary);
    transition: color var(--rc-transition);
}
.rc-post-meta li a:hover {
    color: var(--rc-primary);
}

.rc-post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 16px 0 20px 0;
    border-top: 1px solid var(--rc-divider);
    margin: 0;
}
.rc-post-tags i {
    color: var(--rc-primary);
    font-size: 16px;
    margin-left: 4px;
}
.rc-post-tags a {
    background: var(--rc-bg);
    color: var(--rc-text-secondary);
    padding: 6px 16px;
    border-radius: var(--rc-radius-btn);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--rc-divider);
    transition: all var(--rc-transition);
}
.rc-post-tags a:hover {
    background: var(--rc-primary);
    color: #fff;
    border-color: var(--rc-primary);
    box-shadow: var(--rc-shadow-1);
    transform: translateY(-1px);
}

.rc-share-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rc-divider);
    margin: 0;
}
.rc-share-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--rc-text-secondary);
}
.rc-share-label i {
    color: var(--rc-primary);
    font-size: 16px;
}
.rc-share-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.rc-share-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--rc-bg);
    color: var(--rc-text-secondary);
    border-radius: 50%;
    transition: all var(--rc-transition);
    font-size: 15px;
    border: 1px solid transparent;
}
.rc-share-list a:hover {
    background: var(--rc-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: var(--rc-shadow-2);
    border-color: var(--rc-primary);
}
.rc-share-link {
    flex: 1;
    min-width: 140px;
}
.rc-share-link input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--rc-divider);
    border-radius: var(--rc-radius-sm);
    background: var(--rc-bg);
    font-size: 13px;
    color: var(--rc-text-secondary);
    direction: ltr;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--rc-transition), box-shadow var(--rc-transition);
}
.rc-share-link input:focus {
    border-color: var(--rc-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--rc-primary-surface);
}

/* ============================================================
   Author Box
   ============================================================ */
.rc-author-avatar {
    text-align: center;
    margin-bottom: 20px;
}
.rc-author-avatar img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    box-shadow: var(--rc-shadow-2);
}
.rc-author-desc {
    font-size: 15px;
    color: var(--rc-text-secondary);
    line-height: 1.8;
    text-align: center;
}
.rc-author-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}
.rc-author-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--rc-bg);
    border-radius: 50%;
    color: var(--rc-text-hint);
    transition: var(--rc-transition);
    font-size: 18px;
}
.rc-author-social a:hover {
    background: var(--rc-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--rc-shadow-1);
}

/* ============================================================
   Footer
   ============================================================ */
.rc-footer {
    background: var(--rc-surface);
    margin-top: 60px;
    border-top: 1px solid var(--rc-divider);
    padding-top: 48px;
}
.rc-footer-trust {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 48px;
}
.rc-footer-trust li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--rc-text-secondary);
}
.rc-footer-trust i {
    font-size: 40px;
    color: var(--rc-text-hint);
}
.rc-footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    border-top: 1px solid var(--rc-divider);
    padding: 48px 0;
}
.rc-footer-widget-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--rc-text);
    margin-bottom: 24px;
}
.rc-footer-widget ul li {
    margin-bottom: 12px;
}
.rc-footer-widget ul li a {
    color: var(--rc-text-secondary);
    transition: var(--rc-transition);
}
.rc-footer-widget ul li a:hover {
    color: var(--rc-primary);
    padding-right: 8px;
}
.rc-footer-bottom {
    border-top: 1px solid var(--rc-divider);
    padding: 48px 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}
.rc-footer-about-text {
    color: var(--rc-text-secondary);
    margin-bottom: 24px;
}
.rc-footer-address li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--rc-text-secondary);
}
.rc-footer-address i {
    color: var(--rc-primary);
    font-size: 18px;
}
.rc-footer-badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    background: var(--rc-bg);
    padding: 24px;
    border-radius: var(--rc-radius-md);
}

.rc-footer-bar {
    background: var(--rc-surface-dark);
    color: var(--rc-text-hint);
    padding: 20px 0;
    font-size: 14px;
}
.rc-footer-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.rc-footer-bar a {
    color: var(--rc-secondary);
    font-weight: bold;
}

/* ============================================================
   Go to Top Button (Material FAB)
   ============================================================ */
.rc-gototop {
    position: fixed;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background-color: var(--rc-primary);
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: var(--rc-shadow-3);
    transition: all var(--rc-transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}
.rc-gototop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.rc-gototop:hover {
    background-color: var(--rc-primary-dark);
    box-shadow: var(--rc-shadow-5);
    transform: translateY(-4px);
}
.rc-gototop-right {
    right: 24px;
}
.rc-gototop-left {
    left: 24px;
}

/* ============================================================
   Animations
   ============================================================ */
.rc-animate-fade-in {
    animation: rcFadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes rcFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Responsive Design & Breakpoints
   ============================================================ */
@media (max-width: 1024px) {
    .rc-product-carousel-slider:not(.owl-loaded) .item {
        flex: 0 0 calc(33.333% - 16px);
    }
}

@media (max-width: 840px) {
    .rc-product-single {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 24px;
    }
    .rc-product-image {
        max-width: 400px;
        margin: 0 auto;
    }
    .md-genre-grid,
    .md-category-grid,
    .md-authors-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .rc-product-carousel-slider:not(.owl-loaded) .item {
        flex: 0 0 calc(50% - 8px);
    }
    .rc-product-carousel-slider .owl-nav {
        display: none !important;
    }
    
    .md-page-header {
        padding: 24px 16px;
    }
    .md-page-title {
        font-size: 22px;
    }
    .md-archive-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    /* Responsive Go To Top */
    .rc-gototop {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 16px;
    }
    .rc-gototop-right {
        right: 16px;
    }
    .rc-gototop-left {
        left: 16px;
    }

    /* Responsive Footer */
    .rc-footer-bottom {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .rc-footer-trust {
        gap: 16px;
    }
    .rc-footer-trust li {
        font-size: 13px;
    }
    .rc-footer-trust i {
        font-size: 28px;
    }
    .rc-footer-widgets {
        gap: 32px;
    }
    .rc-footer-widget-title {
        font-size: 18px;
    }

    /* Responsive Post Meta & Share */
    .rc-post-meta {
        gap: 12px 20px;
        font-size: 13px;
    }
    .rc-share-wrapper {
        gap: 12px 16px;
    }
    .rc-share-list a {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .rc-share-link {
        min-width: 100px;
        flex-basis: 100%;
    }
    
    .md-404-heading {
        font-size: 80px;
    }
}

@media (max-width: 480px) {
    .rc-post-meta {
        gap: 8px 16px;
        font-size: 12px;
    }
    .rc-post-meta li i {
        width: 16px;
        font-size: 13px;
    }
    .rc-share-list a {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .rc-share-wrapper {
        gap: 10px 12px;
    }
    .rc-share-label {
        font-size: 13px;
    }
    .md-product-grid,
    .rc-product-grid {
        grid-template-columns: 1fr;
    }
    .md-genre-grid,
    .md-category-grid,
    .md-authors-grid {
        grid-template-columns: 1fr;
    }
}