/* Global Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Top Bar */
.top-bar {
    font-size: 0.85rem;
}

/* Navbar Styling */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.8rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.dropdown-item {
    padding: 0.7rem 1.5rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Hero Slider */
.hero-slider {
    position: relative;
}

.slide-bg {
    min-height: 500px;
    padding: 3rem 0;
}

.carousel-item img {
    max-height: 400px;
    object-fit: cover;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
}

.carousel-control-prev {
    right: 20px;
}

.carousel-control-next {
    left: 20px;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

/* Service Cards */
.service-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15) !important;
}

.service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Category Cards */
.category-card .card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-card:hover .card {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15) !important;
}

.category-card img {
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover img {
    transform: scale(1.1);
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* مربع ثابت */
    background: #f8f8f8;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-actions button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-actions button:hover {
    background: var(--primary-color);
    color: white;
}

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.product-title {
    font-weight: 600;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.5rem;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.add-to-cart {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.add-to-cart:hover {
    background: var(--primary-dark);
}

/* Countdown */
.countdown-item {
    min-width: 70px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Testimonials */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1) !important;
}

/* Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-window.active {
    display: flex;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
}

.message {
    max-width: 80%;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    margin-right: auto;
    margin-left: 0;
}

.user-message .message-content {
    background: var(--primary-color) !important;
    color: white;
}

/* Toast Notifications */
.toast {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* Enhanced Footer */
.footer {
    background: #1a1a2e !important;
}

.footer-top {
    background: rgba(255,255,255,0.02);
}

.footer-brand p {
    line-height: 1.8;
}

.footer-links a {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: white !important;
    padding-right: 5px;
}

.social-links a {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.social-links a:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-3px);
}

.hover-white:hover {
    color: white !important;
}

.payment-methods img {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.payment-methods img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

/* Section Headers */
.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-header.text-center h2::after {
    right: 50%;
    transform: translateX(50%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Product Details Page */
.product-gallery {
    position: sticky;
    top: 100px;
}

.main-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.thumbnail-images {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details h1 {
    font-size: 2rem;
    font-weight: 700;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-selector button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Cart Page */
.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-summary {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.social-login {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

.social-login button {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-login button:hover {
    background: #f8f9fa;
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.filter-section {
    margin-bottom: 25px;
}

.filter-section h6 {
    font-weight: 700;
    margin-bottom: 15px;
}

.price-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-range input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Pagination */
.pagination .page-link {
    border: none;
    color: var(--dark-color);
    padding: 0.75rem 1rem;
    margin: 0 3px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 991px) {
    .slide-bg {
        min-height: 320px;
        padding: 2rem 0;
    }
    
    .carousel-item img {
        max-height: 220px;
    }
    
    .chatbot-window {
        width: 300px;
        height: 400px;
    }
}

@media (max-width: 767px) {
    .slide-bg {
        min-height: 260px;
        text-align: center;
        padding: 1.5rem 0;
    }
    
    .carousel-item img {
        max-height: 180px;
        width: 100%;
    }
    
    .countdown-item {
        min-width: 60px;
        padding: 0.5rem !important;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 991px) {
    .navbar-brand {
        font-size: 1.4rem;
    }

    .navbar .navbar-nav {
        margin-top: 0.75rem;
    }

    .navbar .navbar-collapse > .d-flex {
        margin-top: 0.75rem;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .product-gallery {
        position: static;
        margin-bottom: 1.5rem;
        top: auto;
    }

    .product-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-summary {
        margin-top: 1rem;
    }

    .auth-card {
        padding: 2rem;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 0.95rem;
    }

    .top-bar .row > div {
        text-align: center;
        margin-bottom: 0.25rem;
    }

    .footer .row > div {
        text-align: center;
        margin-bottom: 1rem;
    }

    .product-card {
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

    .product-image {
        max-width: 85%;
        margin: 0 auto;
    }

    .product-info {
        padding: 0.85rem;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .chatbot-container {
        bottom: 15px;
        left: 15px;
    }

    .chatbot-window {
        width: 100vw;
        max-width: 360px;
        left: 0;
        right: 0;
        margin: 0 auto;
    }

    .why-choose-us .row,
    .testimonials .row,
    .social-feed .row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .why-choose-us .row > [class*="col-"],
    .testimonials .row > [class*="col-"],
    .social-feed .row > [class*="col-"] {
        flex: 0 0 80%;
        max-width: 80%;
        scroll-snap-align: center;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Wishlist Heart Animation */
@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.heart-animation {
    animation: heartBeat 0.5s ease;
}

/* Quick View Modal */
.quick-view-modal .modal-content {
    border-radius: 20px;
    border: none;
}

.quick-view-modal .modal-body {
    padding: 2rem;
}

/* Compare Checkbox */
.compare-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.compare-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}
