/* Add custom CSS styles below */ 
/* =================================
   الزر داخل مربع خيارات المنتج
================================= */

salla-product-options.s-product-options-wrapper {
  overflow: visible !important;
}

.thobe-size-button-area {
  width: 100%;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #eeeeee;
}

.thobe-open-size-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: #bd8547;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.thobe-open-size-guide:hover {
  background: #a9713a;
}

.thobe-open-size-guide:active {
  transform: scale(0.98);
}

/* =================================
   خلفية الـ Popup
================================= */

.thobe-size-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  direction: rtl;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.thobe-size-guide-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.thobe-popup-open {
  overflow: hidden !important;
}

/* =================================
   صندوق الـ Popup
================================= */

.thobe-size-guide-modal {
  position: relative;
  width: min(1000px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: #163858;
  color: #ffffff;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s ease;
}

.thobe-size-guide-overlay.is-open
.thobe-size-guide-modal {
  transform: translateY(0) scale(1);
}

.thobe-size-guide-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
}

/* =================================
   تقسيم محتوى النافذة
================================= */

.thobe-size-guide-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  min-height: 570px;
}

/* الجزء الخاص بإدخال المقاسات */

.thobe-size-guide-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 55px 45px;
  text-align: center;
}

.thobe-form-heading {
  margin: 0 0 25px;
  color: #ffffff;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.45;
}

.thobe-measurement-field {
  margin-bottom: 30px;
}

.thobe-measurement-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 44px;
  margin-bottom: 14px;
  padding: 9px 22px;
  border-radius: 25px;
  background: #bd8547;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
}

/* Slider */

.thobe-size-range {
  width: 100%;
  height: 6px;
  margin: 0;
  border-radius: 10px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(
      to left,
      #bd8547 0%,
      #bd8547 var(--range-value, 50%),
      #f4f4f4 var(--range-value, 50%),
      #f4f4f4 100%
    );
  cursor: pointer;
}

.thobe-size-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #bd8547;
  cursor: pointer;
}

.thobe-size-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #bd8547;
  cursor: pointer;
}

.thobe-calculate-size {
  align-self: center;
  min-width: 160px;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 0;
  background: #bd8547;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.thobe-size-result {
  display: none;
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  font-size: 17px;
}

.thobe-size-result.is-visible {
  display: block;
}

.thobe-size-result strong {
  display: inline-block;
  margin-right: 5px;
  color: #dfaa6b;
  font-size: 27px;
}

/* =================================
   جزء كيفية القياس
================================= */

.thobe-measurement-guide {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 570px;
  padding: 25px 30px 20px;
  overflow: hidden;
  background: #163858;
}

.thobe-guide-header {
  position: relative;
  z-index: 2;
  text-align: center;
}

.thobe-guide-header h2 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: clamp(31px, 4vw, 47px);
  font-weight: 800;
}

.thobe-guide-header p {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
}

.thobe-guide-image-container {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  margin-top: 12px;
}

.thobe-guide-image {
  display: block;
  width: 100%;
  height: 430px;
  object-fit: contain;
}

/* =================================
   الجوال
================================= */

@media (max-width: 767px) {
  .thobe-size-guide-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .thobe-size-guide-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }

  .thobe-size-guide-layout {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .thobe-measurement-guide {
    order: 1;
    min-height: 330px;
    padding: 30px 20px 10px;
  }

  .thobe-size-guide-form {
    order: 2;
    padding: 32px 22px 40px;
  }

  .thobe-guide-image-container {
    min-height: 230px;
  }

  .thobe-guide-image {
    height: 250px;
  }

  .thobe-guide-header h2 {
    font-size: 30px;
  }

  .thobe-form-heading {
    font-size: 31px;
    line-height: 1.4;
  }

  .thobe-size-guide-close {
    position: fixed;
    top: 12px;
    left: 12px;
  }
}