/* ============================================
   Dark Mode (Default)
   ============================================ */
:root {
  --accent: #ff1616;
  --accent-hover: #e01010;
  --accent-glow: rgba(255, 22, 22, 0.15);
  --header-bg: rgba(15, 15, 15, 0.92);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-hover-bg: rgba(255, 255, 255, 0.08);
  --body-bg: #0a0a0a;
  --body-bg2: #1a1a2e;
  --text: #ffffff;
  --text-secondary: #e0e0e0;
  --muted: #a0a0a0;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --cart-bg: #141414;
  --cart-bg2: #0d0d0d;
  --modal-bg: #1f1f1f;
  --modal-bg2: #141414;
  --toast-bg: #1a1a1a;
  --input-bg: rgba(255, 255, 255, 0.08);
  --input-focus-bg: rgba(255, 255, 255, 0.12);
  --footer-bg: rgba(0, 0, 0, 0.5);
  --scrollbar-track: rgba(255, 255, 255, 0.05);
  --scrollbar-thumb: rgba(255, 255, 255, 0.2);
  --img-bg: #ffffff;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --cart-item-bg: rgba(255, 255, 255, 0.03);
  --cart-item-hover: rgba(255, 255, 255, 0.06);
  --select-option-bg: #1a1a1a;
  --empty-icon-color: #888;
  --price-in-cart: #ff1616;
  --remove-color: #ff4444;
  --remove-hover: #ff0000;
  --qty-bg: var(--accent);
}

/* ============================================
   Light Mode - مريح للعين
   ============================================ */
body.light-mode {
  --accent: #e02020;
  --accent-hover: #c41818;
  --accent-glow: rgba(224, 32, 32, 0.12);
  --header-bg: rgba(240, 242, 248, 0.88);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-hover-bg: rgba(255, 255, 255, 0.9);
  --body-bg: #e8ecf1;
  --body-bg2: #dde2ea;
  --text: #1e2a3a;
  --text-secondary: #3a4a5c;
  --muted: #6b7b8d;
  --border: rgba(30, 42, 58, 0.1);
  --border-hover: rgba(30, 42, 58, 0.2);
  --shadow: 0 10px 40px rgba(30, 42, 58, 0.08);
  --shadow-card: 0 4px 24px rgba(30, 42, 58, 0.06);
  --cart-bg: #f0f2f6;
  --cart-bg2: #e8eaee;
  --modal-bg: #f4f6fa;
  --modal-bg2: #eceef2;
  --toast-bg: #f4f6fa;
  --input-bg: rgba(30, 42, 58, 0.06);
  --input-focus-bg: rgba(30, 42, 58, 0.09);
  --footer-bg: rgba(30, 42, 58, 0.05);
  --scrollbar-track: rgba(30, 42, 58, 0.06);
  --scrollbar-thumb: rgba(30, 42, 58, 0.15);
  --img-bg: #f0f2f5;
  --overlay-bg: rgba(30, 42, 58, 0.4);
  --cart-item-bg: rgba(30, 42, 58, 0.03);
  --cart-item-hover: rgba(30, 42, 58, 0.06);
  --select-option-bg: #f0f2f6;
  --empty-icon-color: #8899aa;
  --price-in-cart: #e02020;
  --remove-color: #d93636;
  --remove-hover: #c41818;
  --qty-bg: #e02020;
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", "Inter", sans-serif;
  background: linear-gradient(160deg, var(--body-bg) 0%, var(--body-bg2) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  padding-top: 85px;
  direction: rtl;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.4s ease;
}

body.no-scroll {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   الحاوية
   ============================================ */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Overlay
   ============================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1050;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: var(--toast-bg);
  border: 1px solid #22c55e;
  padding: 15px 25px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-150%);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2000;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
}

.toast.show {
  transform: translateX(0);
}

.toast i {
  color: #22c55e;
  font-size: 20px;
}

/* ============================================
   الهيدر
   ============================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s ease,
              background 0.5s ease,
              border-color 0.4s ease;
}

header.scrolled {
  box-shadow: var(--shadow);
}

.top_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  gap: 20px;
}

.logo { flex-shrink: 0; }

.logo img {
  height: 45px;
  width: auto;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo:hover img {
  transform: scale(1.08) rotate(-2deg);
}

.hamburger {
  display: none;
  background: transparent;
  border: 0;
  font-size: 24px;
  color: var(--text);
  padding: 10px;
  transition: color 0.4s ease;
}

.right-section {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  justify-content: flex-end;
}

/* صندوق البحث */
.search_box {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: 50px;
  min-width: 250px;
  max-width: 400px;
  flex: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search_box:focus-within {
  border-color: var(--accent);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search_box input {
  flex: 1;
  border: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: color 0.4s ease;
}

.search_box input::placeholder {
  color: var(--muted);
  transition: color 0.4s ease;
}

.search_box button {
  background: var(--accent);
  color: #fff;
  padding: 8px 15px;
  border-radius: 50px;
  border: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search_box button:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
}

.category select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 15px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.category select:hover {
  border-color: var(--accent);
}

.category select option {
  background: var(--select-option-bg);
  color: var(--text);
}

/* أيقونات الهيدر */
.header_icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon {
  position: relative;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.icon i {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.count {
  position: absolute;
  top: -5px;
  left: -5px;
  background: var(--accent);
  color: #fff;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle .fa-sun {
  position: absolute;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #fbbf24;
}

.theme-toggle .fa-moon {
  position: absolute;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: rotate(-90deg) scale(0.3);
  color: #6366f1;
}

.theme-toggle:hover .fa-sun {
  transform: rotate(30deg) scale(1.1);
}

body.light-mode .theme-toggle .fa-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.3);
}

body.light-mode .theme-toggle .fa-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

body.light-mode .theme-toggle:hover .fa-moon {
  transform: rotate(-15deg) scale(1.1);
}

body.light-mode .theme-toggle:hover {
  background: #6366f1;
  border-color: #6366f1;
}

body.light-mode .theme-toggle:hover .fa-moon {
  color: #fff;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 50%, #ff8a65 100%);
  padding: 45px;
  margin-bottom: 35px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  animation: heroSlideIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroSlideIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: float 8s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -30%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 20px); }
}

.hero h1 {
  font-size: 28px;
  margin-bottom: 10px;
  position: relative;
  color: #fff;
}

.hero p {
  font-size: 15px;
  opacity: 0.92;
  position: relative;
  max-width: 600px;
  line-height: 1.8;
  color: #fff;
}

/* ============================================
   المحتوى الرئيسي
   ============================================ */
.main_content {
  padding: 20px 0 60px;
  min-height: 60vh;
}

/* ============================================
   شبكة المنتجات
   ============================================ */
.products_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

/* ============================================
   كارت المنتج
   ============================================ */
.product_card {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.product_card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  background: var(--card-hover-bg);
  box-shadow: 0 20px 50px var(--accent-glow), var(--shadow-card);
}

.product_img {
  height: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--img-bg);
  position: relative;
}

.product_img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.product_card:hover .product_img img {
  transform: scale(1.08);
}

.product_meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product_title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.4s ease;
}

.product_price {
  font-weight: 800;
  font-size: 22px;
  color: var(--accent);
  transition: color 0.4s ease;
}

.product_desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  transition: color 0.4s ease;
}

.product_actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  transition: border-color 0.4s ease;
}

/* ============================================
   الأزرار
   ============================================ */
.btn {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn_view {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  flex: 1;
}

.btn_view:hover {
  background: var(--input-bg);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn_add {
  background: var(--accent);
  color: #fff;
  flex: 1;
}

.btn_add:hover {
  background: var(--accent-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn_fav {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 45px;
  min-width: 45px;
  height: 45px;
  padding: 0;
}

.btn_fav:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

.btn_fav.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: heartPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ============================================
   سلة المشتريات
   ============================================ */
.cart_sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 400px;
  max-width: 100%;
  background: linear-gradient(180deg, var(--cart-bg) 0%, var(--cart-bg2) 100%);
  right: -420px;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.4s ease;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 60px rgba(0, 0, 0, 0.25);
  border-left: 1px solid var(--border);
}

.cart_sidebar.open {
  right: 0;
}

.cart_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.4s ease;
}

.cart_header h3 {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--text);
  transition: color 0.4s ease;
}

.cart_header button {
  width: 40px;
  height: 40px;
  background: var(--input-bg);
  border: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 18px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart_header button:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(90deg) scale(1.1);
}

.cart_items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart_item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: var(--cart-item-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 15px;
  transition: all 0.35s ease;
  border: 1px solid transparent;
}

.cart_item:hover {
  background: var(--cart-item-hover);
  border-color: var(--border);
}

.cart_item img {
  width: 80px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}

.cart_footer {
  padding: 25px;
  border-top: 1px solid var(--border);
  background: var(--cart-item-bg);
  transition: all 0.4s ease;
}

.cart_total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
  transition: color 0.4s ease, border-color 0.4s ease;
}

.checkout_btn,
#confirmOrder {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#confirmOrder:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(37, 211, 102, 0.3);
}

.qty_minus,
.qty_plus {
  width: 30px;
  height: 30px;
  background: var(--qty-bg);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty_minus:hover,
.qty_plus:hover {
  transform: scale(1.15);
  background: var(--accent-hover);
}

.qty_val {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
  color: var(--text);
  transition: color 0.4s ease;
}

.remove_item {
  background: none;
  border: none;
  color: var(--remove-color);
  cursor: pointer;
  padding: 5px;
  transition: all 0.3s ease;
}

.remove_item:hover {
  color: var(--remove-hover);
  transform: scale(1.2) rotate(8deg);
}

/* ============================================
   المودال
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal_content {
  background: linear-gradient(180deg, var(--modal-bg) 0%, var(--modal-bg2) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 850px;
  width: 100%;
  position: relative;
  transform: scale(0.88) translateY(25px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.modal.open .modal_content {
  transform: scale(1) translateY(0);
}

.modal_close {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 45px;
  height: 45px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal_close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: rotate(90deg) scale(1.1);
}

.modal_body {
  padding: 30px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.modal_img {
  flex: 0 0 300px;
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--img-bg);
}

.modal_img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal_img:hover img {
  transform: scale(1.05);
}

.modal_info {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal_info h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  transition: color 0.4s ease;
}

.modal_info .price {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  transition: color 0.4s ease;
}

.modal_info .desc {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  transition: color 0.4s ease;
}

/* ============================================
   الفوتر
   ============================================ */
.site_footer {
  background: var(--footer-bg);
  padding: 40px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border);
  text-align: center;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.site_footer p {
  color: var(--muted);
  margin: 0;
  transition: color 0.4s ease;
}

/* ============================================
   زر الصعود لأعلى
   ============================================ */
.scroll_top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 5px 25px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll_top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll_top:hover {
  transform: translateY(-5px) scale(1.1);
  background: var(--accent-hover);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================================
   WhatsApp
   ============================================ */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  text-decoration: none;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 35px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

@keyframes whatsapp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-tooltip {
  position: absolute;
  right: 70px;
  background: var(--toast-bg);
  color: var(--text);
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent transparent var(--toast-bg);
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* ============================================
   Selection & Focus
   ============================================ */
::selection {
  background: var(--accent);
  color: #fff;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Responsive - تابلت
   ============================================ */
@media (max-width: 1024px) {
  .products_grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .hero {
    padding: 30px;
  }

  .hero h1 {
    font-size: 24px;
  }
}

/* ============================================
   Responsive - موبايل
   ============================================ */
@media (max-width: 768px) {
  body {
    padding-top: 75px;
  }

  .top_header {
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 12px;
  }

  .logo img {
    height: 38px;
  }

  .hamburger {
    display: flex;
    order: 2;
  }

  .right-section {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
  }

  .search_box {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: unset;
    order: 1;
  }

  .category {
    flex: 1;
  }

  .category select {
    width: 100%;
  }

  .header_icons {
    order: 0;
    position: absolute;
    left: 60px;
    top: 18px;
  }

  .hero {
    padding: 25px 20px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .hero p {
    font-size: 14px;
  }

  .products_grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product_img {
    height: 220px;
  }

  .cart_sidebar {
    width: 100%;
    right: -100%;
  }

  .modal_body {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }

  .modal_img {
    flex: none;
    width: 100%;
    height: 220px;
  }

  .modal_info h2 {
    font-size: 20px;
  }

  .modal_info .price {
    font-size: 24px;
  }

  .modal_close {
    width: 38px;
    height: 38px;
    right: 15px;
    top: 15px;
  }

  .toast {
    left: 15px;
    right: 15px;
    bottom: 20px;
  }

  .scroll_top {
    bottom: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
  }

  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    font-size: 28px;
  }

  .whatsapp-tooltip {
    display: none;
  }
}

/* ============================================
   Responsive - موبايل صغير
   ============================================ */
@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .icon {
    width: 40px;
    height: 40px;
  }

  .icon i {
    font-size: 16px;
  }

  .count {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .product_card {
    padding: 15px;
  }

  .product_title {
    font-size: 15px;
  }

  .product_price {
    font-size: 20px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .product_actions {
    flex-wrap: wrap;
  }

  .btn_view,
  .btn_add {
    flex: 1 1 calc(50% - 5px);
  }

  .btn_fav {
    width: 100%;
    flex: 1 1 100%;
  }

  .cart_header {
    padding: 20px 15px;
  }

  .cart_header h3 {
    font-size: 18px;
  }

  .cart_items {
    padding: 15px;
  }

  .cart_item {
    padding: 12px;
  }

  .cart_item img {
    width: 65px;
    height: 55px;
  }

  .cart_footer {
    padding: 20px 15px;
  }

  .cart_total {
    font-size: 18px;
  }

  #confirmOrder {
    padding: 14px;
    font-size: 15px;
  }
}