/* Global styles (RTL template) */
/* Use this file for global utilities and component base styles.
   For production: it's recommended to compile only used Tailwind utilities. */

:root {
  --primary-color: #1d9fde;
  --secondary-color: #2a2c2e;
  --base-font: 'Cairo', sans-serif;
}

/* Accessibility: respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================== */
/* ============ START GLOBAL STYLE ============== */
/* ============================================== */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  position: relative;
  font-family: var(--base-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #0f172a;
  background: #ffffff;
}

/* ======= Scrollbar (webkit) ======= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: white;
}

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

/* ======= Firefox scrollbar ======= */
* {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) white;
}

/* ======= Preloader transition ======= */
#preloader.hide {
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility .5s ease;
}

/* ===== SCROLL TOP BTN ======= */
#scrollTopBtn {
  transform: translateY(20px);
}

#scrollTopBtn.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0);
}

#scrollTopBtn.show:hover {
  animation: pulseGlow 1.5s infinite;
}

/* ============================================== */
/* ============ END GLOBAL STYLE ============== */
/* ============================================== */

/* Header Shadow on Scroll */
#mainHeader.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Mobile Menu Toggle Animation */
#menuToggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

#menuToggle.active span:nth-child(2) {
  opacity: 0;
}

#menuToggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Sidebar Active State */
#mobileSidebar.active {
  transform: translateX(0);
}

#sidebarOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  #mainHeader,
  #mobileSidebar,
  #sidebarOverlay,
  #menuToggle span {
    transition: none !important;
  }
}


/* HERO SECTION  */
/* Focus Styles for Accessibility */
#home a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  #home h2 {
    font-size: 2rem;
  }
}

/* CATEGORIES SECTION */
/* Category Card & Button Focus State */
#categories .group:focus-visible,
#categories a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  #categories .group,
  #categories a {
    transition: none !important;
  }
}

/* Product Card Focus State */
#products .bg-white:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

#products a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  #products .hover\:shadow-lg,
  #products .hover\:gap-3 {
    transition: none !important;
  }
}

/* TESTMONIALS SECTION  */
/* Swiper Customization */
.testimonialsSwiper {
  padding-bottom: 3rem;
  overflow: visible;
}

.testimonialsSwiper .swiper-slide {
  height: auto;
}

.testimonialsSwiper .swiper-pagination {
  bottom: 0;
}

.testimonialsSwiper .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background: var(--secondary-color);
  opacity: 0.3;
  transition: all 0.2s;
}

.testimonialsSwiper .swiper-pagination-bullet-active {
  background: var(--primary-color);
  opacity: 1;
  width: 24px;
  border-radius: 5px;
}

/* Focus State for Accessibility */
.swiper-slide:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 0.75rem;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  .testimonialsSwiper,
  .testimonialsSwiper .swiper-pagination-bullet {
    transition: none !important;
  }
}

/* PARTNERS SECTION  */
/* Partners Swiper Customization */
.partnersSwiper {
  padding: 20px 0;
}

.partnersSwiper .swiper-slide {
  width: auto;
  margin: 0 12px;
}

/* Focus State for Accessibility */
.partnersSwiper .swiper-slide:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 0.5rem;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .partnersSwiper {
    animation: none !important;
  }

  .grayscale {
    filter: none !important;
  }
}

/* FOOTER SECTION  */
/* Footer Link Focus State */
footer a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  footer a {
    transition: none !important;
  }
}

/* Product Gallery */
.productGalleryThumbs .swiper-slide {
    opacity: 0.4;
    transition: opacity 0.3s;
}

.productGalleryThumbs .swiper-slide-thumb-active {
    opacity: 1;
    border: 2px solid #1d9fde;
}

.swiper-button-next,
.swiper-button-prev {
    color: #1d9fde;
}


.product-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* PRODUCTS PAGE */
/* Mobile Sidebar Styles */
.mobile-sidebar-toggle {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d9fde, #1a8bc8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(29, 159, 222, 0.3);
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.mobile-sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(29, 159, 222, 0.4);
}

.mobile-sidebar-toggle:active {
    transform: scale(0.95);
}

/* Active state for category buttons */
.category-btn.active {
    background-color: #1d9fde !important;
    color: white !important;
}

.category-btn.active i,
.category-btn.active span {
    color: white !important;
}

.category-btn.active:hover {
    background-color: #1a8bc8 !important;
}

/* Desktop Sidebar - Always visible */
.desktop-sidebar {
    display: block;
}

/* Mobile Sidebar - Hidden by default */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 90%;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: none;
}

.mobile-sidebar.open {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #1d9fde, #1a8bc8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.sidebar-content {
    padding: 1rem;
}

/* Hide mobile toggle on desktop */
@media (min-width: 1024px) {
    .mobile-sidebar-toggle {
        display: none;
    }

    .mobile-sidebar {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }
}

/* Show mobile toggle on mobile */
@media (max-width: 1023px) {
    .mobile-sidebar-toggle {
        display: flex;
    }

    .mobile-sidebar {
        display: block;
    }

    .desktop-sidebar {
        display: none;
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}
