:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    font-size: 16px;
}

/* Hero Section */
.header-carousel {
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.header-carousel .owl-carousel-item {
    height: 100%;
}

.header-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
}

.header-carousel .position-absolute {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.8), rgba(16, 185, 129, 0.6)) !important;
}

.header-carousel h1 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.header-carousel p {
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.header-carousel .btn {
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.header-carousel .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Alert Styles */
.alert-success {
    background: linear-gradient(135deg, var(--accent-color), #059669);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    margin: 2rem auto;
    max-width: 600px;
    font-weight: 500;
    box-shadow: var(--shadow);
}

/* Page Wrapper */
.page-wrapper {
    min-height: 100vh;
    padding: 3rem 0;
}

/* Category Filters */
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: var(--white);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    margin: 0.25rem;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.search-form {
    display: flex;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid #e2e8f0;
}

.search-input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 16px;
    background: transparent;
    color: var(--dark-color);
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: var(--secondary-color);
}

.search-button {
    background: var(--primary-color);
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: #1d4ed8;
}

.search-button img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Category Section */
.category-section {
    margin-bottom: 4rem;
}

.category-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.category-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* Product Cards */
.book-card {
    background: var(--white);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 420px; /* Fixed height for all cards */
    width: 100%;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.book-card .img-thumbnail {
    border: none;
    border-radius: 0;
    height: auto;
    max-height: 250px; /* أو حسب رغبتك */
    width: 100%;
    object-fit: cover;
    background: #f8f9fa;
    padding: 1rem;
    transition: var(--transition);
    flex-shrink: 0; /* Prevent image from shrinking */
}

.book-card:hover .img-thumbnail {
    transform: scale(1.05);
}

.book-card .card-body {
    padding: 1.5rem;
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    height: 2.8rem; /* Fixed title height (2 lines) */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
    -webkit-box-orient: vertical;
}
.swipe-down-floate   {
    position: fixed;
    left: 1.2rem;
    bottom: 1.2rem;
    padding-left: 12px;
    z-index: 999;
    background: #0d6efd;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 2.2rem;
    animation: swipeDownFloatAnim 1.2s infinite;
}
@keyframes swipeDownFloatAnim {
    0% { transform: translateY(0);}
    50% { transform: translateY(15px);}
    100% { transform: translateY(0);}
}
.book-card .card-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.book-card .btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 10px 20px;
    transition: var(--transition);
}

.book-card .btn-primary {
    background: var(--primary-color);
    border: none;
}

.book-card .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.book-card .btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.book-card .btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Supplier Info */
.book-card .mb-1 {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.book-card .mb-1 .fw-bold {
    color: var(--dark-color);
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.carousel-control-prev {
    left: -25px;
}

.carousel-control-next {
    right: -25px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-size: 20px;
}
/* Success Alert Styles */
.alert-success {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    padding: 15px 25px;
    background-color: #4CAF50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    display: flex;
    align-items: center;
    max-width: 350px;
    animation:  fadeOut 3s ease-in 0.5s forwards;
    transform: translateX(-120%);
    opacity: 0;
}

.alert-success::before {
    content: "✓";
    margin-right: 10px;
    font-size: 1.2em;
}

/* Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .alert-success {
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* Pagination */
.pagination {
    margin-top: 3rem;
}

.page-link {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 0.25rem;
    border: 2px solid #e2e8f0;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.page-link:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.page-item.disabled .page-link {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-carousel {
        height: 350px;
    }
    
    .header-carousel h1 {
        font-size: 1.75rem;
    }
    
    .header-carousel p {
        font-size: 1rem;
    }
    
    .category-section h2 {
        font-size: 1.5rem;
    }
    
    .book-card {
        height: 380px; /* Slightly smaller for mobile */
    }
    
    .book-card .img-thumbnail {
        height: 170px; /* Smaller image for mobile */
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }
    
    .search-input {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .search-button {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .header-carousel {
        height: 300px;
    }
    
    .header-carousel h1 {
        font-size: 1.5rem;
    }
    
    .btn-outline-primary {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .book-card {
        height: 350px; /* Even smaller for very small screens */
    }
    
    .book-card .img-thumbnail {
        height: 150px; /* Smaller image for very small screens */
    }
    
    .book-card .card-body {
        padding: 1rem;
    }
    
    .book-card .card-title {
        font-size: 1rem;
        height: 2.4rem; /* Adjust title height for smaller screens */
    }
    
    .book-card .card-text {
        font-size: 1.1rem;
    }
}

/* Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate__animated {
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

.animate__fadeInUp {
    animation-name: fadeInUp;
}

.animate__fadeInLeft {
    animation-name: fadeInLeft;
}

.animate__fadeInRight {
    animation-name: fadeInRight;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading States */
.book-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.book-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Focus States for Accessibility */
.btn:focus,
.search-input:focus,
.page-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header-carousel,
    .search-container,
    .carousel-control-prev,
    .carousel-control-next,
    .pagination {
        display: none;
    }
    
    .book-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Responsive image for carousel and cards */
@media (max-width: 768px) {
    .header-carousel img,
    .book-card .img-thumbnail {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important; /* أو جرب cover إذا أردت ملء الإطار */
        padding: 0 !important;
        background: #f8f9fa;
        display: block;
    }
    .header-carousel {
        height: auto !important;
        min-height: 200px;
    }
}