:root {
  --accent: #2ca58d;
  --bg: #f9fbfc;
  --text: #222;
}

/* القواعد العامة */
* {
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
  transition: all 0.3s ease;
}

/* Global Selection Style */
::selection {
  background-color: var(--accent);
  /* Theme Color */
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--accent);
  color: #ffffff;
}


html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  /* padding-bottom removed for static footer */
}

/* ======= Header ======= */
header {
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 2vw, 16px) clamp(12px, 3vw, 24px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.logo-img {
  width: clamp(35px, 6vw, 50px);
  height: clamp(35px, 6vw, 50px);
  border-radius: 50%;
  object-fit: cover;
}

.logo {
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--accent);
}

/* ======= Nav Buttons ======= */
.nav-buttons {
  display: flex;
  gap: clamp(6px, 1vw, 12px);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-buttons button {
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: clamp(5px, 1vw, 8px) clamp(8px, 1.5vw, 14px);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: clamp(12px, 2vw, 15px);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-buttons button:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(44, 165, 141, 0.2);
}

/* ======= Mobile Menu & Hamburger ======= */

/* Desktop Defaults */
.desktop-menu {
  display: flex;
  gap: clamp(6px, 1vw, 12px);
  align-items: center;
}

/* Hamburger hidden on desktop - High Specificity */
header>.hamburger-btn {
  display: none !important;
}

/* Hide Mobile Menu Sidebar & Overlay on Desktop */
.mobile-menu-sidebar,
.mobile-menu-overlay {
  display: none;
}

/* Mobile Styles */
@media (max-width: 900px) {

  /* Raise Header Z-Index to stay ON TOP of the menu */
  header {
    z-index: 2005 !important;
    position: relative;
    /* Ensure stacking context if sticky fails or complicates */
    position: sticky;
    /* Keep sticky behavior */
  }

  .desktop-menu {
    display: none;
  }

  /* Nav Buttons Container on Mobile */
  .nav-buttons {
    display: flex !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 0 !important;
    margin-right: 15px;
    margin-left: auto;
  }

  /* Fix Cart Position inside container */
  .cart-container {
    margin: 0 !important;
  }

  /* Hamburger Button - now direct child of header */
  header>.hamburger-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 45px;
    height: 45px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    z-index: 2100;
    padding: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin: 0;
    flex-shrink: 0;
    transition: all 0.3s ease-in-out;
  }

  header>.hamburger-btn:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
  }

  /* Hamburger Lines */
  header>.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: #000000;
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
  }

  /* Active State (X Icon) */
  header>.hamburger-btn.active {
    background: #fff;
    border-color: var(--accent);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
  }

  /* Transform to X */
  header>.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
    background-color: #000000;
  }

  header>.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
  }

  header>.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
    background-color: #000000;
  }

  /* Fix Cart Margin on Mobile */
  .cart-container {
    margin: 0 !important;
  }

  /* Cart Icon Adjustment for alignment */
  .cart-container i,
  .cart-container svg {
    width: 42px;
    /* Match hamburger width */
    height: 42px;
    /* Match hamburger height */
    padding: 10px;
    /* Adjust padding to keep icon size visual balanced */
    font-size: 20px;
  }

  .cart-count {
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  /* Mobile Menu Sidebar */
  .mobile-menu-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    max-width: 80vw;
    height: 100vh;
    background: #fff;
    z-index: 1999;
    /* Under Header */
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    transition: left 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 0;
    padding-top: 80px;
    /* Space for header */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .mobile-menu-sidebar.active {
    left: 0;
  }

  /* Menu Header inside Sidebar: Hide because we want "القائمة" to align with 'X' */
  /* Actually, to align "القائمة" with the X button which is in the fixed Header,
     we should add a title inside the Header itself that only appears when menu is active? 
     OR, we style the sidebar header to perfectly match the height/position of the Main Header. 
  */
  .mobile-menu-header {
    display: none;
    /* Hide the internal header title to avoid duplication or misalignment */
  }

  /* We need a "Drawer Title" that aligns with the X. 
     The X is roughly at top: ~20px. 
     Let's add a pseudo element or a separate title container that sits at the top of the sidebar.
  */
  .mobile-menu-sidebar::before {
    content: "القائمة";
    position: absolute;
    top: 28px;
    /* Align vertically with the X button (~center of header) */
    right: 25px;
    /* Align to the right side of the drawer */
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    opacity: 0;
    /* Hidden by default, show when active? */
    transition: opacity 0.3s ease 0.2s;
    /* Delay showing */
  }

  .mobile-menu-sidebar.active::before {
    opacity: 1;
  }

  .mobile-menu-links {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    /* Better spacing */
    margin-top: 10px;
  }

  /* Premium Mobile Drawer Items */
  .mobile-link {
    background: transparent;
    color: #555;
    /* Neutral Dark Grey */
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    /* Slightly more visible divider */
    text-align: center;
    /* Center aligned text as requested */
    justify-content: center;
    /* Center flex content */
    padding: 22px 20px;
    /* Comfortable touch padding */
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: none;
    position: relative;
    /* For pseudo-elements */
    overflow: hidden;
    /* Contain ripple/highlight */
  }

  /* Remove last border */
  .mobile-link:last-child {
    border-bottom: none;
  }

  .mobile-link i {
    color: #aaa;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    /* Since text is centered, icon should sit nicely next to it */
  }

  /* Hover Style - Premium Transition */
  .mobile-link:hover {
    background: rgba(44, 165, 141, 0.04);
    /* Very subtle theme tint */
    color: var(--accent);
    /* Theme Green Text */
    font-weight: 600;
    /* Subtle weight increase */
    padding-right: 20px;
    /* No slide, keep centered stable */
    letter-spacing: 0.5px;
    /* Tiny tracking expansion */
  }

  /* Active (Press) Style */
  .mobile-link:active {
    background: rgba(44, 165, 141, 0.08);
    /* Slightly darker press */
    transform: scale(0.98);
    transition: transform 0.1s;
  }

  .mobile-link:hover i,
  .mobile-link:active i {
    color: var(--accent);
    transform: scale(1.1) rotate(5deg);
    /* Slight playful icon rotate */
  }

  /* Overlay */
  .mobile-menu-overlay {
    display: block;
    /* Override global display: none */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
  }

  .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* ======= زر السلة ======= */
.cart-container {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 20px auto;
  width: fit-content;
  z-index: 1500;
}

.cart-container i,
.cart-container svg {
  font-size: clamp(22px, 3vw, 30px);
  /* Keep for font icons */
  width: clamp(22px, 3vw, 30px);
  /* For SVG */
  height: clamp(22px, 3vw, 30px);
  /* For SVG */
  color: var(--accent);
  fill: var(--accent);
  /* For SVG */
  background: #fff;
  padding: clamp(8px, 1.5vw, 12px);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  /* Ensure centering */
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  /* Important for padding to add to width */
}

.cart-container:hover i {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: clamp(10px, 1.5vw, 12px);
  border-radius: 50%;
  width: clamp(18px, 3vw, 22px);
  height: clamp(18px, 3vw, 22px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 0 2px #fff;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

/* ======= Slider ======= */
/* Slider styles moved to slider.css for better organization */
/* See: public/css/slider.css for all slider-related styles */


/* ======= Tabs ======= */
#products-section {
  scroll-margin-top: 150px;
  /* Offset for fixed header + spacing */
}

.tabs {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 12px);
  margin: 10px auto;
  max-width: 1100px;
  padding: 0 16px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #fff;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 10px 20px;
  /* Increased padding */
  border-radius: 25px;
  /* slightly more rounded */
  cursor: pointer;
  font-weight: 600;
  /* slightly bolder */
  font-size: clamp(13px, 2vw, 15px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* Space between icon and text */
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  flex-shrink: 0;
  position: relative;
  min-height: 45px;
  /* Ensure touch target size */
}

.tab-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.tab-btn.active,
.tab-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 165, 141, 0.25);
}

.tab-btn:hover svg,
.tab-btn.active svg {
  stroke: #fff;
}

.tab-btn.active {
  padding: 10px 24px;
  transform: scale(1.03) translateY(-2px);
  /* Subtle scale */
  box-shadow: 0 6px 15px rgba(44, 165, 141, 0.3);
}

/* Ensure active state has proper spacing */
/* Active State Spacing handled above */

/* Mobile: Horizontal scroll for categories */
@media (max-width: 768px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 16px 15px 16px;
    /* Matched desktop-like spacing */
  }

  .tabs::after {
    content: '';
    display: block;
    min-width: 5px;
    height: 1px;
  }

  /* Force Desktop-like shape on Mobile */
  .tab-btn {
    border-radius: 30px !important;
    /* Increased curvature */
    padding: 10px 20px !important;
    /* Force ample padding */
    font-size: 14px !important;
    border: 1.5px solid var(--accent);
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Active State */
  .tab-btn.active {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 15px rgba(44, 165, 141, 0.3);
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 480px) {
  .tabs {
    gap: 8px;
  }
}

/* ======= Search Box ======= */
.search-box {
  display: flex;
  justify-content: center;
  margin: 14px 0;
  padding: 0 16px;
}

/* Category Scroll Navigation Buttons */
.category-scroll-wrapper {
  position: relative;
  /* Add padding to ensure buttons don't cover content initially */
  padding: 0 10px;
}

.scroll-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}

.scroll-nav-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.scroll-nav-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  border-color: #ccc;
}

.scroll-nav-btn:hover img {
  opacity: 1;
}

.scroll-nav-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-nav-btn:hover {
  transform: translateY(-50%) scale(1.1);
}

.scroll-nav-btn.left {
  left: 0;
}

.scroll-nav-btn.right {
  right: 0;
}

.animate-pulse {
  animation: pulseHint 1.5s infinite;
}

@keyframes pulseHint {
  0% {
    transform: translateX(0);
    opacity: 1;
  }

  50% {
    transform: translateX(-4px);
    opacity: 0.7;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.search-box {
  position: relative;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: clamp(10px, 2vw, 12px);
  padding-left: 45px;
  /* Space for icon */
  border: 1px solid #ddd;
  border-radius: 30px;
  font-size: clamp(14px, 2vw, 16px);
  transition: all 0.3s ease;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 10;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 165, 141, 0.15);
}

/* ======= Products Grid ======= */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 10px;
  /* Ensure min-height to push footer/about-us down while loading */
  min-height: 80vh;
  /* Prevent rows from stretching to fill height */
  align-content: start;
}

.card {
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  /* Ensure it fills the grid cell */
  min-height: 320px;
  /* Force visual uniformity */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(44, 165, 141, 0.15);
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease;
  margin-bottom: 10px;
}

.card:hover img {
  transform: scale(1.05);
}

/* Card Content Spacer */
.card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.card-title {
  font-weight: 600;
  margin-bottom: 6px;
  min-height: 40px;
  /* Helps align short/long titles */
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-price {
  margin-top: auto;
  /* Pushes price to bottom of content area */
  min-height: 45px;
  /* Fixed height for price area to align buttons */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1em;
}

/* ======= Buttons ======= */
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  width: 100%;
  /* Full width button */
  margin-top: auto;
  /* Push to very bottom if needed */
  transition: all 0.3s ease;
}

.btn:hover {
  background: #23947d;
}

.btn:disabled,
.btn.disabled {
  background: #ccc !important;
  color: #666 !important;
  cursor: not-allowed !important;
  opacity: 0.8;
  transform: none !important;
  box-shadow: none !important;
}

/* ======= Cart Panel (تم تحسينه) ======= */
/* ======= Cart Panel (Modern Redesign) ======= */
.cart-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(95vw, 420px);
  /* Slightly wider for better breathing room */
  height: 100vh;
  /* Full viewport height */
  background: #fff;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Smoother easing */
  padding: 0;
  /* Reset padding, handle internally */
  display: flex;
  flex-direction: column;
  z-index: 2200;
  /* Ensure it's above everything */
  border-radius: 20px 0 0 20px;
  /* Only round left side */
}

.cart-panel.open {
  right: 0;
}

/* Header & Close Button */
.cart-panel .cart-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: all 0.2s ease;
}

.cart-panel .cart-close-btn:hover {
  background: rgba(255, 0, 0, 0.1);
  color: #d32f2f;
  transform: rotate(90deg);
}

.cart-title {
  text-align: center;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 25px 20px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin: 0;
}

/* Items Container */
.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Empty State (Optional styling if JS inserts empty msg) */
.cart-items-container:empty::after {
  content: 'السلة فارغة';
  display: block;
  text-align: center;
  color: #999;
  margin-top: 50px;
  font-size: 1.1rem;
}

/* Individual Cart Item */
.cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fff;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: rgba(44, 165, 141, 0.15);
}

.cart-item img {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border-radius: 12px;
  /* Rounded corners */
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.cart-item-info span:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.cart-item-info span:last-child {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

/* Quantity Controls */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7f9fa;
  padding: 4px;
  border-radius: 20px;
  /* Capsule shape */
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  line-height: 0;
  padding: 0;
  padding-bottom: 3px;
  /* Stronger lift */
}

.qty-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(44, 165, 141, 0.25);
}

.qty-value {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  color: #333;
}

/* Footer Section (Total + Form) */
.cart-footer-wrapper {
  padding: 20px;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Total Section */
.cart-total-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: linear-gradient(135deg, rgba(44, 165, 141, 0.08) 0%, rgba(44, 165, 141, 0.02) 100%);
  border-radius: 12px;
  margin-bottom: 20px;
  /* Spacing before form */
  border: 1px solid rgba(44, 165, 141, 0.1);
}

.total-label {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
}

.total-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.cart-divider {
  display: none;
  /* Hidden in new design */
}

/* Form Styling */
.cart-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px 25px 20px;
  /* Padding matching wrapper */
  background: #fff;
}

.cart-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #fafafa;
  transition: all 0.3s ease;
  font-family: inherit;
}

.cart-input::placeholder {
  color: #aaa;
  font-weight: 400;
}

.cart-input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(44, 165, 141, 0.1);
  outline: none;
}

textarea.cart-input {
  resize: none;
  min-height: 80px;
}

/* Submit Button */
/* Submit Button (Enhanced) */
.btn.sendBtn {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  /* More rounded */
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(44, 165, 141, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 90%;
  /* Slightly centered/smaller width appearance if needed, but flex centered helps */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  /* Lift up */

}

.btn.sendBtn:hover {
  background: #258e79;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 25px rgba(44, 165, 141, 0.35);
}



.btn.sendBtn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(44, 165, 141, 0.2);
}

/* ======= Checkout Modal ======= */
.checkout-modal {
  width: min(90vw, 500px) !important;
  /* Slightly wider than standard modal */
  padding: 0 !important;
  /* Reset default padding */
  border-radius: 20px !important;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.checkout-modal .modal-title {
  text-align: center;
  background: var(--accent);
  color: #fff;
  padding: 24px 20px;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  border-top-left-radius: 20px;
  /* Ensure exact match with container */
  border-top-right-radius: 20px;
  /* Ensure exact match with container */
  width: 100%;
  /* Fix width */
}

.checkout-modal .closeModal {
  display: none !important;
}

.checkout-modal .closeModal:hover {
  background: rgba(255, 255, 255, 0.4) !important;
  transform: rotate(90deg);
}

.checkout-form {
  padding: 25px !important;
}

.checkout-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f0f7f5;
  border-radius: 12px;
  margin: 15px 0 20px 0;
  border: 1px dashed var(--accent);
}

.checkout-summary .total-label {
  font-size: 1.1rem;
}

.checkout-summary .total-value {
  font-size: 1.4rem;
}



/* ======= Footer ======= */
/* ======= Footer (New Design - Mobile First) ======= */
footer {
  background: var(--accent);
  color: #fff;
  border-top: none;
  padding: 60px 20px 30px;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  width: 100%;
}

/* Pattern Background */
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../images/footer-pattern.svg');
  background-repeat: repeat;
  background-size: 120px;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-section {
  width: 100%;
  max-width: 350px;
}

/* --- Right Section: Info --- */
.footer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.footer-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.footer-logo h3 {
  color: #fff;
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.footer-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* --- Center Section: Categories --- */
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-links h4 {
  color: #fff;
  font-size: 1.25rem;
  margin: 0 0 20px;
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.footer-links h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s;
  display: inline-block;
  padding: 2px 0;
}

.footer-links a:hover {
  transform: translateX(-5px);
  color: #fff;
  font-weight: 600;
}

/* --- Left Section: Contact --- */
.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-contact h4 {
  color: #fff;
  font-size: 1.25rem;
  margin: 0 0 20px;
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.footer-contact h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 5px;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: #fff;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border-color: #fff;
}

.social-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: filter 0.3s;
}

.social-link:hover .social-icon-img {
  filter: none;
}

/* --- Copyright --- */
.footer-copyright {
  margin-top: 50px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.8;
}

.footer-copyright .footer-dev {
  margin-top: 5px;
  font-size: 0.8rem;
  opacity: 0.75;
  color: rgba(255, 255, 255, 0.7);
}

.footer-copyright .footer-dev a {
  color: #a8edda;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-copyright .footer-dev a:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .footer-copyright {
    font-size: 0.82rem;
    margin-top: 35px;
    padding-top: 18px;
  }

  .footer-copyright .footer-dev {
    font-size: 0.75rem;
  }
}

/* ======= Desktop & Tablet (Horizontal Layout) ======= */
@media (min-width: 900px) {
  footer {
    text-align: right;
  }

  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: right;
  }

  .footer-section {
    max-width: none;
    flex: 1;
  }

  /* Right Section (Logo) */
  .footer-info {
    align-items: flex-start;
    text-align: right;
  }

  .footer-logo {
    align-items: flex-start;
  }

  /* Center Section (Links) */
  .footer-links {
    align-items: center;
    text-align: center;
  }

  .footer-links h4::after {
    left: 50%;
    transform: translateX(-50%);
  }

  /* Left Section (Contact) */
  .footer-contact {
    align-items: flex-end;
    text-align: left;
  }

  .footer-socials {
    justify-content: flex-end;
  }

  /* Fix header alignment for Left Section */
  .footer-contact h4 {
    display: block;
    width: 100%;
    text-align: left;
    /* Make text align left */
  }

  .footer-contact h4::after {
    left: 0;
    bottom: 0px;
    transform: none;
  }

  /* RTL Specific Adjustments */
  html[dir="rtl"] .footer-contact {
    align-items: flex-end;
    text-align: left;
    /* Left side of screen */
  }

  /* Force Left Alignment for Contact in Desktop RTL/LTR */
  /* In RTL, flex-end is Left. text-align: left is Left. */
}

/* ======= Modal محسّنة ======= */
.modal-bg {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeInBg 0.4s ease;
}

@keyframes fadeInBg {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: #fff;
  border-radius: 18px;
  width: 90%;
  max-width: 420px;
  padding: 24px 18px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal h3 {
  text-align: center;
  color: var(--accent);
  margin-top: 0;
  margin-bottom: 16px;
  font-size: clamp(18px, 2vw, 20px);
}

.modal input,
.modal textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: box-shadow 0.2s ease;
}

.modal input:focus,
.modal textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 165, 141, 0.25);
}

.modal textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
}

.modal button.sendBtn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
}

.modal .closeBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: crimson;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ======= Responsive Behavior ======= */
@media (max-width: 480px) {
  .cart-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--accent);
    border-radius: 50%;
    width: clamp(50px, 12vw, 60px);
    height: clamp(50px, 12vw, 60px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    justify-content: center;
    align-items: center;
    z-index: 4000;
    /* الزر فوق السلة */
  }

  .cart-container i {
    color: #fff;
    font-size: clamp(22px, 5vw, 28px);
  }

  .cart-panel {
    z-index: 3000;
    /* السلة تحت الزر */
  }

  .cart-item img {
    width: 50px;
    height: 50px;
  }

  .cart-item-info span {
    font-size: 13px;
  }
}

/* ======= زر إغلاق السلة ======= */
.cart-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 1400;
  transition: all 0.3s ease;
}

.cart-close-btn:hover {
  background: crimson;
  /* 🔴 أحمر ناعم عند المرور */
  transform: scale(1.1);
}

/* زر أصغر قليلاً للجوال */
@media (max-width: 480px) {
  .cart-close-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
    top: 10px;
    right: 10px;
  }
}

/* ======= تصحيح حجم النوافذ المنبثقة لتناسب كل المقاسات ======= */
@media (max-width: 1024px) {
  .modal {
    max-width: 420px;
    width: 85%;
    padding: 20px 16px;
  }
}

@media (max-width: 768px) {
  .modal {
    max-width: 380px;
    width: 90%;
    padding: 18px 14px;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .modal {
    max-width: 360px;
    width: 92%;
    padding: 16px 12px;
    border-radius: 14px;
  }

  .modal h3 {
    font-size: 17px;
  }

  .modal input,
  .modal textarea {
    font-size: 14px;
    padding: 10px 12px;
  }

  .modal button.sendBtn {
    font-size: 15px;
    padding: 10px;
  }
}

/* ======= تنسيق عناصر المنتجات داخل السلة ======= */
/* ======= تنسيق عناصر المنتجات داخل السلة (محسّن) ======= */
.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: 16px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s;
}

.cart-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
}

.cart-item img {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #f5f5f5;
  background-color: #fff;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  justify-content: center;
}

.cart-item-info span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  /* Allow wrapping for long names */
  white-space: normal;
}

.cart-item-info span:last-child {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ======= أزرار الزيادة والنقصان داخل السلة ======= */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover {
  background: #23947d;
  transform: scale(1.05);
}

.qty-value {
  font-weight: 600;
  color: var(--accent);
  font-size: 15px;
}

/* ======= About Us Section (Modern Redesign) ======= */
.about-section {
  background: linear-gradient(135deg, #f9fbfc 0%, #eef5f3 100%);
  border-top: none;
  padding: 80px 20px;
  text-align: center;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
  /* Ensures smooth scroll lands correctly below fixed header */
  scroll-margin-top: 100px;
}

/* Background Decoration */
.about-section::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: rgba(44, 165, 141, 0.05);
  /* Accent color transparent */
  border-radius: 50%;
  z-index: 0;
}

.about-section::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 150px;
  height: 150px;
  background: rgba(44, 165, 141, 0.08);
  border-radius: 50%;
  z-index: 0;
}

.about-container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  /* Above background shapes */
}

/* --- Header & Typography --- */
.about-header {
  margin-bottom: 30px;
}

.about-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

.about-icon-wrapper i {
  font-size: 2.5rem;
  color: var(--accent);
}

.section-title {
  color: var(--accent);
  font-weight: 800;
  font-size: 2.5rem;
  margin: 0;
  line-height: 1.2;
}

.section-subtitle {
  color: #777;
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 5px;
  letter-spacing: 0.5px;
}

/* --- Content Text --- */
.about-content {
  max-width: 700px;
  margin: 0 auto 50px;
}

.about-text {
  color: #555;
  line-height: 1.9;
  font-size: 1.05rem;
  margin: 0;
}

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  perspective: 1000px;
}

.feature-card {
  background: #fff;
  padding: 30px 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.02);
  cursor: pointer;
  /* Indicates interactivity */
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(44, 165, 141, 0.12);
  border-color: rgba(44, 165, 141, 0.1);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: rgba(44, 165, 141, 0.1);
  /* Light accent bg */
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: var(--accent);
  transform: rotate(5deg) scale(1.1);
}

.feature-icon img {
  width: 38px;
  height: 38px;
  /* Use filter to handle color transitions if using monotone SVGs, or just opacity */
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon img {
  transform: scale(1.1);
  filter: brightness(0) invert(1);
  /* Turn white on hover if background is accent */
}

.feature-card h3 {
  color: #333;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.feature-card p {
  color: #777;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered Animations for Cards */
.features-grid .feature-card {
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.features-grid .feature-card:nth-child(1) {
  animation-delay: 0.2s;
}

.features-grid .feature-card:nth-child(2) {
  animation-delay: 0.3s;
}

.features-grid .feature-card:nth-child(3) {
  animation-delay: 0.4s;
}

.features-grid .feature-card:nth-child(4) {
  animation-delay: 0.5s;
}

/* ======= Premium Delivery Card (Distinct Style) ======= */
.premium-delivery-card {
  border: 2px solid rgba(44, 165, 141, 0.15);
  /* Subtle green border */
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf9 100%);
}

.premium-delivery-card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 50px rgba(44, 165, 141, 0.18);
  transform: translateY(-8px);
}

.premium-delivery-card .feature-icon {
  background: #fff;
  border: 1px solid rgba(44, 165, 141, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

/* Ensure Logo retains original colors and scales properly */
.premium-delivery-card .feature-icon img.delivery-logo {
  width: 48px;
  /* Larger to show detail */
  height: 48px;
  object-fit: contain;
  filter: none !important;
  /* Disable strict icon coloring */
}

.premium-delivery-card:hover .feature-icon img.delivery-logo {
  transform: scale(1.15);
  /* Pop effect */
  filter: none !important;
  /* Convert back to none just in case */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on tablet */
    gap: 15px;
  }

  .section-title {
    font-size: 2rem;
  }

  .about-section {
    padding: 60px 15px;
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2x2 Grid on Mobile */
    gap: 12px;
  }

  .feature-card {
    padding: 20px 10px;
    height: 100%;
    /* Equal heights */
    border-radius: 12px;
    /* Slightly reduced radius */
  }

  .feature-card .feature-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 12px;
  }

  .feature-card .feature-icon img {
    width: 28px;
    height: 28px;
  }

  /* Mobile adjustment for premium logo */
  .premium-delivery-card .feature-icon img.delivery-logo {
    width: 36px;
    height: 36px;
  }

  .feature-card h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .feature-card p {
    font-size: 0.8rem;
    line-height: 1.4;
    display: block;
    /* Ensure it stays visible */
  }
}

/* للجوال */
@media (max-width: 480px) {
  .cart-item img {
    width: 50px;
    height: 50px;
  }

  .qty-btn {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }

  .qty-value {
    font-size: 14px;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 80px;
  /* الحجم الأصلي غالبًا 50 أو 60، كبرناه */
  height: auto;
}

.logo {
  font-size: 1.8rem;
  /* تكبير الخط */
  font-weight: 700;
}

.logo-text {
  font-family: 'Tajawal', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #1b69a4, #3ec4a4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

}

/* الافتراضي (الجوال) — يبقى مثل ما هو */
#freeNote {
  text-align: center;
  color: #777;
  margin-top: 10px;
  display: none;
}

/* 💻 فقط للكمبيوتر (شاشات أكبر من 768px) */
@media (min-width: 768px) {
  #freeNote {
    margin-top: 30px;
    /* يضيف مسافة بسيطة فوق */
    margin-bottom: 80px;
    /* يرفعه بعيد عن الفوتر */
  }
}

/* ======= Custom Notifications (Toasts) ======= */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 90%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: #fff;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideInTop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  pointer-events: auto;
  border: 1px solid rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  direction: rtl;
}

.toast.hiding {
  animation: slideOutTop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.toast::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}

/* Success */
.toast.success::before {
  background: #10B981;
}

.toast.success .toast-icon {
  color: #10B981;
}

/* Error */
.toast.error::before {
  background: #EF4444;
}

.toast.error .toast-icon {
  color: #EF4444;
}

/* Warning */
.toast.warning::before {
  background: #F59E0B;
}

.toast.warning .toast-icon {
  color: #F59E0B;
}

.toast-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  color: #374151;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
}

@keyframes slideInTop {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideOutTop {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
}

/* ======= SweetAlert2 Z-Index Override ======= */
/* Ensure SweetAlert2 appears above modals (modal z-index: 2000) */
.swal2-container {
  z-index: 10000 !important;
}

.swal2-popup {
  z-index: 10001 !important;
}

/* ======= Mobile UI Improvements ======= */
/* Tablet and below */
@media (max-width: 768px) {
  header {
    padding: 8px 14px;
  }

  .logo-text {
    font-size: 1.6rem;
    white-space: nowrap;
  }

  .products {
    gap: 12px;
    padding: 8px;
  }

  .search-box {
    margin: 12px 0;
  }
}

/* Mobile specific */
@media (max-width: 480px) {
  header {
    padding: 6px 10px;
    gap: 6px;
  }

  .logo-container {
    gap: 6px;
  }

  .logo-text {
    font-size: 1.35rem;
    white-space: nowrap;
  }


  .products {
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 8px;
    padding: 6px;
  }

  .card {
    padding: 8px;
    min-height: 250px;
  }

  .search-box {
    padding: 0 12px;
    margin: 10px 0;
  }

  .search-box input {
    padding: 10px 14px;
  }

  /* Improve About Us section spacing on mobile */
  .about-section {
    padding: 50px 16px;
    margin-top: 40px;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .about-text {
    font-size: 0.95rem;
    line-height: 1.7;
  }
}

/* ======= Horizontal Scroll Visual Indicators ======= */
/* Add subtle fade at edges to indicate scrollability */
@media (max-width: 768px) {

  /* Tabs scroll indicator */
  .tabs {
    position: relative;
    /* Reduce top/bottom margin for tabs on mobile */
    margin: 8px auto;
  }

  /* Subtle hint that tabs are scrollable */
  .tabs::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 8px;
    width: 40px;
    background: linear-gradient(to left, rgba(249, 251, 252, 0.95), transparent);
    pointer-events: none;
  }
}

/* ======= COMPACT MOBILE UI OVERRIDES ======= */
/* Final polish to tighten everything up */
@media (max-width: 480px) {

  /* 1. Header & Nav Tighter */
  header {
    padding: 5px 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }

  .nav-buttons {
    display: grid !important;
    /* Fixed small width to prevent stretching. 2 cols ~92px each */
    grid-template-columns: 1fr 1fr !important;
    width: 190px;
    max-width: 100%;
    gap: 5px;
  }

  .nav-buttons button {
    border-width: 1px;
    border-color: rgba(44, 165, 141, 0.4);
    padding: 0 4px;
    /* Use flexbox for centering */
    height: 32px;
    /* Fixed height for uniformity */
    font-size: 10px;
    font-weight: 400;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* Fill the grid cell */
  }

  /* 2. Products Grid Tighter */
  .products {
    gap: 8px;
    /* Reduce gap between cards */
    padding: 4px;
    /* Reduce container padding */
  }

  .card {
    padding: 8px;
    /* Reduce card internal padding */
    border-radius: 10px;
    /* Tighter radius */
    min-height: auto;
    /* Let content dictate height more */
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
    /* Lighter shadow */
  }

  .card img {
    margin-bottom: 6px;
    border-radius: 8px;
  }

  .card-content {
    margin-bottom: 8px;
  }

  .card-title {
    font-size: 0.9rem;
    min-height: 32px;
    /* Reduce spacer */
    margin-bottom: 4px;
  }

  .card-price {
    min-height: auto;
    /* Allow price to collapse */
    margin-top: 4px;
  }

  .btn {
    padding: 8px 10px;
    /* Smaller add to cart buttons */
    font-size: 12px;
    border-radius: 8px;
  }

  /* 3. Search Box Tighter */
  .search-box {
    margin: 8px 0;
    padding: 0 12px;
  }

  .search-box input {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 20px;
    /* Tighter radius */
  }

  /* 4. Tabs/Categories Tighter */
  .tabs {
    gap: 6px;
    margin: 6px auto;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 14px;
    border-width: 1px;
  }

  .tab-btn.active {
    padding: 7px 14px;
    box-shadow: 0 2px 6px rgba(44, 165, 141, 0.2);
  }

  /* 5. About Section Tighter */
  .about-section {
    padding: 30px 12px;
    /* Reduce padding significantly */
    margin-top: 20px;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .feature-card {
    padding: 16px;
  }
}