/* Modal Overlay */
.otp-modal-overlay {
  display: none;
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}
.otp-modal-overlay.active {
  display: flex;
}

/* RTL Support */
[dir="rtl"] .otp-modal {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .otp-modal-left {
  text-align: right;
}

[dir="rtl"] .otp-modal-right {
  text-align: right;
}

[dir="rtl"] .otp-modal-close {
  right: auto;
  left: 24px;
}

[dir="rtl"] .otp-modal-footer {
  text-align: right;
}

[dir="rtl"] .otp-modal-input {
  text-align: right;
}

[dir="rtl"] .otp-modal-label {
  text-align: right;
}

[dir="rtl"] .otp-modal-title {
  text-align: right;
}

[dir="rtl"] .otp-modal-desc {
  text-align: right;
}

/* LTR Support */
[dir="ltr"] .otp-modal {
  direction: ltr;
  text-align: left;
}

[dir="ltr"] .otp-modal-left {
  text-align: left;
}

[dir="ltr"] .otp-modal-right {
  text-align: left;
}

[dir="ltr"] .otp-modal-close {
  left: auto;
  right: 24px;
}

[dir="ltr"] .otp-modal-footer {
  text-align: center;
}

[dir="ltr"] .otp-modal-input {
  text-align: left;
}

[dir="ltr"] .otp-modal-label {
  text-align: left;
}

[dir="ltr"] .otp-modal-title {
  text-align: left;
}

[dir="ltr"] .otp-modal-desc {
  text-align: left;
}

/* Arabic Font Support */
[dir="rtl"] .otp-modal,
[dir="rtl"] .otp-modal * {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

[dir="rtl"] .otp-modal-title {
  font-weight: 700;
  letter-spacing: 0.5px;
}

[dir="rtl"] .otp-modal-desc {
  line-height: 1.8;
}

[dir="rtl"] .otp-modal-input {
  direction: rtl;
  text-align: right;
  padding-right: 12px;
  padding-left: 12px;
}

[dir="rtl"] .otp-modal-btn {
  direction: rtl;
  text-align: center;
}

[dir="rtl"] .otp-modal-footer {
  direction: rtl;
  text-align: center;
}

[dir="rtl"] .otp-modal-footer span {
  margin: 0 8px;
}

[dir="rtl"] .otp-modal-powered {
  text-align: center;
  direction: rtl;
}

[dir="rtl"] .otp-modal-powered a {
  margin: 0 4px;
    color: white;
}

.otp-modal-powered a {
    margin: 0 4px;
    color: white;
    text-decoration: none;
}

/* Modal Container */
.otp-modal {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  max-width: 1000px;
  width: 98vw;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
  padding: 0;
  font-size: 1.4rem;
  max-height: 65vh;
  height: 55vh;
  overflow-y: auto;
}

/* Left Column (Order Summary) */
.otp-modal-left {
  background: linear-gradient(135deg, #1a2236 60%, #232946 100%);
  color: #fff;
  flex: 1;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  min-width: 340px;
}

/* Shop Logo Styling */
.otp-modal-left img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.otp-modal-left img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.otp-modal-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.otp-modal-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.otp-modal-shop {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

/* Right Column (Form) */
.otp-modal-right {
  background: #fff;
  flex: 1.2;
  padding: 32px 32px 24px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 420px;
}
.otp-modal-close {
  position: absolute;
  right: 24px;
  top: 24px;
  font-size: 1.6rem;
  color: #232946;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  background: none;
  border: none;
}
.otp-modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #232946;
}
.otp-modal-desc {
  color: #637381;
  font-size: 1.2rem;
  margin-bottom: 24px;
}
.otp-modal-label {
  display: block;
  margin-bottom: 8px;
  color: #232946;
  font-weight: 500;
  font-size: 1.2rem;
}
.otp-modal-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1.2rem;
  margin-bottom: 18px;
  transition: border-color 0.2s;
}
.otp-modal-btn {
  background: #232946;
  color: #fff;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.3rem;
  cursor: pointer;
  width: 100%;
  margin-bottom: 10px;
  transition: background 0.2s;
}
.otp-modal-btn:disabled {
  background: #bfc8e6;
  cursor: not-allowed;
}
.otp-modal-btn-alt {
  background: #e4e5e7;
  color: #232946;
  margin-top: 0;
}
.otp-modal-otp-section {
  margin-top: 18px;
}
.otp-modal-footer {
  margin-top: 24px;
  display: flex;
  gap: 18px;
  justify-content: center;
  color: #637381;
  font-size: 1.2rem;
}
.otp-modal-footer a {
  color: #232946;
  text-decoration: underline;
  margin: 0 4px;
}
.otp-modal-icons {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 18px;
  color: #bfc8e6;
  font-size: 1.3rem;
}

@media (max-width: 700px) {
  .otp-modal {
    flex-direction: column;
    max-width: 95vw;
    min-width: 0;
    width: 95vw;
    height: auto;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    padding: 0;
    font-size: 1.1rem;
    margin: 20px;
  }

  /* RTL Mobile Support */
  [dir="rtl"] .otp-modal-close {
    right: auto;
    left: 16px;
  }

  [dir="rtl"] .otp-modal-left,
  [dir="rtl"] .otp-modal-right {
    text-align: right;
  }

  /* LTR Mobile Support */
  [dir="ltr"] .otp-modal-close {
    left: auto;
    right: 16px;
  }

  [dir="ltr"] .otp-modal-left,
  [dir="ltr"] .otp-modal-right {
    text-align: left;
  }

  .otp-modal-left, .otp-modal-right {
    min-width: 0;
    padding: 20px 16px 16px 16px;
  }

  /* Mobile Shop Logo Styling */
  .otp-modal-left img,
  .otp-modal-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    padding: 6px;
    border-radius: 10px;
  }

  .otp-modal-shop {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }

  .otp-modal-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
  }
  .otp-modal-desc {
    font-size: 1.1rem;
    margin-bottom: 18px;
  }
  .otp-modal-label {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
  .otp-modal-input {
    font-size: 1.1rem;
    padding: 14px;
    margin-bottom: 14px;
  }
  .otp-modal-btn {
    font-size: 1.15rem;
    padding: 16px 0;
    margin-bottom: 12px;
  }
  .otp-modal-close {
    right: 16px;
    top: 16px;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
  }
  .otp-modal-footer {
    margin-top: 18px;
    gap: 10px;
    font-size: 1rem;
    flex-wrap: wrap;
  }
  .otp-modal-powered {
    font-size: 1rem;
  }

  /* Mobile Security Features */
  .otp-modal-security {
    padding: 12px;
    margin-bottom: 16px;
  }

  .otp-modal-security-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }

  .otp-modal-security-items {
    gap: 6px;
  }

  .otp-modal-security-item {
    gap: 6px;
  }

  .otp-modal-security-icon {
    font-size: 1.4rem;
    width: 16px;
  }

  .otp-modal-security-text {
    font-size: 1.25rem;
  }

  /* Mobile RTL Security Support */

  [dir="rtl"] .otp-modal-security-text {
    text-align: right;
  }

  [dir="rtl"] .otp-modal-security-items {
    align-items: start;
  }

  [dir="rtl"] .otp-modal-security-icon {
    margin-left: 0;
    margin-right: 6px;
  }

  /* Mobile RTL Support for Error and Success Messages */
  [dir="rtl"] #otpErrorMessage,
  [dir="rtl"] #otpSuccessMessage {
    text-align: right;
    direction: rtl;
  }

  [dir="ltr"] #otpErrorMessage,
  [dir="ltr"] #otpSuccessMessage {
    text-align: left;
    direction: ltr;
  }
}

/* OTP Contact Info and Edit Button Styles */
.otp-contact-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.otp-contact-value {
  font-weight: 600;
  font-size: 1.15em;
  color: #232946;
  letter-spacing: 0.5px;
}
.otp-edit-contact-btn {
  margin-left: 14px;
  padding: 6px 18px;
  font-size: 1em;
  border-radius: 20px;
  border: none;
  background: #e4e5e7;
  color: #232946;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.otp-edit-contact-btn:hover {
  background: #d1d2d6;
}

/* Security Features Section */
.otp-modal-security {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.otp-modal-security-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
}

.otp-modal-security-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.otp-modal-security-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.otp-modal-security-icon {
  font-size: 1.5rem;
  width: 20px;
  text-align: center;
}

.otp-modal-security-text {
  font-size: 1.2em;
  color: #bfc8e6;
  line-height: 1.4;
}

/* RTL Support for new elements */

[dir="rtl"] .otp-modal-security-text {
  text-align: right;
}

[dir="rtl"] .otp-modal-security-items {
  direction: rtl;
}

[dir="rtl"] .otp-modal-security-icon {
  margin-left: 0;
  margin-right: 10px;
}

/* RTL Support for Error and Success Messages */
[dir="rtl"] #otpErrorMessage,
[dir="rtl"] #otpSuccessMessage {
  text-align: right;
  direction: rtl;
}

[dir="ltr"] #otpErrorMessage,
[dir="ltr"] #otpSuccessMessage {
  text-align: left;
  direction: ltr;
}
