body {
  font-family: 'Tajawal', sans-serif;
  background-color: #f7db90;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  min-height: 90vh;
  align-items: center;
}

.container {
  background-image: url('images/bg.jpg'); /* حط رابط الصورة هنا */
  background-size: cover;        /* تغطي كامل العنصر */
  background-position: center;   /* توسيط الصورة */
  background-repeat: no-repeat;  /* منع التكرار */

  padding: 25px 35px;
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0, 40, 85, 0.1);
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.logo-container img {
  max-width: 260px;
  margin-bottom: -20px;
  display: inline-block;
}

h1 {
  font-size: large;
  margin-bottom: 18px;
  color: #f7db90;
  font-weight: 700;
}

h2 {
  font-size: xx-large;
  margin-bottom: 18px;
  color: #fff;
  font-weight: 700;
}

input[type="text"] {
  font-family: 'Tajawal', sans-serif;
  width: 100%;
  padding: 12px 15px;
  font-size: 14px;
  margin: 12px 0;
  border-radius: 12px;
  border: 1.8px solid #f7db90;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

button {
  font-family: 'Tajawal', sans-serif;
  background-color: #f7db90;
  border: none;
  color: #073227;
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 12px;
  cursor: pointer;
  margin: 12px 6px;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #fff;
}

.size-options {
  align-items: flex-start; /* 👈 يمنع التمدد */
  border-radius: 12px;
  border: 1.8px solid #f7db90;
  padding: 15px 0;
  margin: 18px 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 12px;
  border: 1.8px solid #f7db90;
  padding: 15px 0;
  margin: 18px 0;
  -webkit-overflow-scrolling: touch;
  gap: 20px;
  justify-items: center;
}

.size-options::before,
.size-options::after {
  content: "";
  flex: 0 0 50%;
}

.size-options label {
  font-weight: 600;
  cursor: pointer;
  color: #f7db90;
  min-width: 70%;
  max-width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  scroll-snap-align: center;
  cursor: pointer;
  color: #f7db90;
}

.size-options::-webkit-scrollbar {
  display: none;
}

.thumbnail {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.size-options label:hover .thumbnail {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.step {
  display: none;
}

.step.active {
  display: block;
}

.error-message {
  color: #cac640;
  font-size: 13px;
  margin-bottom: 5px;
}

#card canvas {
  max-width: 100%;
  border-radius: 12px;
  margin: 20px 0;
  padding: 1px 1px;
  border: 1.8px solid #f7db90;
}

#card button {
  min-width: 120px;
}

/* Media Query لشاشات الجوال */
@media (max-width: 600px) {

  .container {
    padding: 20px;
    border-radius: 12px;
  }

  /* الكاروسل */
  .size-options {
    display: flex;
    overflow-x: auto;

    width: 100%;
    height: auto; /* 👈 مهم */
    
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  /* كل عنصر */
  .size-options label {
    min-width: 100%;
    height: auto; /* 👈 مهم */

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* 👈 يخليه في النص */

    scroll-snap-align: center;
  }

  /* الصورة */
  .thumbnail {
    width: 80%;
    max-width: 260px;
    height: auto;
  }

  /* 🔥 أهم سطر يحل الفراغ */
  .size-options label img {
    object-fit: contain;
  }

  /* إخفاء السكرول */
  .size-options::-webkit-scrollbar {
    display: none;
  }

}

.crop-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  margin: auto;
  overflow: hidden;
}

#cropCanvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
}

.crop-frame {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid #f7db90;
  border-radius: 20px;
  pointer-events: none;
}

#photo {
  display: none !important;
}

.custom-upload-btn {
  font-family: 'Tajawal', sans-serif;
  background-color: #f7db90;
  color: #073227;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  margin: 12px 0;
  display: none;
  text-align: center;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 15px;
}

.nav-btn {
  background-color: #f7db90;
  color: #073227;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}

.nav-btn:hover {
  background-color: #fff;
}