/* ===================== Pages ===================== */
.page{ 
  display:none !important; 
}
.page.active{ 
  display:block !important; 
}
/* الصفحة الرئيسية */
#homePage.page{ 
  display:none !important; 
}
#homePage.page.active{ 
  display:block !important; 
}

/* Profile Page */
.profile-container {
  padding: 20px;
  font-family: 'Tajawal', sans-serif;
}

.profile-card {
  display: flex;
  background: linear-gradient(135deg, #ff8ac0, #7a004b);
  color: white;
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.profile-avatar {
  width: 70px;
  height: 70px;
  background: white;
  color: #7a004b;
  font-size: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-weight: bold;
  margin-left: 15px;
}

.profile-info h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.profile-info p {
  margin: 5px 0;
  font-size: 15px;
  opacity: 0.9;
}

.section-title {
  color: #7a004b;
  font-size: 20px;
  margin-bottom: 10px;
  font-weight: 700;
}

.order-box {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  border-right: 6px solid #7a004b;
}

.order-box p { margin: 4px 0; }

.status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  display: inline-block;
}

.st-new { background: #0288d1; }
.st-preparing { background: #ff9800; }
.st-completed { background: #4caf50; }
.st-out { background: #7a004b; }
.st-cancelled { background: #f44336; }

.logout-btn {
  width: 100%;
  background: #E91E63;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 17px;
  cursor: pointer;
  margin-top: 25px;
  font-weight: bold;
}

.logout-btn:hover {
  opacity: 0.85;
}

/* Invoice Page */
.invoice-container {
  max-width: 650px;
  margin: auto;
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 0 25px rgba(0,0,0,0.1);
}

.invoice-title {
  text-align: center;
  color: #8a004a;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 20px;
}

.invoice-info p {
  font-size: 18px;
  margin: 6px 0;
}

#invoiceItems .item-row {
  padding: 12px;
  background: #fafafa;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
}

.print-btn {
  width: 100%;
  padding: 14px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  margin-top: 20px;
}

.back-btn {
  width: 100%;
  padding: 14px;
  background: #E91E63;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  margin-top: 10px;
}

/* Track Page */
.track-container {
  max-width: 600px;
  margin: 40px auto;
  background: white;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  font-family: 'Tajawal', sans-serif;
}

.track-title {
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: #7a004b;
  margin-bottom: 20px;
}

.track-info p {
  margin: 6px 0;
  font-size: 16px;
  color: #444;
}

.timeline {
  margin: 25px 0;
  border-right: 3px solid #eee;
  padding-right: 20px;
}

.step-item {
  position: relative;
  margin-bottom: 22px;
  padding-right: 10px;
}

.step-circle {
  width: 18px;
  height: 18px;
  background: #ccc;
  border-radius: 50%;
  position: absolute;
  right: -29px;
  top: 3px;
  border: 3px solid #fff;
  box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.step-active .step-circle {
  background: #e91e63;
  box-shadow: 0 0 6px rgba(233, 30, 99, 0.7);
}

.step-text {
  font-size: 16px;
  font-weight: 600;
  color: #444;
}

.step-active .step-text {
  color: #e91e63;
}

.items-title {
  margin-top: 30px;
  font-size: 20px;
  color: #7a004b;
  font-weight: 700;
}

.item-card {
  background:#fafafa;
  padding:12px;
  border-radius:10px;
  margin-bottom:10px;
  border-right:5px solid #7a004b;
}

.item-card b { color:#333; }

.price-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row-reverse;
  padding:8px 0;
  margin-top:8px;
}

.order-card {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
}

.qty-btn {
  background:#E91E63;
  color:white;
  border:none;
  width:32px;
  height:32px;
  border-radius:8px;
  font-size:18px;
  display:flex;
  justify-content:center;
  align-items:center;
  cursor:pointer;
  font-weight:bold;
}

.qty-btn:hover{
  opacity:0.8;
}

.step {
  padding: 12px;
  margin-bottom: 10px;
  background: #eee;
  border-radius: 8px;
  font-weight: 600;
  color: #444;
  border-right: 6px solid #aaa;
}

.active-step {
  background: #e91e63;
  color: white;
  border-right: 6px solid #7a004b;
}

/* Product Details Page */
.product-details-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.product-main-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 50px;
}

@media (max-width: 768px) {
  .product-main-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.product-image-wrapper {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(138, 0, 74, 0.1);
  overflow: hidden;
  align-self: start;
  height: fit-content;
}

.product-main-image {
  width: 100%;
  height: auto;
  border-radius: 16px;
  cursor: zoom-in;
  transition: transform 0.3s ease;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 10px;
}

.product-main-image:hover {
  transform: scale(1.02);
}

.product-main-image.grayscale,
.out-of-stock-image .product-main-image {
  filter: grayscale(100%);
  opacity: 0.6;
}

.product-wishlist-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 10;
}

.product-wishlist-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.product-wishlist-btn.active {
  background: rgba(138, 0, 74, 0.1);
  color: #8a004a;
}

.zoom-hint {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(138, 0, 74, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-image-wrapper:hover .zoom-hint {
  opacity: 1;
}

#imageZoomOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

#zoomedImage {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

.product-info-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-header {
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 20px;
}

.product-title {
  font-size: 32px;
  font-weight: 800;
  color: #8a004a;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.product-barcode {
  display: none; /* إخفاء الباركود الدولي */
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 12px 18px;
  border-radius: 12px;
  border-right: 4px solid #8a004a;
}

.barcode-label {
  font-size: 14px;
  color: #666;
  font-weight: 600;
}

.barcode-value {
  font-size: 16px;
  color: #8a004a;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
}

.product-pricing {
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 100%);
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #fce4ef;
}

.price-before-discount {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.discount-badge {
  background: linear-gradient(135deg, #E91E63 0%, #c2185b 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.price-amount {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, #8a004a 0%, #E91E63 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-currency {
  font-size: 24px;
  color: #8a004a;
  font-weight: 700;
}

.product-description {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.section-label {
  font-size: 18px;
  font-weight: 700;
  color: #8a004a;
  margin: 0 0 12px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.description-text {
  font-size: 16px;
  line-height: 1.8;
  color: #444;
  margin: 0;
}

.product-add-btn {
  background: linear-gradient(135deg, #E91E63 0%, #c2185b 100%);
  color: white;
  border: none;
  padding: 18px 32px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 24px rgba(233, 30, 99, 0.4);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.product-add-btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.product-add-btn.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  position: absolute;
}

.product-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(233, 30, 99, 0.4);
}

.product-add-btn:active {
  transform: translateY(0);
}

.product-add-btn.added {
  background: linear-gradient(135deg, #8a004a 0%, #6a0038 100%);
}

.product-add-btn.out-of-stock-btn {
  background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%) !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  box-shadow: 0 4px 12px rgba(158, 158, 158, 0.4) !important;
  pointer-events: none !important;
  font-weight: 700 !important;
}

.product-add-btn.out-of-stock-btn:hover {
  transform: none !important;
  box-shadow: 0 4px 12px rgba(158, 158, 158, 0.4) !important;
  background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%) !important;
}

.product-add-btn.out-of-stock-btn:active {
  transform: none !important;
}

.product-add-btn.out-of-stock-btn:disabled {
  background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%) !important;
  color: #fff !important;
  opacity: 1 !important;
}

.product-stock-info {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  padding: 12px 18px;
  border-radius: 12px;
  border: 2px solid #ffb74d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stock-label {
  font-size: 14px;
  color: #e65100;
  font-weight: 600;
}

.stock-value {
  font-size: 16px;
  color: #e65100;
  font-weight: 800;
}

/* Similar Products Slider */
.similar-products-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 3px solid #f0f0f0;
}

.similar-products-title {
  font-size: 28px;
  font-weight: 800;
  color: #8a004a;
  margin: 0 0 30px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.similar-slider-wrapper {
  position: relative;
  padding: 0 50px;
}

.similar-products-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: #E91E63 #f0f0f0;
}

.similar-products-slider::-webkit-scrollbar {
  height: 6px;
}

.similar-products-slider::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.similar-products-slider::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #E91E63 0%, #8a004a 100%);
  border-radius: 10px;
}

.similar-product-card {
  min-width: 220px;
  max-width: 220px;
  width: 220px;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(138, 0, 74, 0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.similar-product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(138, 0, 74, 0.2);
  border-color: #fce4ef;
}

.similar-product-image-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.similar-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 0.3s ease;
}

.similar-product-card:hover .similar-product-image {
  transform: scale(1.05);
}

.similar-product-discount {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #E91E63 0%, #c2185b 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.similar-product-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.similar-product-name {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin: 0;
  height: 40px;
  overflow: hidden;
  line-height: 1.4;
}

.similar-product-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.similar-price-old {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
}

.similar-price-new {
  font-size: 18px;
  font-weight: 800;
  color: #8a004a;
}

.slider-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #8a004a 0%, #E91E63 100%);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(138, 0, 74, 0.3);
  transition: all 0.3s ease;
}

.slider-nav-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 24px rgba(138, 0, 74, 0.4);
}

.slider-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.slider-nav-prev {
  right: -24px;
}

.slider-nav-next {
  left: -24px;
}

@media (max-width: 768px) {
  .similar-slider-wrapper {
    padding: 0 40px;
  }
  
  .slider-nav-prev {
    right: -20px;
  }
  
  .slider-nav-next {
    left: -20px;
  }
  
  .slider-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

/* Checkout Page */
.checkout-container {
  min-height: calc(100vh - 100px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.checkout-card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(138, 0, 74, 0.15),
              0 8px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 680px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.checkout-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #E91E63 0%, #8a004a 100%);
}

.checkout-header {
  text-align: center;
  margin-bottom: 35px;
}

.checkout-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.checkout-title {
  font-size: 28px;
  font-weight: 800;
  color: #8a004a;
  margin: 0 0 8px 0;
}

.checkout-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0;
}

.checkout-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.checkout-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.section-title-small {
  font-size: 18px;
  font-weight: 700;
  color: #8a004a;
  margin-bottom: 20px;
}

.checkout-readonly {
  background: linear-gradient(135deg, #fce4ef 0%, #f8bbd0 100%) !important;
  border: 2px solid #E91E63 !important;
  color: #8a004a !important;
  font-weight: 600 !important;
  cursor: not-allowed !important;
  position: relative;
  padding-left: 45px !important;
}

.checkout-readonly::before {
  content: "✓";
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #4caf50;
  font-size: 18px;
  font-weight: bold;
}

.checkout-readonly:focus {
  border-color: #8a004a !important;
  box-shadow: 0 0 0 4px rgba(138, 0, 74, 0.15) !important;
  transform: none !important;
}

.modern-btn-location {
  background: linear-gradient(135deg, #00AEEF 0%, #0088cc 100%);
  color: white;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 16px rgba(0, 174, 239, 0.3);
  margin-bottom: 12px;
}

.modern-btn-location:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 174, 239, 0.4);
}

.modern-btn-location:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 20px;
}

.location-hint {
  display: block;
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  text-align: right;
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.checkout-btn-blue {
  background: linear-gradient(135deg, #00AEEF 0%, #0088cc 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 174, 239, 0.3) !important;
}

.checkout-btn-blue:hover {
  box-shadow: 0 8px 24px rgba(0, 174, 239, 0.4) !important;
}

.modern-btn-back {
  background: #f8f8f8;
  color: #8a004a;
  width: 100%;
  padding: 14px 24px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modern-btn-back:hover {
  background: #f0f0f0;
  border-color: #8a004a;
  transform: translateY(-2px);
}

#checkoutItems {
  margin-top: 0 !important;
}

@media (max-width: 768px) {
  .checkout-container {
    padding: 20px 10px;
  }

  .checkout-card {
    padding: 25px 20px;
    border-radius: 20px;
  }

  .checkout-title {
    font-size: 24px;
  }

  .checkout-icon {
    font-size: 48px;
  }
}
