﻿/* Import AOS for animations */
@import url("https://unpkg.com/aos@2.3.1/dist/aos.css");

/* Custom CSS Variables */
:root {
    --primary-color: #1E46B6;
    --secondary-color: #f8f9fa;
    --text-dark: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
}


/* Product Card Styles */
.product-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
  position: relative;
  padding: 20px;
  text-align: center;
  background: #f8f9fa;
}

    .product-image img {
        max-width: 100%;
        height: 150px;
        border: 1px solid #ddd;
        object-fit: contain;
        transition: transform 0.3s ease;
    }

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1E46B6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.product-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-dark);
  margin-bottom: 8px;
  text-align: center;
}

.product-code {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-align: center;
}

.product-rating {
  text-align: center;
  margin-bottom: 10px;
}

.product-rating i {
  color: var(--warning-color);
  font-size: 0.9rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1E46B6;
    text-align: center;
    margin-bottom: 15px;
}

.product-brand {
  text-align: center;
  margin-bottom: 15px;
}

.product-brand img {
  height: 25px;
  opacity: 0.8;
}

.product-btn {
    background: #1E46B6;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: auto;
}

.product-btn:hover {
  background: #365a9b;
  transform: translateY(-2px);
}

/* Section Headings */
section h2 {
  color: var(--text-dark);
  font-size: 1.8rem;
  margin-bottom: 2rem;
  position: relative;
}

    section h2::after {
        content: "";
        position: absolute;
        bottom: -10px;
        right: 0;
        width: 60px;
        height: 3px;
        background: #1E46B6;
        border-radius: 2px;
    }


/* Responsive Design */
@media (max-width: 1200px) {
  .product-card {
    margin-bottom: 15px;
  }
  
  section h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 992px) {
  .navbar-nav {
    margin-top: 1rem;
  }
  
  .product-image {
    padding: 15px;
  }
  
  .product-image img {
    height: 120px;
  }
}

@media (max-width: 768px) {
  .product-card {
    margin-bottom: 20px;
  }

  section h2 {
    font-size: 1.5rem;
    text-align: center;
  }

  section h2::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .chat-button {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    bottom: 20px;
    left: 20px;
  }
  
  .product-info {
    padding: 15px;
  }
  
  .product-title {
    font-size: 1rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  /* Footer adjustments */
  footer .row {
    margin-bottom: 1rem;
  }
  
  footer .col-md-4 {
    margin-bottom: 1rem;
  }
}

@media (max-width: 576px) {
  .product-info {
    padding: 15px;
  }

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

  .product-price {
    font-size: 1.1rem;
  }
  
  .product-image img {
    height: 100px;
  }
  
  .product-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  /* Header adjustments */
  .navbar-brand img {
    max-height: 60px;
  }
  
  /* Footer link adjustments */
  footer .col-md-2 {
    margin-bottom: 0.5rem;
  }
  
  /* Chat button smaller on very small screens */
  .chat-button {
    width: 45px;
    height: 45px;
    font-size: 1rem;
    bottom: 15px;
    left: 15px;
  }
}

@media (max-width: 400px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .product-card {
    margin-bottom: 15px;
  }
  
  .product-image {
    padding: 10px;
  }
  
  .product-info {
    padding: 12px;
  }
  
  .product-title {
    font-size: 0.9rem;
  }
  
  .product-price {
    font-size: 1rem;
  }
  
  section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  /* Payment method images smaller */
  footer img {
    height: 20px !important;
  }
}

/* Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hover Effects */
.product-card .product-btn {
  opacity: 0.9;
}

.product-card:hover .product-btn {
  opacity: 1;
}

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

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

::-webkit-scrollbar-thumb {
    background: #1E46B6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #365a9b;
}
/* --- Product Scroll Styles --- */

/* 1. الحاوية الخارجية التي تسمح بالـ scroll وتخفي الـ scrollbar الافتراضي */
.products-scroll-container {
    overflow-x: auto; /* The most important property! */
    padding-bottom: 15px; /* Adds space for the custom scrollbar */
    scrollbar-width: none; /* For Firefox */
    scrollbar-color: var(--primary-color) #f1f1f1; /* For Firefox */
}

/* 2. الحاوية الداخلية التي تمنع نزول المنتجات لسطر جديد */
.products-items-wrapper {
    display: flex; /* Aligns products horizontally */
    flex-wrap: nowrap; /* Prevents wrapping */
    gap: 1rem; /* Space between product cards */
}

/* 3. تحديد حجم ثابت لكل منتج لضمان التناسق */
.product-item {
    flex: 0 0 280px; /* flex-grow: 0, flex-shrink: 0, flex-basis: 280px */
    width: 280px;
}

    /* 4. التأكد من أن كارت المنتج يملأ المساحة المخصصة له */
    .product-item .product-card {
        height: 100%;
    }

/* --- Custom Scrollbar Styling (for Chrome, Safari, Edge) --- */
.products-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.products-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.products-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

    .products-scroll-container::-webkit-scrollbar-thumb:hover {
        background: #365a9b; /* A slightly lighter shade of blue */
    }

/* Optional: Make cards a bit smaller on mobile for better scrolling */
@media (max-width: 576px) {
    .product-item {
        flex-basis: 240px; /* Use flex-basis for better flex control */
        width: 240px;
    }
}