/* 1. استدعاء خط Tajawal و Cairo مباشرة من Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

:root {
  --font-main: 'Tajawal', 'Cairo', sans-serif;
  --primary: #C05277;
  --primary-hover: #A84265;
  --accent: #E3749B;
  --bg-main: #FAF5F1;
  --dark: #2B2426;
  --card-bg: #FFFFFF;
  --soft-bg: #FDEEF2;
  --border-color: #F3E2E6;
  --text-primary: #2D2327;
  --text-secondary: #7A6B70;
  
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 30px rgba(192, 82, 119, 0.06);
  --shadow-hover: 0 15px 35px rgba(192, 82, 119, 0.12);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, body, input, button, select, textarea {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main) !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* يترك مسافة تلقائية قبل أي سكشن عند التمرير إليه */
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(250, 245, 241, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 15px 0;
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 25px;
  list-style: none;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary-hover);
}

.btn-primary {
  background: var(--primary);
  color: #FFF !important;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(192, 82, 119, 0.25);
  display: inline-block;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  padding: 60px 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-content {
  flex: 1;
  width: 50%;
}

.hero-visual {
  flex: 1;
  width: 50%;
  position: relative;
}

.tag-badge {
  display: inline-block;
  background-color: var(--soft-bg);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.hero-headline {
  font-size: 42px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-subheadline {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.hero-image, .hero-visual img {
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  object-fit: cover;
  display: block;
}

.floating-tag {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: var(--primary);
  color: #FFF;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-hover);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Urgency Bar */
.urgency-bar {
  background: var(--primary);
  color: #FFF;
  padding: 18px 0;
  text-align: center;
  border-radius: var(--radius-md);
  margin: 40px 0;
}

.timer-box {
  display: inline-flex;
  gap: 10px;
  margin-right: 15px;
  font-weight: 700;
  font-size: 18px;
  color: #FFF;
  background: rgba(0,0,0,0.15);
  padding: 4px 12px;
  border-radius: 6px;
}

/* Products Grid */
.products-section {
  padding: 60px 0;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  margin-top: 10px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 15px;
  text-align: center;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card:hover, 
.product-card.selected {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.product-img-wrap {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--soft-bg);
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

.product-card h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 8px 0;
  color: var(--text-primary);
}

.price-wrap {
  margin: 8px 0 12px;
}

.current-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.old-price {
  text-decoration: line-through;
  color: var(--text-secondary);
  font-size: 13px;
  margin-right: 6px;
}

/* Card Controls & Multi-Select Logic */
.card-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.btn-select-toggle {
  width: 100%;
  padding: 10px;
  background: var(--bg-main);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.checkbox-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-secondary);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: var(--transition);
}

.product-card.selected {
  border-color: var(--primary);
  background: #FFF9FA;
}

.product-card.selected .btn-select-toggle {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

.product-card.selected .checkbox-icon {
  border-color: #FFF;
  background: #FFF;
}

.product-card.selected .checkbox-icon::after {
  content: '✓';
  position: absolute;
  top: -3px;
  left: 2px;
  color: var(--primary);
  font-size: 13px;
  font-weight: bold;
}

/* Quantity Control Buttons (+ / -) */
.quantity-control {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: row-reverse; /* تعديل اتجاه العناصر: (+) يمين و (-) شمال */
  gap: 12px;
  background: #FFF;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.product-card.selected .quantity-control {
  display: flex;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: #FFF;
  color: var(--primary);
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover {
  background: var(--primary);
  color: #FFF;
}

.qty-val {
  font-weight: 800;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
  color: var(--dark);
}

/* Featured Section */
.featured-section {
  background: var(--card-bg);
  padding: 50px 30px;
  border-radius: var(--radius-lg);
  margin: 60px auto;
  border: 1px solid var(--border-color);
  width: 100%;
}

.featured-grid {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
}

.featured-content, 
.featured-visual {
  flex: 1;
  width: 50%;
}

.featured-visual img {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: block;
}

.ingredients-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
  margin-top: 20px;
}

.ingredients-list li {
  background: var(--bg-main);
  padding: 10px 15px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* Trust Badges Bar */
/* Trust Badges Bar - سكشن مميزاتنا (معدل) */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 50px 0;
  background: var(--card-bg);
  padding: 35px 25px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.trust-item {
  text-align: center;
  padding: 15px 10px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  background: var(--bg-main);
  border: 1px solid transparent;
}

.trust-item:hover {
  background: var(--soft-bg);
  border-color: var(--border-color);
  transform: translateY(-4px);
}

.trust-item h4 {
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.trust-item p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

/* التجاوب مع شاشات الموبايل والتابلت */
@media (max-width: 768px) {
  .trust-bar {
    grid-template-columns: 1fr; /* عرض المميزات تحت بعضها في الموبايل */
    gap: 15px;
    padding: 20px 15px;
  }
}

/* Order Form Section */
.checkout-section {
  background: var(--dark);
  color: #FFF;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-hover);
  margin-bottom: 60px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.checkout-title {
  color: #FFFFFF !important;
  margin-bottom: 15px;
}

/* Cart Items List in Checkout */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  margin: 20px 0;
  padding-left: 5px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-item-info img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 700;
}

.cart-item-price {
  font-size: 13px;
  color: var(--accent);
}

.empty-cart-msg {
  color: #BBB;
  font-size: 14px;
  text-align: center;
  padding: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.urgency-timer-mini {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: #EAE3E5;
}

.form-control {
  width: 100%;
  padding: 14px;
  border: 1px solid #4A4044;
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  background: #383033;
  color: #FFF;
}

.form-control:focus {
  border-color: var(--primary);
  background: #43393D;
}

.price-summary {
  background: #383033;
  padding: 20px;
  border-radius: var(--radius-md);
  margin: 25px 0;
  color: #FFF;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #4A4044;
}

.summary-row.total {
  border-bottom: none;
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
}

.btn-submit {
  width: 100%;
  padding: 18px;
  font-size: 20px;
}

@media (max-width: 768px) {
  .checkout-grid, 
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background: var(--dark);
  color: #FFF;
  padding: 40px 0;
  text-align: center;
}

.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
}

.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFF;
  padding: 12px 20px;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
  z-index: 999;
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero, .featured-grid, .trust-bar { flex-direction: column; text-align: center; }
  .hero-content, .hero-visual, .featured-visual, .featured-content { width: 100%; }
  .ingredients-list { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .mobile-cta { display: block; }
  .hero-headline { font-size: 30px; }
}

.thank-you-wrapper {
  height: calc(100vh - 75px - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.thank-you-card {
  background: #FFF;
  max-width: 550px;
  width: 100%;
  margin: 0 auto;
  padding: 35px 25px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

body:has(.thank-you-wrapper) .footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 99;
}
.cart-error-alert {
    background-color: rgba(220, 53, 69, 0.15);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-top: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}