/* ===========================================
   أنماط الهيدر والنافيجيشن
   Header & Navigation Styles
   =========================================== */

/* ============ Header ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  box-shadow: var(--shadow-md);
}

/* Top Bar */
.header-top {
  background: var(--primary-500);
  color: white;
  padding: 8px 0;
  font-size: 0.875rem;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-top-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-contact a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  transition: opacity 0.3s ease;
  direction: ltr;
}

.header-contact a:hover {
  opacity: 0.8;
}

.header-top-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-top-info a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  transition: opacity 0.3s ease;
}

.header-top-info a:hover {
  opacity: 0.8;
}

.header-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.3s ease;
  color: white;
  border: none;
}

.lang-switch:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Header */
.header-main {
  padding: var(--spacing-lg) 0;
  border-bottom: 3px solid var(--primary-500);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-main .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.header-main-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--spacing-lg);
}

/* Logo in header */
.header-main-content .logo {
  flex-shrink: 0;
}

@media (max-width: 600px) {
  /* Hide top bar on small mobile - saves valuable space */
  .header-top {
    display: none;
  }
  
  .header-main {
    padding: 8px 0;
  }

  .header-main .container {
    gap: 0;
    align-items: center;
  }

  .header-main-content {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
    justify-content: space-between;
  }

  /* Logo on right, actions on left - single row */
  .header-main-content .logo {
    order: 0;
    flex: 0 0 auto;
  }

  .header-actions {
    order: 1;
    flex: 0 0 auto;
    gap: 6px;
    position: static;
  }

  /* Search full width below */
  .search-box {
    width: 100%;
    order: 3;
    flex: 1 1 100%;
    margin-top: 4px;
  }
}


/* Logo */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 70px;
  width: auto;
  max-width: 200px;
  display: block;
  object-fit: contain;
}

@media (max-width: 768px) {
  .logo-img {
    height: 55px;
  }
}

@media (max-width: 480px) {
  .logo-img {
    height: 45px;
  }
}

.logo img {
  height: 70px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-500);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo-text .logo-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0A2463;
  line-height: 1.2;
}

.logo-text .logo-tagline {
  font-size: 0.8rem;
  color: var(--red-main, #DC2626);
  font-weight: 600;
}

/* Search */
.header-search {
  flex: 1;
  max-width: 500px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 4px;
  transition: all var(--transition-fast);
  flex: 1;
  max-width: 500px;
  min-width: 200px;
}

.search-box:focus-within {
  background: white;
  box-shadow: 0 0 0 2px #0A2463;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 0.95rem;
  min-width: 0;
}

.search-box input:focus {
  outline: none;
}

.search-box button {
  width: 40px;
  height: 40px;
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-box button:hover {
  background: var(--red-main);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-action-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100, #f3f4f6);
  border-radius: 12px;
  color: var(--gray-700, #374151);
  transition: all 0.25s ease;
  position: relative;
  border: none;
  cursor: pointer;
  overflow: visible;
}

.header-action-btn:hover {
  background: var(--primary-500, #0A2463);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 36, 99, 0.2);
}

.header-action-btn i {
  font-size: 1.1rem;
}

/* Cart button - more prominent */
.header-action-btn.cart-btn {
  background: transparent;
  color: var(--primary-500, #0A2463);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow: 0 6px 14px rgba(10, 36, 99, 0.14);
}

.header-action-btn.cart-btn::after {
  content: none;
}

.header-action-btn.cart-btn:hover {
  background: rgba(10, 36, 99, 0.08);
  color: var(--primary-600, #081E54);
  box-shadow: 0 10px 20px rgba(10, 36, 99, 0.2);
  transform: translateY(-3px);
}

.header-action-btn.cart-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* SVG cart icon styling */
.cart-svg-icon {
  display: block;
  flex-shrink: 0;
}

.header-action-btn.cart-btn .cart-svg-icon {
  width: 23px;
  height: 23px;
  stroke-width: 2.25;
  stroke: currentColor;
  filter: none;
}

/* Bottom nav SVG cart */
.bottom-nav-item .cart-svg-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.header-action-btn.whatsapp-btn {
  background: #25D366;
  color: white;
}

.header-action-btn.whatsapp-btn:hover {
  background: #128C7E;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.64rem;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  line-height: 1;
  border: 2px solid #ffffff;
  box-shadow:
    0 7px 14px rgba(220, 38, 38, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 2;
  pointer-events: none;
}

/* Hide badge when count is 0 */
.cart-count:empty,
.cart-count[data-count="0"] {
  display: none;
}

body.ltr .cart-count {
  right: auto;
  left: -4px;
}

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--gray-100, #f3f4f6);
  border-radius: 12px;
  border: none;
  color: var(--gray-700, #374151);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.25s ease;
}

.mobile-menu-toggle:hover {
  background: var(--primary-500, #0A2463);
  color: white;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .search-box {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: auto;
  }

  .header-action-btn.whatsapp-btn {
    display: none;
  }

  .header-action-btn {
    width: 38px;
    height: 38px;
  }

  .header-action-btn.cart-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    color: var(--primary-500, #0A2463);
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow: 0 6px 14px rgba(10, 36, 99, 0.16);
  }

  .header-action-btn.cart-btn .cart-svg-icon {
    width: 21px;
    height: 21px;
  }

  .header-action-btn i {
    font-size: 1rem;
  }

  .cart-count {
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    font-size: 0.58rem;
    border-width: 1.5px;
  }
}

/* Navigation */
.header-nav {
  background: #f8f9fa;
  border-top: 1px solid #e5e7eb;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  color: #374151;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  text-decoration: none;
}

.nav-link:hover,
.nav-item.active .nav-link {
  color: #0A2463;
  background: white;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: transparent;
  transition: background-color 0.3s ease;
}

.nav-link:hover::after,
.nav-item.active .nav-link::after {
  background-color: var(--red-main, #DC2626);
}

.nav-link i {
  font-size: 1rem;
}

.nav-link i.fa-chevron-down {
  font-size: 0.7rem;
  margin-right: 4px;
}

/* Dropdown Menu */
.nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 100;
  padding: 8px 0;
}

body.ltr .nav-dropdown {
  right: auto;
  left: 0;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown li {
  list-style: none;
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: #374151;
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav-dropdown a:hover {
  background: #f3f4f6;
  color: #0A2463;
}

.nav-dropdown a i {
  width: 20px;
  color: #0A2463;
}

@media (max-width: 992px) {
  .header-nav {
    display: none;
  }

  .header-nav.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }

  .nav-menu {
    flex-direction: column;
    padding: 16px;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    display: none;
  }

  .nav-item.active .nav-dropdown {
    display: block;
  }
}

/* ============ Footer ============ */
.footer {
  background: #2C3E50;
  color: white;
  margin-top: auto;
}

.footer .container {
  padding: 48px 16px 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-column h3,
.footer-column h4,
.footer-col h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 10px;
}

.footer-column h3::after,
.footer-column h4::after,
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 3px;
  background: var(--red-main, #DC2626);
  border-radius: 50px;
}

body.ltr .footer-column h4::after,
body.ltr .footer-col h4::after {
  right: auto;
  left: 0;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-logo img {
  height: 40px;
  width: auto;
}

.footer-logo h3 {
  margin: 0;
  padding: 0;
}

.footer-logo h3::after {
  display: none;
}

.footer-column p,
.footer-col p {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-column ul a {
  color: #9ca3af;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.footer-column ul a:hover {
  color: var(--red-main, #DC2626);
  padding-right: 8px;
}

body.ltr .footer-column ul a:hover {
  padding-right: 0;
  padding-left: 8px;
}

.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-contact li i {
  color: var(--red-main, #DC2626);
  font-size: 1rem;
  margin-top: 3px;
  width: 16px;
}

.footer-contact li a {
  color: #9ca3af;
  transition: color 0.3s ease;
}

.footer-contact li a:hover {
  color: var(--red-main, #DC2626);
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  background: #374151;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: var(--red-main, #DC2626);
  color: #0A2463;
  transform: translateY(-3px);
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  text-align: center;
}

.footer-bottom p {
  color: #6b7280;
  font-size: 0.85rem;
  margin: 0;
}

.footer-payments {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-payments img {
  height: 24px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.footer-payments img:hover {
  opacity: 1;
}

.footer-payments i {
  font-size: 1.5rem;
  color: #9ca3af;
}

.footer-payments span {
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #9ca3af;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a:hover {
  color: white;
  padding-right: 8px;
}

body.ltr .footer-links a:hover {
  padding-right: 0;
  padding-left: 8px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-contact-item i {
  color: var(--red-main, #DC2626);
  font-size: 1.25rem;
  margin-top: 2px;
}

.footer-main {
  padding: 48px 0;
}

.footer-bottom-links {
  display: flex;
  gap: 24px;
}

.footer-bottom-links a {
  color: #6b7280;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
  color: var(--red-main, #DC2626);
}