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

:root {
  --bg-color: #0b0f19;
  --bg-card: rgba(22, 30, 49, 0.75);
  --bg-card-hover: rgba(30, 41, 67, 0.85);
  --accent-gold: #fbbf24;
  --accent-gold-hover: #f59e0b;
  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(251, 191, 36, 0.3);
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(251, 191, 36, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  padding-bottom: 120px;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(251, 191, 36, 0.08) 0%, transparent 40%);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Header Section --- */
header {
  padding: 30px 0 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 35px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.brand-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.store-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

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

/* --- Products Grid --- */
.products-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.products-section-head h2 {
  font-size: 1.6rem;
  font-weight: 700;
  position: relative;
}

.products-section-head h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent-gold);
  border-radius: 2px;
  margin-top: 6px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

/* --- Product Card --- */
.product-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  background: var(--bg-card-hover);
}

.product-img-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img {
  transform: scale(1.06);
}

.product-details {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.product-description {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.product-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.product-price span {
  font-size: 0.85rem;
  font-weight: 400;
  margin-right: 4px;
}

/* Quantity Control */
.quantity-control {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 4px;
  gap: 6px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.qty-btn:hover {
  background: var(--accent-gold);
  color: #000;
}

.qty-count {
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* --- Floating Checkout Bar --- */
.floating-checkout-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 800px;
  background: rgba(16, 23, 38, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight);
  border-radius: 24px;
  padding: 16px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  transition: all 0.3s ease;
}

.cart-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cart-icon-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  background: rgba(251, 191, 36, 0.12);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 1.4rem;
}

.cart-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--accent-emerald);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-color);
}

.cart-total-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cart-total-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-whatsapp:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.45);
}

/* Loading & Empty States */
.state-box {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(251, 191, 36, 0.2);
  border-top: 4px solid var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .floating-checkout-bar {
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
    bottom: 12px;
  }
  .cart-info {
    width: 100%;
    justify-content: space-between;
  }
  .btn-whatsapp {
    width: 100%;
    justify-content: center;
  }
  .store-title {
    font-size: 1.9rem;
  }
}
