/* =====================================================
   Digital Store - Main Stylesheet
   RTL Arabic Design for Egyptian Market
   ===================================================== */

@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap");

:root {
  --store-primary: #6c63ff;
  --store-primary-light: #8b83ff;
  --store-primary-dark: #5046e4;
  --store-secondary: #ff6b6b;
  --store-accent: #4ecdc4;
  --store-success: #10b981;
  --store-warning: #f59e0b;
  --store-danger: #ef4444;
  --store-bg: #f8fafc;
  --store-card-bg: #ffffff;
  --store-text: #1e293b;
  --store-text-muted: #64748b;
  --store-border: #e2e8f0;
  --store-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --store-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --store-radius: 16px;
  --store-radius-sm: 10px;
  --store-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Tajawal", sans-serif;
  background: var(--store-bg);
  color: var(--store-text);
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden; /* لمنع ظهور المساحات البيضاء على الجوانب في الموبايل */
}

html {
    overflow-x: hidden;
}

/* =====================================================
   STORE HEADER
   ===================================================== */

.store-header {
  background: linear-gradient(
    135deg,
    var(--store-primary) 0%,
    var(--store-primary-dark) 100%
  );
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(108, 99, 255, 0.3);
}

.store-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.store-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  flex-shrink: 0;
}

.store-logo-icon {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  backdrop-filter: blur(5px);
}

.store-logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.store-logo-subtitle {
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 400;
}

.store-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.store-search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--store-transition);
  backdrop-filter: blur(5px);
}

.store-search input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.store-search input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
}

.store-search .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.store-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.store-cart-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--store-transition);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-cart-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--store-secondary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--store-primary);
  animation: badgePop 0.3s ease;
}

.cart-badge:empty,
.cart-badge[data-count="0"] {
  display: none;
}

@keyframes badgePop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.store-admin-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: var(--store-transition);
}

.store-admin-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* =====================================================
   CATEGORY FILTER BAR
   ===================================================== */

.category-bar {
  background: var(--store-card-bg);
  border-bottom: 1px solid var(--store-border);
  padding: 0.75rem 0;
  position: sticky;
  top: 69px;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-bar-inner::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  border: 2px solid var(--store-border);
  background: var(--store-card-bg);
  color: var(--store-text-muted);
  font-family: "Tajawal", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--store-transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.category-pill:hover {
  border-color: var(--store-primary);
  color: var(--store-primary);
  transform: translateY(-2px);
}

.category-pill.active {
  background: var(--store-primary);
  color: white;
  border-color: var(--store-primary);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.category-pill i {
  font-size: 0.8rem;
}

/* =====================================================
   HERO SECTION
   ===================================================== */

.store-hero {
  background: linear-gradient(
    135deg,
    var(--store-primary) 0%,
    #4338ca 50%,
    var(--store-primary-dark) 100%
  );
  color: white;
  padding: 3rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.store-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -25%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.store-hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(78, 205, 196, 0.15) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.store-hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.store-hero h1 {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.store-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.store-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  backdrop-filter: blur(5px);
}

/* =====================================================
   PRODUCTS GRID
   ===================================================== */

.products-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.products-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.products-section-title i {
  color: var(--store-primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--store-card-bg);
  border-radius: var(--store-radius);
  overflow: hidden;
  box-shadow: var(--store-shadow);
  transition: var(--store-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--store-shadow-hover);
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: #f1f5f9;
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image-wrapper img {
  transform: scale(1.08);
}

.product-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 3rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.product-badges {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 2;
}

.badge-discount {
  background: var(--store-secondary);
  color: white;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

.badge-unavailable {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-info {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category-tag {
  font-size: 0.7rem;
  color: var(--store-primary);
  background: rgba(108, 99, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  width: fit-content;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--store-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.product-description {
  font-size: 0.8rem;
  color: var(--store-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--store-border);
}

.product-price {
  display: flex;
  flex-direction: column;
}

.product-price .current-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--store-primary);
}

.product-price .original-price {
  font-size: 0.8rem;
  color: var(--store-text-muted);
  text-decoration: line-through;
}

.product-price .currency {
  font-size: 0.75rem;
  font-weight: 400;
  margin-right: 0.15rem;
}

.btn-add-cart {
  background: var(--store-primary);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--store-radius-sm);
  cursor: pointer;
  font-family: "Tajawal", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--store-transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-add-cart:hover {
  background: var(--store-primary-dark);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35);
}

.btn-add-cart:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-add-cart.added {
  background: var(--store-success);
}

/* =====================================================
   SLIDE-IN CART PANEL
   ===================================================== */

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--store-transition);
  backdrop-filter: blur(3px);
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--store-card-bg);
  z-index: 2001;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

.cart-panel.active {
  right: 0;
}

.cart-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--store-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-header h3 i {
  color: var(--store-primary);
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--store-text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--store-transition);
}

.cart-close:hover {
  background: #f1f5f9;
  color: var(--store-danger);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--store-text-muted);
}

.cart-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.cart-empty p {
  font-size: 0.95rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--store-border);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cart-item-image {
  width: 65px;
  height: 65px;
  border-radius: var(--store-radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-image .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 1.5rem;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--store-primary);
  font-weight: 700;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--store-border);
  background: var(--store-bg);
  color: var(--store-text);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--store-transition);
}

.qty-btn:hover {
  background: var(--store-primary);
  color: white;
  border-color: var(--store-primary);
}

.cart-item-qty {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--store-danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem;
  margin-right: auto;
  transition: var(--store-transition);
}

.cart-item-remove:hover {
  transform: scale(1.2);
}

.cart-footer {
  border-top: 2px solid var(--store-border);
  padding: 1.25rem 1.5rem;
  flex-shrink: 0;
  background: var(--store-bg);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-total-amount {
  color: var(--store-primary);
  font-size: 1.3rem;
}

.btn-checkout {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(
    135deg,
    var(--store-primary) 0%,
    var(--store-primary-dark) 100%
  );
  color: white;
  border: none;
  border-radius: var(--store-radius-sm);
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--store-transition);
  text-align: center;
  text-decoration: none;
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
  color: white;
}

.btn-checkout:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-clear-cart {
  display: block;
  width: 100%;
  padding: 0.6rem;
  background: transparent;
  color: var(--store-danger);
  border: 1px solid var(--store-danger);
  border-radius: var(--store-radius-sm);
  font-family: "Tajawal", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: var(--store-transition);
}

.btn-clear-cart:hover {
  background: var(--store-danger);
  color: white;
}

/* =====================================================
   CHECKOUT PAGE
   ===================================================== */

.checkout-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.checkout-card {
  background: var(--store-card-bg);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.checkout-card-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--store-primary) 0%,
    var(--store-primary-dark) 100%
  );
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.checkout-card-header i {
  font-size: 1.2rem;
}

.checkout-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.checkout-card-body {
  padding: 1.5rem;
}

.checkout-form-group {
  margin-bottom: 1.25rem;
}

.checkout-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--store-text);
}

.checkout-form-group label .required {
  color: var(--store-danger);
}

.checkout-form-group input,
.checkout-form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--store-border);
  border-radius: var(--store-radius-sm);
  font-family: "Tajawal", sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--store-transition);
}

.checkout-form-group input:focus,
.checkout-form-group textarea:focus {
  border-color: var(--store-primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.checkout-form-group .error-msg {
  color: var(--store-danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  display: none;
}

.checkout-form-group.has-error input {
  border-color: var(--store-danger);
}

.checkout-form-group.has-error .error-msg {
  display: block;
}

.checkout-form-group .phone-hint {
  font-size: 0.75rem;
  color: var(--store-text-muted);
  margin-top: 0.3rem;
}

.checkout-summary-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--store-border);
}

.checkout-summary-item:last-child {
  border-bottom: none;
}

.checkout-summary-item .item-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.checkout-summary-item .item-qty {
  color: var(--store-text-muted);
  font-size: 0.85rem;
}

.checkout-summary-item .item-price {
  font-weight: 700;
  color: var(--store-primary);
}

.checkout-totals {
  background: var(--store-bg);
  padding: 1rem 1.5rem;
  border-radius: var(--store-radius-sm);
  margin-top: 1rem;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.checkout-total-row.final {
  border-top: 2px solid var(--store-border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--store-primary);
}

.btn-place-order {
  display: block;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--store-success) 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: var(--store-radius-sm);
  font-family: "Tajawal", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--store-transition);
  margin-top: 1.5rem;
}

.btn-place-order:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-place-order:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* =====================================================
   ORDER SUCCESS PAGE
   ===================================================== */

.order-success {
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.order-success-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--store-success) 0%, #059669 100%);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  animation: successPop 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes successPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.order-success h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--store-success);
}

.order-success p {
  color: var(--store-text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.order-number-display {
  background: var(--store-bg);
  padding: 1rem 2rem;
  border-radius: var(--store-radius-sm);
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--store-primary);
  letter-spacing: 2px;
}

.btn-back-store {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--store-primary);
  color: white;
  border: none;
  border-radius: var(--store-radius-sm);
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--store-transition);
}

.btn-back-store:hover {
  background: var(--store-primary-dark);
  transform: translateY(-2px);
  color: white;
}

/* =====================================================
   STORE NEW FILTER BAR (Refactored)
   ===================================================== */

.store-filter-bar {
    background: var(--store-card-bg);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--store-border);
    position: sticky;
    top: 60px;
    z-index: 900;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.filter-flex-container {
    display: flex; 
    gap: 1rem; 
    align-items: center; 
    flex-wrap: wrap;
}

.search-wrapper {
    flex-grow: 1; 
    position: relative; 
    min-width: 250px;
}

.store-search-input-v2 {
    width: 100%; 
    padding: 0.75rem 3rem 0.75rem 1rem; 
    border-radius: 50px; 
    border: 1px solid var(--store-border); 
    background: var(--store-bg); 
    font-family: inherit;
    outline: none;
    transition: var(--store-transition);
}

.store-search-input-v2:focus {
    border-color: var(--store-primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.search-icon-v2 {
    position: absolute; 
    right: 1.25rem; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--store-text-muted);
}

.category-scroll-container {
    display: flex; 
    gap: 0.5rem; 
    overflow-x: auto; 
    padding-bottom: 8px; 
    -ms-overflow-style: -ms-autohiding-scrollbar; 
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch; /* تمرير سلس على هواتف آيفون */
    width: 100%;
    min-width: 0; /* ضروري لعمل overflow-x في flexbox */
}

.category-scroll-container::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    flex-shrink: 0; /* تمنع انضغاط العناصر ليظهر التمرير */
    white-space: nowrap; 
    padding: 0.6rem 1.25rem; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 0.85rem; 
    transition: var(--store-transition);
    border: 1px solid var(--store-border);
    background: var(--store-bg);
    color: var(--store-text);
}

.cat-pill:hover {
    border-color: var(--store-primary);
    color: var(--store-primary);
}

.cat-pill.active {
    background: var(--store-primary);
    color: white;
    border-color: var(--store-primary);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.container-v2 {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =====================================================
   STORE FOOTER
   ===================================================== */

.store-footer {
  background: var(--store-text);
  color: rgba(255, 255, 255, 0.7);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
}

.store-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.store-footer-info p {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.store-footer-info i {
  color: var(--store-primary-light);
}

.store-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: #25d366;
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--store-transition);
}

.store-whatsapp-btn:hover {
  background: #20bd5a;
  transform: scale(1.05);
  color: white;
}

.store-footer-copy {
  font-size: 0.8rem;
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.no-products {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--store-text-muted);
}

.no-products i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.2;
}

.no-products h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

/* Loading spinner */
.store-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
  .store-header-inner {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .store-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .store-hero h1 {
    font-size: 1.8rem;
  }

  .store-hero p {
    font-size: 0.95rem;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .product-image-wrapper {
    height: 160px;
  }

  .product-info {
    padding: 0.75rem;
  }

  .product-name {
    font-size: 0.85rem;
  }

  .product-description {
    display: none;
  }

  .product-price .current-price {
    font-size: 1rem;
  }

  .btn-add-cart {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .btn-add-cart span {
    display: none;
  }

  .category-bar {
    top: 85px;
  }

  .cart-panel {
    width: 100%;
    max-width: 100vw;
  }

  /* تحسين شريط البحث والتصنيفات للجوال */
  .store-filter-bar {
    padding: 1rem !important;
    top: 68px !important; /* يتناسب مع ارتفاع الهيدر المتغير في الجوال */
  }
  
  .store-filter-bar .container > div {
    flex-direction: column;
    gap: 0.75rem !important;
  }
  
  .store-filter-bar .search-wrapper {
    min-width: 100% !important;
  }
  
  .category-scroll-container {
      width: 100%;
      padding-bottom: 8px;
  }

  .checkout-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .product-image-wrapper {
    height: 130px;
  }

  .store-logo-text {
    font-size: 1rem;
  }

  .store-logo-subtitle {
    display: none;
  }

  .store-admin-link {
    display: none;
  }

  .store-hero {
    padding: 2rem 1rem;
  }

  .store-hero h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 360px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   TOAST NOTIFICATION
   ===================================================== */

.store-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--store-text);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 3000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.store-toast.success {
  background: var(--store-success);
}

.store-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
