/* index.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazir', sans-serif;
}

body {
    direction: rtl;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

/* کانتینر اصلی */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* هدر */
header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo-container {
    flex: 0 0 auto;
}

.logo-image {
    max-width: 150px;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.nav-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #0bb0a0;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-menu ul li a {
    text-decoration: none;
    color: #0bb0a0;
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-menu ul li a:hover {
    background-color: #0bb0a0;
    color: #fff;
}

.cart-link i {
    margin-left: 5px;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.contact-info p {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-info p:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.contact-info i {
    margin-left: 8px;
    color: #007bff;
}

.contact-info a {
    color: #007bff;
    text-decoration: none;
}

.contact-info a:hover {
    color: #0056b3;
}

/* نوار جستجو */
.search-bar-header {
    background-color: #f8f8f8;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#searchInput:focus {
    border-color: #0bb0a0;
    box-shadow: 0 0 5px rgba(11, 176, 160, 0.3);
    outline: none;
}

.clear-search-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.clear-search-btn:hover {
    color: #0bb0a0;
}

/* مودال جستجو */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1002;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    position: relative;
}

.close-btn {
    position: absolute;
    left: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #0bb0a0;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-result-item:hover {
    background-color: #f0f0f0;
}

/* اسلایدر */
.slider-section {
    padding: 30px 0;
}

.slider {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    flex: 0 0 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 12px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 20px;
    transition: background-color 0.3s;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev { right: 15px; }
.next { left: 15px; }

/* بخش اصلی محتوا */
.main-content-wrapper {
    display: flex;
    gap: 20px;
    padding: 20px 0;
}

.main-books-content {
    flex: 3;
}

.sidebar {
    flex: 1;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* بخش کتاب‌ها */
.books-section {
    padding: 30px 0;
}

.books-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #0bb0a0;
    border-bottom: 2px solid #0bb0a0;
    padding-bottom: 10px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    color: #6c757d;
    transition: all 0.3s ease;
}

.tab-button.active, .tab-button:hover {
    background-color: #0bb0a0;
    color: #fff;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.book {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.book-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 5px;
}

.book-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-image-container img:hover {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e69520;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
}

.book-info {
    flex-grow: 1;
    text-align: center;
    padding: 10px 0;
}

.book-info h3 {
    font-size: 16px;
    color: #0bb0a0;
    margin-bottom: 10px;
    height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.price-container {
    font-size: 16px;
    color: #20303e;
    margin-bottom: 10px;
}

.current-price {
    font-weight: bold;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.quantity-controls button {
    background-color: #0bb0a0;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.quantity-controls input {
    width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px;
}

.add-to-cart-btn {
    background-color: #0bb0a0;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #20303e;
}

.add-to-cart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* سایدبار */
.sidebar h3 {
    font-size: 20px;
    color: #0bb0a0;
    margin-bottom: 15px;
}

.category-tree {
    list-style: none;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: #f8f9fa;
}

.category-item.active {
    background-color: #e3f2fd;
    color: #007bff;
}

.category-name {
    flex: 1;
    text-align: right;
}

.book-count {
    background-color: #6c757d;
    color: #fff;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
}

.category-item.active .book-count {
    background-color: #0bb0a0;
}

.category-item.expandable::after {
    content: '▶';
    font-size: 12px;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.category-item.expanded::after {
    transform: rotate(90deg);
}

.subcategory-tree {
    margin-right: 20px;
    display: none;
}

.category-item.expanded .subcategory-tree {
    display: block;
}

.subcategory-tree .category-item {
    font-size: 14px;
    padding: 8px 10px;
}

/* پدیدآورندگان */
.authors-news-section {
    padding: 40px 0;
}

.authors-list {
    margin-bottom: 40px;
}

.author-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.author-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.author-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-link {
    text-decoration: none;
    color: #0bb0a0;
    font-size: 16px;
}

.author-link:hover {
    color: #20303e;
}

/* اخبار */
.news {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.news h2 {
    font-size: 24px;
    color: #0bb0a0;
    margin-bottom: 20px;
}

.news-item {
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
    margin-bottom: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.news-item h3 {
    font-size: 18px;
    color: #0bb0a0;
    margin-bottom: 10px;
}

.news-item p {
    font-size: 14px;
    color: #555;
}

.view-all-news {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0bb0a0;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.view-all-news:hover {
    background-color: #20303e;
}

/* فرم تماس */
.contact-section {
    padding: 40px 0;
    background-color: #2c3e50;
    color: #fff;
}

.contact-section h2 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.contact-section form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-section input,
.contact-section textarea {
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    background-color: #fff;
    transition: box-shadow 0.3s;
}

.contact-section input:focus,
.contact-section textarea:focus {
    box-shadow: 0 0 5px rgba(11, 176, 160, 0.3);
    outline: none;
}

.contact-section textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-section button {
    padding: 12px;
    background-color: #0bb0a0;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.contact-section button:hover {
    background-color: #e69520;
}

/* فوتر */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 40px 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.footer-section h3 {
    font-size: 18px;
    color: #0bb0a0;
    margin-bottom: 15px;
}

.footer-section p,
.footer-section ul li a {
    font-size: 14px;
    color: #ccc;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #0bb0a0;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    color: #fff;
    font-size: 24px;
    transition: transform 0.3s, color 0.3s;
}

.social-icon:hover {
    transform: scale(1.2);
    color: #0bb0a0;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-seal img {
    max-width: 100px;
    transition: transform 0.3s ease;
}

.trust-seal img:hover {
    transform: scale(1.1);
}

/* پاسخگویی */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-toggle {
        display: block;
        position: absolute;
        top: 15px;
        left: 15px;
    }

    .nav-menu {
        display: none;
        width: 100%;
    }

    .nav-menu.active {
        display: block;
        background-color: #fff;
        padding: 10px 0;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .nav-menu ul {
        flex-direction: column;
        text-align: center;
    }

    .main-content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        margin-top: 20px;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .book-image-container {
        height: 150px;
    }

    .book-info h3 {
        font-size: 14px;
        height: 50px;
    }

    .authors-news-section .container {
        flex-direction: column;
    }

    .authors-list, .news {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

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

    .book-info h3 {
        font-size: 13px;
    }
}