/* ========== عام ========== */
* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  direction: rtl;
  background: #faf6ee;
  color: #333;
  max-width: 450px;
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

h2, h3 {
  color: #5d4a1f;
  margin-bottom: 15px;
}

/* ========== الحاوي ========== */
.container {
  background: #fff3d6;
  padding: 25px 20px 30px;
  text-align: center;
  position: relative;
}

/* ========== Header ========== */
header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 15px;
  background: linear-gradient(135deg, #f0d9b5, #fff3d6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  animation: fadeDown 0.5s ease;
  position: relative;
}

header img.logo {
  width: 180px;
  height: auto;
}

/* ========== المدخلات والأزرار ========== */
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  margin: 8px 0;
  border-radius: 10px;
  border: 1px solid #e0d4b0;
  background: #fff;
  font-size: 15px;
  transition: all 0.2s;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #c7a86b;
  box-shadow: 0 0 0 3px rgba(199,168,107,0.2);
}

button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #c7a86b, #b89255);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.25s;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(199,168,107,0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(199,168,107,0.4);
}

p a {
  color: #8b6f3a;
  text-decoration: none;
  font-weight: 600;
}

p a:hover {
  text-decoration: underline;
}

/* ========== الفوتر ========== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 25px 20px;
  font-family: 'Amiri', 'Segoe UI', serif;
  flex-wrap: wrap;
  gap: 15px;
  border-top: 1px solid rgba(199,168,107,0.2);
  background: linear-gradient(135deg, #fff3d6, #f0d9b5);
}

.footer-left h3 {
  margin: 0;
  font-size: 20px;
  color: #5d4a1f;
}

.footer-left p {
  margin: 5px 0 0;
  color: #7a6339;
}

.footer-right {
  display: flex;
  gap: 10px;
}

.icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 16px;
  color: #000;
  background: #f2f2f2;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.tiktok { background: #ffe6f0; }
.snapchat { background: #fff9c4; }
.x { background: #e0e0e0; }

/* ========== أيقونة السلة + العداد ========== */
.cart-icon {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: inherit;
  font-size: 22px;
  padding: 8px;
}

.cart-count {
  position: absolute;
  top: -2px;
  left: -2px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  min-width: 20px;
  text-align: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(231,76,60,0.4);
}

/* ========== صفحة السلة (بطاقات) ========== */
.cart-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  margin: 12px 0;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  text-align: right;
  animation: fadeUp 0.4s ease;
}

.cart-item span:first-child {
  font-weight: bold;
  color: #5d4a1f;
  font-size: 15px;
}

.cart-item > span:not(:first-child) {
  color: #7a6339;
  font-size: 13px;
}

.cart-item button:last-child {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  width: auto;
  font-size: 13px;
  margin-top: 5px;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(231,76,60,0.3);
}

.cart-item button:last-child:hover {
  box-shadow: 0 5px 12px rgba(231,76,60,0.4);
}

/* أزرار + و − */
.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff9e6;
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}

.qty-controls button {
  width: 32px;
  height: 32px;
  border: none;
  background: #c7a86b;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  padding: 0;
  margin: 0;
  line-height: 1;
  box-shadow: none;
}

.qty-controls button:hover {
  background: #b89255;
  transform: none;
  box-shadow: 0 2px 6px rgba(199,168,107,0.4);
}

.qty-controls span {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
  color: #5d4a1f;
}

/* ========== بطاقة الحساب ========== */
.profile-card {
  background: #fff;
  border-radius: 14px;
  padding: 25px;
  margin: 20px 0;
  box-shadow: 0 3px 15px rgba(0,0,0,0.06);
  text-align: right;
  animation: fadeUp 0.5s ease;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f0e4c0;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row i {
  color: #c7a86b;
  width: 24px;
  font-size: 18px;
}

.profile-row .label {
  font-weight: bold;
  min-width: 110px;
  color: #5d4a1f;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #c7a86b, #b89255);
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
  box-shadow: 0 2px 8px rgba(199,168,107,0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(199,168,107,0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 2px 8px rgba(231,76,60,0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 16px rgba(231,76,60,0.4);
}

/* ========== صف الإدخال (payment) ========== */
.row {
  display: flex;
  gap: 10px;
}

.row input {
  width: 100%;
}

/* ========== رسائل عامة ========== */
.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 16px;
}

/* ========== رسائل التنبيه (Alerts) ========== */
.alert {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  animation: fadeUp 0.4s ease;
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
  font-family: inherit;
  line-height: 1.6;
}

.alert i {
  font-size: 20px;
  flex-shrink: 0;
}

.alert span {
  flex: 1;
}

/* رسالة خطأ */
.alert-error {
  background: linear-gradient(135deg, #fff0f0 0%, #ffe0e0 100%);
  color: #a83232;
  border-right: 4px solid #e74c3c;
}

.alert-error i {
  color: #e74c3c;
}

/* رسالة نجاح */
.alert-success {
  background: linear-gradient(135deg, #f0fff4 0%, #d4efdf 100%);
  color: #1d7a42;
  border-right: 4px solid #27ae60;
}

.alert-success i {
  color: #27ae60;
}

/* رسالة تنبيه (بالثيم الذهبي) */
.alert-warning {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3d6 100%);
  color: #5d4a1f;
  border-right: 4px solid #c7a86b;
}

.alert-warning i {
  color: #c7a86b;
}

/* رسالة معلوماتية */
.alert-info {
  background: linear-gradient(135deg, #e8f4fd 0%, #d4e9f7 100%);
  color: #1a5490;
  border-right: 4px solid #3498db;
}

.alert-info i {
  color: #3498db;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  body {
    max-width: 100%;
    box-shadow: none;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }
}

/* ========== أنيميشن ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}