body {
  font-family: "Cairo", sans-serif;
  margin: 0;
  background: #f0f2f5;
  direction: rtl;
}

.container {
  max-width: 700px;
  margin: 40px auto;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}

h2 {
  text-align: center;
  margin: 0;
  font-size: 24px;
  color: #333;
}

.search-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

#searchInput {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
}

#medicineList {
  list-style: none;
  padding: 0;
}

#medicineList li {
  background: #f9f9f9;
  padding: 12px 15px;
  margin-bottom: 7px;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.2s;
  font-size: 16px;
}

#medicineList li:hover {
  background: #e0f3ff;
}

.medicine-card {
  background: #f9f9f9;
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  transition: 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.medicine-card:hover {
  background: #eaf7ff;
  border-color: #b4e2ff;
}

.out-of-stock {
  color: red;
  font-weight: bold;
  font-size: 14px;
  margin-right: 10px;
}

.tap-to-show {
  font-size: 13px;
  color: #888;
  margin-top: 6px;
}

.alt-section {
  margin-top: 8px;
}

.alt {
  background: #f0f0f0;
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 14px;
  color: #555;
  margin-top: 4px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 25px;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  text-align: right;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  font-family: "Cairo", sans-serif;
}

#medicineInfo p {
  margin: 10px 0;
  font-size: 16px;
  line-height: 1.6;
}

#medicineInfo p span.label {
  font-weight: bold;
  color: #333;
  margin-left: 8px;
}

#medicineInfo p span.value {
  color: #555;
}

#medicineInfo .alternatives-section {
  margin-top: 20px;
}

#medicineInfo .alternatives-section h4 {
  margin-bottom: 10px;
  color: #444;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#medicineInfo .alternatives-section ul {
  padding-right: 20px;
  margin: 0;
  list-style: none;
}

#medicineInfo .alternatives-section ul li {
  padding: 6px 10px;
  margin-bottom: 6px;
  background: #f4f4f4;
  border-radius: 6px;
  font-size: 15px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
}

#medicineInfo .alternatives-section ul li::before {
  content: "💊";
}

.close {
  position: absolute;
  left: 15px;
  top: 10px;
  font-size: 26px;
  cursor: pointer;
  color: #888;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 10px;
}

.pagination-controls button {
  background-color: black;
  border: none;
  color: white;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.pagination-controls button:hover {
  background-color: black;
}

.alternatives-section ul li {
  padding: 8px 12px;
  background: #f3f3f3;
  margin: 5px 0;
  border-radius: 6px;
  font-size: 15px;
}

.alternatives-section ul li:first-child {
  font-weight: bold;
  color: #888;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.back-button {
  background-color: black;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease;
  width: fit-content;
  white-space: nowrap;
}

.back-button:hover {
  background-color: #333;
}

.site-footer {
  background-color: #f1f5f9;
  border-top: 1px solid #e5e7eb;
  padding: 12px 20px;
  text-align: center;
}

.footer-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #6b7280;
  font-size: 14px;
}

.footer-content img {
  max-height: 24px;
  opacity: 0.85;
  cursor: pointer;
}

/* ==== Custom Modal Styles ==== */
.custom-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.custom-modal.hidden {
  display: none;
}

.form-step {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.form-step.active-step {
  display: flex;
}

.step-title {
  font-size: 18px;
  color: #1e40af;
  margin-bottom: 10px;
  font-weight: bold;
}

.form-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}

.form-buttons button {
  flex: 1;
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

/* Back button (gray) */
.form-buttons .back-btn {
  background-color: #e5e7eb; /* light gray */
  color: #333;
}

/* Next/Submit button (blue) */
.form-buttons .next-btn,
.form-buttons button[type="submit"] {
  background-color: #2563eb;
  color: white;
}

.form-buttons .next-btn:hover,
.form-buttons button[type="submit"]:hover {
  background-color: #1e40af;
}

.form-buttons .back-btn:hover {
  background-color: #d1d5db;
}

.custom-modal-content {
  background-color: #fff;
  padding: 30px 25px;
  width: 95%;
  max-width: 500px;
  border-radius: 12px;
  text-align: right;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  font-family: "Cairo", sans-serif;
}

.custom-modal-title {
  margin-bottom: 20px;
  font-size: 22px;
  color: #333;
}

.custom-modal-close {
  position: absolute;
  left: 16px;
  top: 10px;
  font-size: 26px;
  cursor: pointer;
  color: #888;
}

.custom-modal-content form input,
.custom-modal-content form textarea {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
}

.custom-modal-content form select {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
  background-color: white;
  font-family: "Cairo", sans-serif;
}

.custom-modal-content form label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.custom-modal-content form button {
  width: 100%;
  background-color: #2563eb;
  color: white;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.custom-modal-content form button:hover {
  background-color: #1d4ed8;
}

.request-btn {
  background-color: #2563eb;
  color: white;
  padding: 10px 16px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.request-btn:hover {
  background-color: #1e40af;
}

@media (max-width: 600px) {
  .top-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .back-button {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
  }
  .request-btn {
    width: 100%;
    font-size: 14px;
    padding: 10px 12px;
  }
}
