@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700&display=swap');

:root {
  --background: #FFF9F5;
  --section-header: #F7DDD9;
  --primary: #E8A5A0;
  --primary-dark: #D4908A;
  --accent: #8B4B6B;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --white: #FFFFFF;
  --card-bg: #FFFFFF;
  --divider: #EEEEEE;
  --success: #4CAF50;
  --error: #E53935;
  --whatsapp: #25D366;
  --ai-assistant: #9C27B0;
  --ai-light: #F3E5F5;
  --user-message: #E3F2FD;
  --ai-message: #FCE4EC;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  background: var(--background);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.header {
  background: var(--background);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--divider);
}

.header-title {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 2px;
}

.header-icons {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: var(--section-header);
}

.cart-badge,
.notification-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-badge {
  background: #E53935;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.notification-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.notification-item.unread {
  background: linear-gradient(to right, #FFF5F5, white);
  border-right: 4px solid var(--primary);
}

.notification-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon.order {
  background: linear-gradient(135deg, #E8A5A0, #D4908A);
  color: white;
}

.notification-icon.shipped {
  background: linear-gradient(135deg, #4CAF50, #388E3C);
  color: white;
}

.notification-icon.delivered {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
}

.notification-icon.cancelled {
  background: linear-gradient(135deg, #F44336, #D32F2F);
  color: white;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.notification-time {
  font-size: 11px;
  color: var(--text-light);
}

.notifications-empty {
  text-align: center;
  padding: 60px 20px;
}

.notifications-empty svg {
  color: var(--text-light);
  margin-bottom: 16px;
}

.notifications-empty h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.notifications-empty p {
  font-size: 14px;
  color: var(--text-light);
}

.banner-slider {
  padding: 16px;
}

.banner-slide {
  background: var(--section-header);
  border-radius: 16px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-content {
  position: absolute;
  text-align: center;
  padding: 16px;
}

.banner-title {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 3px;
}

.banner-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.section-header {
  background: var(--section-header);
  margin: 8px 16px;
  padding: 16px 24px;
  border-radius: 16px;
  text-align: center;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.categories-scroll {
  display: flex;
  overflow-x: auto;
  padding: 16px;
  gap: 16px;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.category-card:hover {
  transform: translateY(-4px);
}

.category-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-name {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.products-scroll {
  display: flex;
  overflow-x: auto;
  padding: 16px;
  gap: 16px;
  scrollbar-width: none;
}

.products-scroll::-webkit-scrollbar {
  display: none;
}

.product-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.product-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--divider);
}

.product-info {
  padding: 12px;
}

.product-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.current-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.old-price {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: line-through;
}

.currency {
  font-size: 11px;
  color: var(--text-light);
}

.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--error);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wishlist-btn.active svg {
  fill: var(--error);
  stroke: var(--error);
}

.brands-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}

.brand-card {
  background: var(--card-bg);
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.2s;
}

.brand-card:hover {
  transform: scale(1.05);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item span {
  font-size: 11px;
}

.floating-buttons {
  position: fixed;
  bottom: 80px;
  left: calc(50% - 200px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 90;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.fab:hover {
  transform: scale(1.1);
}

.fab-ai {
  background: var(--ai-assistant);
  color: white;
}

.fab-whatsapp {
  background: var(--whatsapp);
  color: white;
}

.content-padding {
  padding-bottom: 80px;
}

.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

.back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.product-detail-image {
  width: 100%;
  height: 350px;
  object-fit: contain;
  background: var(--card-bg);
}

.product-detail-info {
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  margin-top: -24px;
  position: relative;
  padding: 24px;
}

.product-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.product-detail-title {
  font-size: 20px;
  font-weight: 600;
  flex: 1;
}

.product-detail-price {
  text-align: left;
}

.product-detail-price .current-price {
  font-size: 20px;
}

.product-section {
  margin-top: 24px;
}

.product-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-section p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  background: var(--section-header);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
}

.tag.concern {
  background: var(--ai-light);
}

.add-to-cart-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  padding: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  z-index: 100;
}

.add-to-cart-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Cairo', sans-serif;
  transition: background 0.2s;
}

.add-to-cart-btn:hover {
  background: var(--primary-dark);
}

.add-to-cart-btn.in-cart {
  background: var(--success);
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
  text-align: center;
}

.cart-empty svg {
  width: 80px;
  height: 80px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.cart-empty h2 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.cart-empty p {
  color: var(--text-light);
  margin-bottom: 24px;
}

.cart-item {
  display: flex;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  margin: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  gap: 12px;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--primary);
  font-weight: 700;
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.quantity-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--primary);
}

.quantity-btn.delete {
  color: var(--error);
}

.quantity-value {
  font-weight: 600;
}

.cart-summary {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  padding: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.checkout-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

.checkout-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Checkout Page */
.checkout-page-content {
  padding: 16px;
  padding-bottom: 180px;
}

.checkout-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.checkout-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-section-title svg {
  color: var(--primary);
}

.checkout-form-group {
  margin-bottom: 16px;
}

.checkout-form-group:last-child {
  margin-bottom: 0;
}

.checkout-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.checkout-form-group input,
.checkout-form-group select,
.checkout-form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Cairo', sans-serif;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
}

.checkout-form-group input:focus,
.checkout-form-group select:focus,
.checkout-form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.checkout-form-group input::placeholder,
.checkout-form-group textarea::placeholder {
  color: #999;
}

.checkout-order-summary {
  background: var(--section-header);
  border-radius: 12px;
  padding: 16px;
}

.checkout-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.checkout-order-item:last-child {
  border-bottom: none;
}

.checkout-order-item-name {
  font-size: 14px;
  color: var(--text-primary);
}

.checkout-order-item-qty {
  font-size: 12px;
  color: var(--text-secondary);
}

.checkout-order-item-price {
  font-weight: 600;
  color: var(--text-primary);
}

.checkout-totals {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.checkout-total-row.grand-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--primary);
}

.checkout-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  padding: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
}

.ai-disclaimer {
  background: var(--ai-light);
  margin: 8px 16px;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--ai-assistant);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.ai-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 32px;
}

.ai-empty-icon {
  width: 80px;
  height: 80px;
  background: var(--ai-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.ai-empty-state h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.ai-empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.ai-example {
  font-style: italic;
  color: var(--ai-assistant);
  font-size: 13px;
}

.message-bubble {
  max-width: 85%;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.message-bubble.user {
  background: var(--user-message);
  margin-left: auto;
  border-bottom-left: 0;
}

.message-bubble.ai {
  background: var(--ai-message);
  border-bottom-right: 0;
}

.ai-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ai-assistant);
  margin-bottom: 8px;
}

.recommendation-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  gap: 12px;
}

.recommendation-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.recommendation-info {
  flex: 1;
}

.recommendation-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.recommendation-brand {
  font-size: 11px;
  color: var(--text-light);
}

.recommendation-reason {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.view-product-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  white-space: nowrap;
}

.ai-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--ai-message);
  border-radius: 16px;
  max-width: 150px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--ai-assistant);
  border-radius: 50%;
  animation: typing 1s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.quick-chips {
  display: flex;
  overflow-x: auto;
  padding: 8px 16px;
  gap: 8px;
  scrollbar-width: none;
}

.quick-chips::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex-shrink: 0;
  background: var(--section-header);
  border: none;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: background 0.2s;
}

.quick-chip:hover {
  background: var(--primary);
  color: white;
}

.ai-input-area {
  padding: 16px;
  background: var(--card-bg);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  display: flex;
  gap: 12px;
}

.ai-input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: var(--background);
  border-radius: 24px;
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}

.ai-send-btn {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: transform 0.2s;
}

.ai-send-btn:hover {
  transform: scale(1.1);
}

.ai-send-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
}

.products-grid .product-card {
  width: 100%;
}

.search-header {
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--divider);
  border-radius: 24px;
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}

.search-suggestions {
  padding: 16px;
}

.search-suggestions h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-chip {
  background: var(--section-header);
  border: none;
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  display: flex;
  gap: 12px;
  align-items: center;
}

.toast-action {
  background: none;
  border: none;
  color: white;
  text-decoration: underline;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 320px;
  text-align: center;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.modal h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.modal-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}
