:root {
  --bg-page: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --whatsapp: #10b981;
  --whatsapp-hover: #059669;
  --accent-red: #ef4444;
  --border-light: #e2e8f0;
  --border-focus: #0f172a;
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.07), 0 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-page);
  background-image: 
    radial-gradient(at 0% 0%, rgba(241, 245, 249, 0.8) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(226, 232, 240, 0.5) 0px, transparent 50%);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
}

.container {
  width: 100%;
  max-width: 680px;
  background: var(--card-bg);
  padding: 44px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
}

/* Accent top border glow */
.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0f172a 0%, #3b82f6 50%, #10b981 100%);
}

/* 1. العنوان الرئيسي */
.main-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.main-title span.price-highlight {
  color: #059669;
  background: #ecfdf5;
  padding: 2px 14px;
  border-radius: 12px;
  border: 1px solid #a7f3d0;
  display: inline-block;
}

/* 2. شارة الكمية المتبقية */
.stock-badge {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 9999px;
  width: fit-content;
  margin: 0 auto 30px auto;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.08);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: #e11d48;
  border-radius: 50%;
  position: relative;
}

.pulse-indicator::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: #f43f5e;
  opacity: 0.6;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* 3. شبكة صور التيشيرتات */
.images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 35px;
}

.image-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f8fafc;
  border: 1.5px solid var(--border-light);
  aspect-ratio: 1 / 1.08;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-card:hover {
  transform: translateY(-4px);
  border-color: #94a3b8;
  box-shadow: var(--shadow-hover);
}

.image-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.image-card:hover img {
  transform: scale(1.04);
}

.color-label {
  position: absolute;
  bottom: 10px;
  right: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

.dot-white { background: #ffffff; }
.dot-black { background: #000000; }
.dot-red { background: #ef4444; }
.dot-beige { background: #d4c3b3; }

/* 4. فورم الطلب */
.order-form {
  border-top: 1px solid var(--border-light);
  padding-top: 30px;
}

.form-header {
  text-align: center;
  margin-bottom: 24px;
}

.form-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 4px;
}

.form-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 7px;
}

.input-wrapper {
  position: relative;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.98rem;
  color: var(--text-main);
  background-color: #f8fafc;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
}

/* أزرار الإرسال والواتساب */
.btn-submit {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
}

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

/* 5. زرار واتساب */
.btn-whatsapp {
  width: 100%;
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
  background: #1eb956;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
}

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

.success-message {
  margin-top: 18px;
  padding: 14px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  text-align: center;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.98rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 540px) {
  body {
    padding: 20px 12px;
  }

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

  .main-title {
    font-size: 1.95rem;
  }

  .images-grid {
    gap: 12px;
    margin-bottom: 25px;
  }

  .stock-badge {
    font-size: 0.88rem;
    padding: 6px 14px;
  }
}
