/* تصميم موقع الفؤاد - قطع غيار السيارات */
/* RTL تصميم عربي احترافي */

@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap");

:root {
  /* هوية الفؤاد — من الشعار: أزرق ملكي #2A3593 وأصفر #FCD00A */
  --primary: #2A3593;
  --primary-dark: #1D2570;
  --primary-light: #5A64C2;
  --accent: #FCD00A;
  --accent-dark: #E0B800;
  --secondary: #ffffff;
  --silver: #c0c0c0;
  --silver-light: #e8e8e8;
  --silver-dark: #a0a0a0;
  --dark: #f5f5f5;
  --card-bg: #ffffff;
  --text: #1c2340;
  --text-muted: #6c757d;
  --success: #4caf50;
  --error: #d64550;
  --border: rgba(42, 53, 147, 0.18);
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* رأس الصفحة */
.header {
  padding: 20px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo-image {
  height: 100px;
  width: auto;
  margin-bottom: 5px;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px var(--shadow);
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 300;
  margin: 0;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 24px;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--primary);
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
}

.contact-link:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 53, 147, 0.3);
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  background: #ffffff;
  color: var(--primary);
  text-decoration: none;
  border-radius: 50%;
  border: 2px solid var(--primary);
  transition: all 0.3s ease;
}

.cart-link:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(42, 53, 147, 0.3);
}

.cart-icon {
  width: 26px;
  height: 26px;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 8px var(--shadow);
}

/* البطاقات */
.card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 4px 16px var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.section-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 700;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* حقول الإدخال */
.input-field {
  width: 100%;
  padding: 15px 20px;
  font-size: 1rem;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-family: "Cairo", sans-serif;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(42, 53, 147, 0.15);
}

.input-field::placeholder {
  color: var(--text-muted);
}

/* الأزرار */
.btn {
  padding: 15px 30px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Cairo", sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(42, 53, 147, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* نموذج بحث VIN */
.vin-search-form {
  display: flex;
  gap: 15px;
  align-items: stretch;
  position: relative;
}

.vin-search-form .input-field {
  flex: 1;
}

/* تاريخ بحث VIN */
.vin-history-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: white;
  border: 2px solid var(--silver-light);
  border-radius: 12px;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.vin-history-title {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--silver-light);
  cursor: default;
  padding: 12px 20px;
  font-size: 0.9rem;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.vin-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--silver-light);
  font-size: 1rem;
  color: var(--text);
}

.vin-history-item:last-child {
  border-bottom: none;
  border-radius: 0 0 12px 12px;
}

.vin-history-item:hover {
  background: var(--silver-light);
  padding-right: 16px;
}

.vin-history-item span {
  flex: 1;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* رسائل الخطأ */
.error-message {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 15px;
  border-radius: 10px;
  margin-top: 15px;
  font-weight: 600;
}

/* شبكة معلومات المركبة */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.vehicle-item {
  background: var(--secondary);
  padding: 20px;
  border-radius: 10px;
  border-right: 4px solid var(--primary);
}

.vehicle-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.vehicle-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* Autocomplete */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: 10px;
  margin-top: 5px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #e9ecef;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f8f9fa;
  padding-right: 25px;
}

.search-history-title:hover {
  background: transparent !important;
  padding-right: 20px !important;
}

.search-history-item {
  transition: all 0.2s ease;
}

.search-history-item:hover {
  background: #f0f8ff;
  transform: translateX(-3px);
}

.autocomplete-item-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 5px;
}

.autocomplete-item-code {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.searching-indicator {
  text-align: center;
  padding: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* شبكة القطع */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.part-card {
  background: var(--card-bg);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.part-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

.part-info {
  padding: 25px;
}

.part-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  text-align: center;
}

.part-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}

.part-details {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.part-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border-right: 3px solid var(--primary);
}

.part-detail-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.part-detail-value {
  font-weight: 600;
  color: var(--text);
}

.part-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.price-amount {
  font-size: 1.8rem;
}

.riyal-icon {
  width: 28px;
  height: 28px;
}

.price-text {
  font-size: 1rem;
  font-weight: 500;
}

/* حالة التحميل */
.loading-state {
  text-align: center;
  padding: 60px 20px;
}

.spinner-large {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* حالة فارغة */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

/* رسالة عدم توافر القطع */
.no-parts-message {
  text-align: center;
  padding: 60px 30px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 20px;
  border: 2px solid var(--silver-light);
  max-width: 600px;
  margin: 0 auto;
}

.no-parts-message h3 {
  color: var(--text);
  font-size: 1.8rem;
  margin-bottom: 30px;
  font-weight: 700;
  line-height: 1.5;
}

.whatsapp-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  padding: 18px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-contact-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
}

.whatsapp-contact-btn .whatsapp-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.whatsapp-contact-btn .phone-number {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  direction: ltr;
}

.whatsapp-contact-btn .whatsapp-text {
  font-size: 1rem;
  font-weight: 600;
}

/* التذييل */
.footer {
  text-align: center;
  padding: 40px 20px 20px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-note {
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .logo-image {
    height: 90px;
  }

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  .header-left {
    width: 100%;
    justify-content: center;
  }

  .logo-container {
    align-items: center;
    text-align: center;
  }

  .header-right {
    width: 100%;
    justify-content: center;
  }

  .tagline {
    text-align: center;
  }

  .vin-search-form {
    flex-direction: column;
  }

  .vehicle-grid {
    grid-template-columns: 1fr;
  }

  .parts-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }

  .part-price {
    flex-direction: column;
    gap: 5px;
  }

  .price-amount {
    font-size: 1.5rem;
  }

  /* رسالة عدم توافر القطع - موبايل */
  .no-parts-message {
    padding: 40px 20px;
  }

  .no-parts-message h3 {
    font-size: 1.3rem;
    line-height: 1.6;
  }

  .whatsapp-contact-btn {
    flex-direction: column;
    padding: 15px 25px;
    gap: 8px;
  }

  .whatsapp-contact-btn .phone-number {
    font-size: 1.1rem;
  }

  .whatsapp-contact-btn .whatsapp-text {
    font-size: 0.9rem;
  }
}

/* تخصيص شريط التمرير */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--secondary);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* نافذة تواصل معنا */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #ffffff;
  padding: 40px;
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  left: 20px;
  top: 20px;
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  color: var(--error);
  background: #f8f9fa;
  transform: rotate(90deg);
}

.modal-title {
  text-align: center;
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 30px;
  font-weight: 700;
}

.contact-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 15px;
  border: 2px solid #dee2e6;
  transition: all 0.3s ease;
}

.contact-item:hover {
  border-color: var(--primary);
  transform: translateX(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.whatsapp-item {
  border-color: #25d366;
}

.whatsapp-item:hover {
  border-color: #128c7e;
  background: #f0fdf4;
}

.contact-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
  flex-shrink: 0;
}

.whatsapp-icon {
  color: #25d366;
}

.contact-info {
  flex: 1;
}

.contact-info h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 600;
}

.contact-number {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  direction: ltr;
  display: inline-block;
  transition: all 0.3s ease;
}

.contact-number:hover {
  color: var(--primary-dark);
  transform: scale(1.05);
}

.whatsapp-number {
  color: #25d366;
}

.whatsapp-number:hover {
  color: #128c7e;
}

@media (max-width: 768px) {
  .modal-content {
    padding: 30px 20px;
    margin: 20px;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .contact-item {
    padding: 20px;
    gap: 15px;
  }

  .contact-icon {
    width: 35px;
    height: 35px;
  }

  .contact-number {
    font-size: 1.2rem;
  }
}

/* قسم شعارات الشركات */
.brands-section {
  margin: 40px 0;
}

.brands-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand-box {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 60px 40px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--silver-light);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px var(--shadow);
}

.brand-box:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--silver);
}

.toyota-box:hover {
  border-color: var(--primary);
}

.toyota-box {
  background-color: #b22222;
}

.lexus-box:hover {
  border-color: var(--silver-dark);
}

.lexus-box {
  background-color: #333;
}

.daihatsu-box {
  background-color: #fff;
}

.daihatsu-box:hover {
  border-color: #e60012;
}

/* الشعار عريض ومشبع اللون فيبدو أكبر من جاريه بالمقاس نفسه */
.daihatsu-box .brand-logo {
  width: 170px;
}

.brand-logo {
  max-width: 100%;
  width: 250px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: brightness(1);
  opacity: 1;
}

/* فوتر محدث - تصميم مودرن */
.footer {
  background: #ffffff;
  color: var(--text);
  padding: 60px 0 0;
  margin-top: 80px;
  border-top: 1px solid var(--silver-light);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 60px;
  padding-bottom: 40px;
}

.footer-brand {
  max-width: 400px;
}

.footer-logo {
  height: 100px;
  width: auto;
  margin-bottom: 20px;
}

.footer-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-column h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-column a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.footer-column a:hover {
  color: var(--primary);
  transform: translateX(-3px);
}

.footer-bottom {
  border-top: 1px solid var(--silver-light);
  padding: 25px 0;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

/* نافذة السلة */
.cart-modal-content {
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
}

.cart-items {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin-bottom: 15px;
  border: 1px solid var(--silver-light);
  transition: all 0.3s ease;
}

.cart-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(42, 53, 147, 0.1);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cart-item-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.remove-item-btn {
  background: var(--error);
  color: #ffffff;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.remove-item-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
}

.empty-cart-icon {
  width: 80px;
  height: 80px;
  color: var(--silver);
  margin: 0 auto 20px;
}

.empty-cart p {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 10px;
}

.empty-cart-desc {
  font-size: 1rem;
  color: var(--text-muted);
}

.cart-summary {
  border-top: 2px solid var(--silver-light);
  padding-top: 20px;
  margin-top: 20px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.total-price {
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-block {
  width: 100%;
  padding: 18px;
  font-size: 1.1rem;
}

/* تحسين أزرار شراء القطع */
.buy-btn {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: #ffffff;
  border: none;
  padding: 14px 30px;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Cairo", sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 25px auto 0;
  width: fit-content;
  min-width: 180px;
}

.buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(42, 53, 147, 0.3);
}

.buy-btn:active {
  transform: translateY(0);
}

.buy-btn-icon {
  width: 18px;
  height: 18px;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
  .brands-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .brand-box {
    padding: 40px 20px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }

  .cart-modal-content {
    max-height: 90vh;
  }

  .cart-item {
    flex-direction: column;
  }
}

/* ملخّص القطع وزر العرض التدريجي — الكتالوج يرجّع مئات القطع للتصنيف */
.parts-summary {
  grid-column: 1 / -1;
  margin: 0 0 5px;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.parts-more {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════
   اختيار المركبة من القوائم، وتبديل المحرّك
   ═══════════════════════════════════════════════════════ */

/* زرّ بهيئة رابط: فتح القوائم فعلٌ ثانوي بجانب البحث برقم الهيكل،
   فلا يُنافسه بزرّ ممتلئ */
.link-button {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-family: "Cairo", sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-button:hover {
  color: var(--primary-dark);
}

.manual-select {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e9ecef;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

/* القائمة المعطّلة تُقرأ كخطوةٍ لم يحن دورها بعد، لا كعطل */
.manual-grid .input-field:disabled {
  background: #f8f9fa;
  color: #adb5bd;
  cursor: not-allowed;
}

.manual-select .btn {
  width: 100%;
}

.engine-chooser {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e9ecef;
  flex-wrap: wrap;
}

.engine-label {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.engine-chooser .input-field {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
}


/* ── brand lockup ────────────────────────────────────────────────────────────
   Replaces the old logo image, which carried a client's name and an "authorised
   Toyota distributor" line — a claim that belonged to that client, not to this
   platform. Drawn in markup rather than shipped as a file so it takes the theme
   colour with it and stays sharp at any size. */
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--primary);
}
.brand-mark { width: 54px; height: 54px; flex: none; display: block; }
.brand-logo-img { height: 64px; width: auto; flex: none; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b {
  font-size: 1.75rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px;
}
.brand-text i {
  font-style: normal; font-size: 0.92rem; font-weight: 600; color: var(--primary);
}
.brand-footer { margin-bottom: 18px; }

@media (max-width: 768px) {
  .brand-mark { width: 42px; height: 42px; }
  .brand-logo-img { height: 48px; }
  .brand-text b { font-size: 1.45rem; }
  .brand-text i { font-size: 0.82rem; }
}

/* ── تحسينات الواجهة 2026-10-03 ─────────────────────────────────────────
   بطاقة القطعة: الماركة عنوانها (اسم القطعة واحد للقائمة كلها فيُكتب مرة
   فوقها)، ورقم القطعة ظاهر، والزر يتحوّل «في السلة» بدل alert يوقف الصفحة. */
.parts-head {
  grid-column: 1 / -1;
  text-align: center;
}
.parts-head-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.parts-head-note {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.parts-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.part-card:hover { transform: none; }
.part-info {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}
.part-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  direction: ltr;
  text-align: right;
}
.part-variant {
  font-size: 0.88rem;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
  line-height: 1.4;
}
.part-variant-ar {
  font-size: 0.92rem;
  color: var(--text);
  text-align: right;
  line-height: 1.5;
  unicode-bidi: plaintext;
}
.part-number {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.part-number bdi {
  font-weight: 700;
  color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.part-info .buy-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
}
.part-info .part-number { margin-bottom: 8px; }
.buy-btn.in-cart {
  background: #e8f6ee;
  color: #1f7a45;
  border: 1px solid #9fd8b6;
  box-shadow: none;
}

.autocomplete-item-title { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: #1f2d3a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-weight: 600;
  z-index: 3000;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.toast span { white-space: nowrap; }
.toast-action {
  background: transparent;
  border: 0;
  color: var(--primary-light);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 768px) {
  /* الرأس صفّ واحد: الشعار يميناً والأزرار يساراً، بدل عمودين يأكلان ربع الشاشة */
  .header { padding: 12px 0; margin-bottom: 20px; }
  .header-content { flex-direction: row; gap: 10px; }
  .header-left, .header-right { width: auto; }
  .header-right { gap: 10px; }
  .contact-link { padding: 9px 14px; font-size: 0.9rem; }
  .cart-link { width: 44px; height: 44px; }
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-logo-img { height: 40px; }
  .brand-text b { font-size: 1.3rem; }

  /* بيانات المركبة: عمودان مضغوطان بدل سبع بطاقات بطول الشاشة */
  .vehicle-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vehicle-item { padding: 10px 12px; border-right-width: 3px; }
  .vehicle-label { font-size: 0.78rem; margin-bottom: 2px; }
  .vehicle-value { font-size: 0.98rem; }

  .parts-grid { grid-template-columns: 1fr; gap: 12px; }
  .part-info { padding: 14px 16px; }
  .part-info .buy-btn { padding: 10px 16px; font-size: 0.95rem; }

  .brands-container { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .brand-box { min-height: 100px; padding: 14px 8px; border-radius: 14px; }
  .brand-box:hover { transform: none; }
}

/* شعارا الماركتين يفتحان القوائم بالماركة مختارة */
.toyota-box, .lexus-box { cursor: pointer; }
.toyota-box:focus-visible, .lexus-box:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* صورة القطعة */
.part-card { display: flex; flex-direction: column; }
.part-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
  border-bottom: 1px solid #eef0f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.part-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
}
.part-img img.part-img-loading {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.part-img-ph {
  width: 56px;
  height: 56px;
  color: #c9ced4;
}
.part-img.has-img { cursor: zoom-in; }
.part-img.has-img:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.part-info { flex: 1; }
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}
.img-viewer img {
  max-width: min(92vw, 720px);
  max-height: 86vh;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  object-fit: contain;
}
.img-viewer-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 768px) {
  .part-card { flex-direction: row; }
  .part-img { width: 110px; flex: 0 0 110px; aspect-ratio: auto; border-bottom: 0; border-left: 1px solid #eef0f2; }
  .part-img img { padding: 8px; }
  .part-img-ph { width: 40px; height: 40px; }
}

.part-price { font-size: 0.92rem; color: #0a7a3d; }


/* ── هوية الفؤاد: لمسات الأصفر ────────────────────────────────────────── */
.header { border-bottom: 3px solid var(--accent); }
.brand-text b { color: var(--primary); }
.brand-text i { color: var(--text-muted); }
.contact-link:hover { box-shadow: 0 4px 12px rgba(252, 208, 10, 0.45); }
.footer { border-top: 4px solid var(--accent); }
