/* Global Styles */
:root {
    --primary-text: #6d6d6d;
    --heading-text: #2f2d3b;
    --accent-color: #8f1a28;
    /* Maroon */
    --accent-hover: #7a1520;
    --bg-color: #ffffff;
    --active-menu-bg: #54595F;
    --header-border-color: #e5e5e5;
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Source Sans Pro', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ar);
    color: var(--primary-text);
    background-color: var(--bg-color);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.site-header {
    background: linear-gradient(to bottom, #f0f2f5 0%, #ffffff 100%);
    border-bottom: 1px solid var(--header-border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
    padding: 15px 0;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Subtle decorative pattern simulation */
    background-image: radial-gradient(#e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: -1;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-height: 80px;
    width: auto;
}

.main-nav {
    flex-grow: 1;
    margin-right: 40px;
    /* Space between logo and nav */
}

.nav-list {
    display: flex;
    gap: 5px;
}

.menu-item a {
    display: block;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--heading-text);
    border-radius: 4px;
}

.menu-item.active a,
.menu-item a:hover {
    background-color: var(--active-menu-bg);
    color: #fff;
}

.lang-switch a {
    font-family: var(--font-en);
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--heading-text);
}

/* Hero Section */
.hero-section {
    position: relative;
    /* height: 500px; Remove fixed height and let content drive it or use min-height */
    min-height: 500px;
    background-color: #f9f9f9;
}

.hero-swiper {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.slide-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.slide-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.slide-info {
    position: relative;
    z-index: 1;
    text-align: center;
}

.slide-info h2 {
    font-size: 3rem;
    color: var(--heading-text);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.swiper-slide-active .slide-info h2 {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.slide-info p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.swiper-slide-active .slide-info p {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.slide-info .btn {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.swiper-slide-active .slide-info .btn {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

/* Background Zoom Effect */
.slide-bg img {
    transition: transform 4s ease;
    transform: scale(1);
}

.swiper-slide-active .slide-bg img {
    transform: scale(1.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

/* Section Common */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--heading-text);
    margin-bottom: 15px;
}

/* About Section */
.about-section {
    background-color: #fff;
    padding: 80px 0 40px;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-title {
    color: var(--accent-color);
    font-size: 2.5rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.about-text {
    font-size: 1.2rem;
    color: var(--primary-text);
    line-height: 1.8;
    margin-bottom: 30px;
}

.about-hashtag {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--heading-text);
}

/* New Releases / Book Grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.book-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    border: 1px solid #eee;
}

.book-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.book-image {
    position: relative;
    padding-top: 140%;
    /* Aspect ratio for books */
    background-color: #f5f5f5;
    overflow: hidden;
}

.book-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    padding: 15px;
    text-align: center;
    background: #fff;
    /* Ensure content is not hidden */
    overflow: visible;
}

.book-category {
    font-size: 13px;
    color: var(--accent-color) !important;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.book-title {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--heading-text) !important;
    line-height: 1.4;
    font-weight: 700;
    font-weight: 700;
    /* Limit lines if needed, but let's show full for now */
}

@media (max-width: 576px) {
    .book-title {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .book-category {
        font-size: 11px;
    }

    .book-info {
        padding: 10px;
    }

    .slide-info h2 {
        font-size: 1.5rem;
    }

    .slide-info p {
        font-size: 0.75rem;
    }
}

.book-author {
    font-size: 14px;
    color: #555 !important;
    margin-bottom: 10px;
    font-weight: 600;
}

.book-price {
    font-weight: 700;
    color: var(--heading-text) !important;
    font-size: 16px;
    display: inline-block;
    background: #f4f4f4;
    padding: 2px 10px;
    border-radius: 15px;
    margin-top: 5px;
}

/* Footer */
.site-footer {
    background-color: #222;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

/* Responsive */
@media (max-width: 992px) {
    .header-container {
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        /* Hide by default on mobile, toggle with JS */
        flex-basis: 100%;
        margin-right: 0;
        margin-top: 20px;
    }

    .nav-list {
        flex-direction: column;
    }

    .main-nav.open {
        display: block;
    }
}

/* LTR / English Support */
html[dir="ltr"] body {
    text-align: left;
    font-family: var(--font-en);
}

html[dir="ltr"] .main-nav {
    margin-right: 0;
    margin-left: 40px;
}

html[dir="ltr"] .details-meta span {
    margin-left: 0;
    margin-right: 20px;
}

html[dir="ltr"] .details-meta i,
html[dir="ltr"] .back-btn i {
    margin-left: 0;
    margin-right: 5px;
}

html[dir="ltr"] .back-btn i {
    transform: rotate(180deg);
}

@media (max-width: 992px) {
    html[dir="ltr"] .main-nav {
        margin-left: 0;
    }
}

/* View All Button */
.view-all-btn {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    transition: all 0.3s;
    font-weight: 600;
}

.view-all-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.view-all-btn i {
    margin: 0 5px;
}

/* Mobile Grid Force */
@media (max-width: 576px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* --- Added Animations & Hover Effects --- */

/* Navbar Link Underline Effect */
.menu-item a {
    position: relative;
}

.menu-item a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu-item a:hover::after,
.menu-item.active a::after {
    width: 80%;
}

/* Button Pulse/Scale Effect */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(143, 26, 40, 0.4);
}

.view-all-btn {
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Swiper Slide Button Animation */
.swiper-button-next,
.swiper-button-prev {
    transition: transform 0.2s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    transform: scale(1.2);
    color: var(--accent-color);
}

/* Book Card Hover (Enhanced) */
.book-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.book-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.book-image img {
    transition: transform 0.5s ease;
}

.book-card:hover .book-image img {
    transform: scale(1.1);
}