:root {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --card-bg: #fff;
    --nav-bg: #fff;
    --hero-bg: #e3f2fd;
    --glow-color: #2196f3;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #ffffff;
    --card-bg: #1e1e1e;
    --nav-bg: #1e1e1e;
    --hero-bg: #1a1a1a;
    --glow-color: #3f51b5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

nav {
    background-color: var(--nav-bg);
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2.2rem;
    font-weight: bold;
    padding: 0.5rem;
    margin: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 12px;
    padding: 4px;
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .logo img {
    filter: brightness(1.2) contrast(1.1) drop-shadow(0 0 8px var(--glow-color));
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .logo img {
    filter: contrast(1.1) drop-shadow(0 0 8px var(--glow-color));
    background-color: white;
}

.logo span {
    background: linear-gradient(45deg, var(--glow-color), #82b1ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}



[data-theme="light"] .logo {
    background: linear-gradient(45deg, #1976d2, #2196f3);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .logo {
    background: linear-gradient(45deg, #3f51b5, #82b1ff);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.1);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
}

/* Navigation Animations */
nav ul li a,
nav ul li button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

nav ul li a::before,
nav ul li button::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--glow-color);
    transition: width 0.3s ease;
}

nav ul li a:hover::before,
nav ul li button:hover::before {
    width: 100%;
}

nav ul li {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

nav ul li:hover {
    transform: translateY(-3px);
}

.cart-button,
.admin-link {
    position: relative;
    overflow: hidden;
}

.cart-button::after,
.admin-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.cart-button:hover::after,
.admin-link:hover::after {
    width: 200%;
    height: 200%;
}

.theme-toggle {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s ease;
}

.theme-toggle:hover::after {
    left: 100%;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

#cartCount {
    animation: pop 0.3s ease;
}

/* Navigation active state */
nav ul li a.active::before {
    width: 100%;
}

nav ul li a.active {
    color: var(--glow-color);
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--hero-bg);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px var(--glow-color);
}

.cta-button {
    padding: 1rem 2rem;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    box-shadow: 0 0 15px var(--glow-color);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--glow-color);
}

.featured-books {
    padding: 2rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.book-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--glow-color);
}

.book-card img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.book-image {
    position: relative;
    width: 200px;
    height: 300px;
    margin: 0 auto 1rem auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.book-image .image-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.book-card:hover .book-image img {
    transform: scale(1.05);
}

.book-card.out-of-stock {
    opacity: 0.7;
    position: relative;
}

.out-of-stock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background-color: rgba(255, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: bold;
    border-radius: 5px;
    font-size: 1.2rem;
    z-index: 2;
}

.book-card.out-of-stock .book-image {
    position: relative;
}

.book-card.out-of-stock .book-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.book-card.out-of-stock:hover {
    transform: none;
    box-shadow: none;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    box-shadow: 0 0 10px var(--glow-color);
}

footer {
    background-color: #0a0a0a;
    color: white;
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

[data-theme="dark"] .book-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cta-button {
    background-color: #3f51b5;
}

.search-container {
    background-color: var(--nav-bg);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-input {
    padding: 0.8rem;
    width: 50%;
    max-width: 500px;
    border: 2px solid var(--glow-color);
    border-radius: 5px;
    margin-left: 0.5rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.search-button {
    padding: 0.8rem 1.5rem;
    background-color: var(--glow-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    box-shadow: 0 0 15px var(--glow-color);
    transform: scale(1.05);
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
}

[data-theme="dark"] .search-input {
    border-color: var(--glow-color);
}

.cart-button {
    background-color: var(--glow-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cart-items {
    margin: 2rem 0;
}

.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    background-color: var(--card-bg);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.cart-item img {
    width: 100px;
    height: auto;
}

.cart-item .remove-button {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
}

.cart-summary {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.order-form {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-input {
    padding: 0.8rem;
    border: 1px solid var(--glow-color);
    border-radius: 5px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

.whatsapp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #25D366;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.whatsapp-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
}

.whatsapp-button img {
    width: 24px;
    height: 24px;
}

.required-notice {
    color: var(--text-color);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.checkout-whatsapp {
    font-size: 1.1rem;
    padding: 1.2rem;
    margin-top: 2rem;
    font-weight: bold;
}

.form-input:required:invalid {
    border-color: #ff4444;
}

.form-input:required:valid {
    border-color: #4CAF50;
}

.confirm-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #4CAF50;
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin: 1rem 0;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: bold;
}

.confirm-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.admin-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--glow-color);
    color: white !important;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.admin-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--glow-color);
}

.payment-methods {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--glow-color);
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-option:last-child {
    border-bottom: none;
}

.payment-option label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    width: 100%;
}

.payment-info {
    font-size: 0.9rem;
    color: var(--glow-color);
    font-weight: bold;
}

.payment-proof {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.payment-note {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-top: 0.5rem;
}

input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--glow-color);
    cursor: pointer;
}

input[type="file"] {
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.proof-options {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.proof-option {
    margin-bottom: 1.5rem;
}

.proof-option h4 {
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.proof-divider {
    text-align: center;
    margin: 1rem 0;
    position: relative;
    color: var(--text-color);
}

.proof-divider::before,
.proof-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: var(--text-color);
    opacity: 0.3;
}

.proof-divider::before {
    right: 0;
}

.proof-divider::after {
    left: 0;
}

.receipt-upload {
    position: relative;
    text-align: center;
}

.file-input {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border: 2px dashed var(--glow-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    opacity: 0.7;
}

.preview-container {
    position: relative;
    margin-top: 1rem;
}

#receiptPreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ff4444;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 5px;
    background-color: var(--glow-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--glow-color);
}

.quantity-input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--glow-color);
    border-radius: 5px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.stock-status {
    margin: 0.5rem 0;
    font-weight: bold;
}

.stock-status.low-stock {
    color: #ff4444;
}

.stock-badge {
    background-color: var(--glow-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.stock-badge.low-stock {
    background-color: #ff4444;
}

button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.price-container {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.price-container.has-discount {
    background: rgba(255, 68, 68, 0.1);
    padding: 1rem;
}

.price-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.original-price {
    color: #666;
    text-decoration: line-through;
    font-size: 0.9em;
}

.final-price {
    color: #ff4444;
    font-weight: bold;
    font-size: 1.3em;
}

.new-price {
    position: relative;
    display: inline-block;
    padding: 4px 8px;
    background-color: #ff4444;
    color: white;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

.regular-price {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-color);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff4444 0%, #ff0000 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: rotate(0);
    transition: transform 0.3s ease;
    z-index: 2;
}

.book-card:hover .discount-badge {
    transform: scale(1.1) rotate(-5deg);
}

.discount-percent {
    font-size: 1.2em;
    font-weight: bold;
}

.save-amount {
    font-size: 0.8em;
    opacity: 0.9;
}

.categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    background-color: var(--nav-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background-color: var(--glow-color);
    color: white;
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: var(--glow-color);
    color: white;
    box-shadow: 0 0 10px var(--glow-color);
}

.category-search {
    margin: 1rem 0 2rem 0;
}

.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--glow-color);
}

@media screen and (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
        margin-top: 1rem;
    }

    nav ul li {
        margin: 0.5rem 0;
    }

    .search-input {
        width: 100%;
        margin: 0 0 1rem 0;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cart-item img {
        margin: 0 auto;
    }

    .admin-sections {
        grid-template-columns: 1fr;
    }

    .logo img {
        width: 64px;
        height: 64px;
    }

    .logo {
        font-size: 2rem;
        padding: 0.4rem;
    }

    .categories-nav {
        flex-direction: column;
        padding: 0.5rem;
    }

    .category-btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .book-image {
        width: 150px;
        height: 225px;
    }

    .cart-section {
        padding: 1rem;
    }

    .form-input,
    .search-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .logo img {
        width: 56px;
        height: 56px;
    }

    .logo {
        font-size: 1.8rem;
        padding: 0.3rem;
    }

    .discount-badge {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .new-price {
        font-size: 1.1em;
    }
}

/* Add vendor prefixes for better browser support */
.book-card,
.cart-item,
.search-input,
.form-input,
.admin-item {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

.book-card:hover {
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
    transform: translateY(-5px);
}

/* Add touch-specific styles */
@media (hover: none) {

    .book-card:hover,
    .cta-button:hover {
        transform: none;
        box-shadow: none;
    }

    .book-card:active,
    .cta-button:active {
        transform: scale(0.98);
    }
}

/* Fix for iOS scrolling */
html,
body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
}

/* Improve tap target sizes for mobile */
button,
.cart-button,
.admin-link {
    min-height: 44px;
    min-width: 44px;
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* تحديث نمط العناصر في لوحة التحكم */
.admin-item .price-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.admin-item .price-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Image Zoom Styles */
.zoom-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.zoomed-image {
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    display: block;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.close-zoom {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.zoom-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 20px;
}

.zoom-btn {
    background-color: var(--glow-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--glow-color);
}

/* Zoom transition */
.zoomed-image.zooming {
    transition: transform 0.3s ease;
}

.form-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--glow-color);
    font-weight: bold;
}

.form-group input {
    width: 100%;
    margin-bottom: 0.8rem;
}

.book-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.book-spec {
    padding: 0.5rem;
    background-color: var(--nav-bg);
    border-radius: 4px;
}

.book-spec-label {
    font-size: 0.9em;
    color: var(--glow-color);
    margin-bottom: 0.3rem;
}

.book-spec-value {
    font-weight: bold;
}

/* أنماط مودال تفاصيل الكتاب */
.book-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
}

.book-details-container {
    padding: 2rem;
    max-width: 800px;
    margin: 2rem auto;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.book-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.book-gallery img:hover {
    transform: scale(1.05);
}

.book-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.book-info-section {
    background-color: var(--nav-bg);
    padding: 1rem;
    border-radius: 8px;
}

.book-info-section h3 {
    color: var(--glow-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-color);
    opacity: 0.8;
}

.info-value {
    font-weight: bold;
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.remove-image-btn:hover {
    background: rgb(255, 0, 0);
}

/* Preview modal styles */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.preview-modal img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

/* Book Details Modal Styles */
.book-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
}

.book-details-container {
    position: relative;
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.book-details-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

.book-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.book-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.book-gallery img:hover {
    transform: scale(1.05);
}

.book-info {
    padding: 1rem;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-color);
    opacity: 0.8;
}

.price-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.discount-price .original {
    text-decoration: line-through;
    color: #666;
}

.discount-price .discount {
    background: #ff4444;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 1rem;
}

.discount-price .final {
    font-size: 1.5em;
    font-weight: bold;
    color: #ff4444;
}

.specs table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.specs td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.specs td:first-child {
    font-weight: bold;
    width: 40%;
}

.purchase-section {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.out-of-stock-msg {
    background: #ff4444;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 2rem;
}

.add-to-cart-btn {
    flex: 1;
    padding: 1rem;
    background: var(--glow-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.details-button {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--glow-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.details-button:hover {
    background: var(--glow-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.details-button i {
    transition: transform 0.3s ease;
}

.details-button:hover i {
    transform: translateX(-4px);
}

@media (max-width: 768px) {
    .book-details-content {
        grid-template-columns: 1fr;
    }
    
    .book-details-container {
        margin: 1rem;
        padding: 1rem;
    }
}

/* WhatsApp Floating Button */
.floating-whatsapp {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.floating-whatsapp:hover {
    background-color: #20b858;
    transform: scale(1.1);
    color: white;
}