@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #0B3A75;
  --primary-dark: #082B58;
  --primary-light: #EFF8FF;
  --secondary: #5AA9E6;
  --accent: #8CCAF7;

  --background: #FFFFFF;
  --surface: #F5F7FA;

  --text-primary: #1F2937;
  --text-secondary: #6B7280;

  --border: #D9E2EC;

  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  direction: rtl;
  color: var(--text-primary);
  background: var(--background);
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-primary:active {
  transform: scale(0.97);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 10px 22px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-wa:hover {
  background: #1ebe5c;
}

/* Floating WhatsApp button */
.wa-float {
  position: fixed;
  bottom: 96px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 40;
  transition: transform 0.2s;
}
.wa-float:hover {
  transform: scale(1.1);
}
@media (min-width: 768px) {
  .wa-float {
    bottom: 24px;
  }
}

/* Mobile bottom bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  z-index: 30;
}
@media (min-width: 768px) {
  .bottom-bar {
    display: none;
  }
}

.cart-badge {
  position: absolute;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cart drawer */
#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 49;
}

#cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, 100vw);
  background: #fff;
  z-index: 50;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#cart-drawer.translate-x-0 {
  transform: translateX(0);
}

/* Trust badges */
.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Form inputs */
.calc-input,
.calc-select,
.search-input {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  text-align: right;
  direction: rtl;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.calc-input:focus,
.calc-select:focus,
.search-input:focus {
  border-color: var(--primary);
}
.calc-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  background-size: 16px;
  padding-left: 40px;
}

/* Result cards */
.result-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 16px;
  padding: 20px;
}

/* Product card */
.product-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(11, 58, 117, 0.15);
}

.product-icon-box {
  height: 140px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-icon-box span {
  font-size: 48px;
}

/* Category card */
.category-card {
  background: #fff;
  border-radius: 20px;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
.category-card:hover,
.category-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Section heading */
.section-title {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  color: var(--text-primary);
}
.section-line {
  width: 48px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* Footer */
footer {
  background: var(--primary-dark);
  color: #d1d5db;
}
footer a:hover {
  color: var(--secondary);
}

/* Grids */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Hero */
.hero {
  min-height: 360px;
}
@media (min-width: 768px) {
  .hero {
    min-height: 520px;
  }
}

/* Toast animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.animate-fade-in {
  animation: fadeIn 0.25s ease;
}
