/* Tab Navigation System */
.yg-tabs-container {
  position: fixed;
  top: 52px; /* Position below header */
  left: 0;
  right: 0;
  z-index: 999;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  direction: rtl;
  height: 52px;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease; /* Added transform to transition */
}
.yg-tabs-container.hidden {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-100%);
}

.yg-tabs-wrapper {
  display: flex;
  justify-content: center;
  flex-direction: row-reverse;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  height: 100%;
}

.yg-tab {
  flex: 1;
  text-align: center;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: color 0.3s ease;
  user-select: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yg-tab.active {
  color: #fe0000;
}

/* Beta Label Styles */
.beta-label {
  background: #ff3b30;
  background: linear-gradient(135deg, #ff3b30, #ff6259);
  color: white;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: "arabfont", sans-serif;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(255, 59, 48, 0.2);
  position: relative;
  overflow: hidden;
}

.beta-label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0)
  );
  border-radius: 10px 10px 0 0;
}

.new-text {
  font-size: 10px;
  font-weight: 600;
  animation: glow 2s infinite;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.3px;
}

.beta-text {
  font-size: 7px;
  font-weight: 400;
  opacity: 0.9;
  letter-spacing: 0.2px;
}

@keyframes glow {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#restaurants-content,
#supermarkets-content,
#taxi-content,
#shipping-content {
  width: 100vw;
  flex-shrink: 0;
  padding-top: 0;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height: calc(100vh - 52px);
}

/* Prevent text selection during swipe */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Allow text selection in content areas */
input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

/* Supermarket Specific Styles */
.super-categories-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.super-category-btn {
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  background: transparent;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.super-category-btn:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  transform: translateY(-1px);
}

.super-category-btn.active {
  background: #fe0000;
  color: white;
  border-color: #fe0000;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.super-category-btn.active:hover {
  background: #fe0000;
  border-color: #fe0000;
}

/* Supermarket content */
.super-supermarket-view {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.super-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #333;
}

.super-supermarket-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.super-market-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
}

.super-market-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.super-market-image-container {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  overflow: hidden;
}

.super-market-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.super-market-info {
  padding: 1.25rem;
}

.super-market-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.5rem 0;
}

.super-market-location {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.super-market-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.75rem 0;
  padding: 0.5rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.super-market-details span {
  font-size: 0.9rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.super-market-hours {
  font-size: 0.85rem;
  color: #666;
  margin: 0.5rem 0 0 0;
}

/* Products View */
.super-products-view {
  width: 100%;
  background: white;
  min-height: 100vh;
  position: relative;
  z-index: 990;
}

/* Back button */
.super-back-button {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1100;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: #333;
}

/* Market header */
.super-market-header {
  width: 100%;
  background: white;
  margin-top: 52px; /* Base margin - will be adjusted by JS */
  transition: margin-top 0.3s ease-out; /* Add transition for smooth change */
}
.super-market-header-content {
  width: 100%;
  position: relative;
  height: 200px;
}

.super-market-header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.super-market-header-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
  padding: 2rem;
  color: white;
}

.super-market-header-info h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.super-market-header-details {
  display: flex;
  gap: 2.5rem;
  font-size: 1rem;
}

.super-market-header-details span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Search container */
.super-search-container {
  position: sticky;
  top: 0;
  padding: 1rem;
  background: white;
  z-index: 1090;
  border-bottom: 1px solid #eee;
}

.super-search-input {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: block;
  padding: 0.75rem 1.25rem;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Products container */
.super-products-container {
  padding: 1rem;
  margin-bottom: 100px;
}

/* Loading spinner */
.super-loading {
  text-align: center;
  padding: 2rem;
}

.super-loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #fe0000;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* No results */
.super-no-results {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* Error message */
.super-error {
  text-align: center;
  padding: 2rem;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 0.5rem;
  margin: 1rem;
}

/* Make categories scrollable on mobile */
@media (max-width: 768px) {
  .super-categories-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .super-categories-container::-webkit-scrollbar {
    display: none;
  }

  .super-category-btn {
    flex: 0 0 auto;
  }

  .yg-tab {
    font-size: 14px;
    padding: 12px 0;
  }

  .super-market-header-content {
    height: 160px;
  }

  .super-market-header-info {
    padding: 1.5rem 1rem;
  }

  .super-market-header-info h2 {
    font-size: 1.4rem;
  }

  .super-market-header-details {
    gap: 1.5rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
  }

  .super-supermarket-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
  }

  .super-market-image {
    height: 160px;
  }
}

@media (max-width: 480px) {
  .yg-tabs-container {
    height: 48px;
  }

  .app-header {
    height: 48px;
  }

  #restaurants-content,
  #supermarkets-content,
  #taxi-content,
  #shipping-content {
    padding-top: 0px; /* 48px header + 48px tabs */
  }

  .super-market-header {
    margin-top: 96px;
  }
}
/* Content containers - Updated to ensure proper display during slide transitions */
.page-container {
  width: 400vw;
  display: flex;
  position: relative;
  will-change: transform;
  transition: transform 0.3s ease-out, margin-top 0.3s ease-out; /* Added margin-top transition */
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  margin-top: 52px; /* Default for when tabs are visible */
}

/* New class for when only restaurant tab is visible */
.page-container.tabs-hidden {
  margin-top: 0px;
}
#restaurants-content,
#supermarkets-content,
#taxi-content,
#shipping-content {
  width: 100vw;
  flex-shrink: 0;
  padding-top: 52px; /* Base padding - will be adjusted by JS */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  height: calc(100vh - 52px);
  display: block;
  overflow-y: hidden;
  transition: padding-top 0.3s ease-out; /* Add transition for smooth change */
}

/* Make the active tab's content scrollable */
.yg-tab.active + .content {
  overflow-y: auto;
}

/* Ensure body doesn't scroll horizontally */
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Fix for tab indicator positioning */
.yg-tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  width: 25%; /* Width for 4 tabs - will be set by JS */
  background-color: #fe0000;
  transition: transform 0.3s ease;
  left: 0;
  /* No default transform here - it will be set by JS */
}

/* CSS for showing a loading state while tabs are loading */
.yg-tabs-container.loading {
  position: relative;
}

.yg-tabs-container.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  margin-left: -12px;
  border-radius: 50%;
  border: 3px solid rgba(254, 0, 0, 0.2);
  border-top-color: #fe0000;
  animation: tabs-spinner 0.8s linear infinite;
  z-index: 10;
}

@keyframes tabs-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Transition for tabs visibility */
.yg-tabs-container {
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background-color: white;
  z-index: 1000; /* Higher than tabs */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.location-bar {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 16px;
}

.location-icon,
.user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.location-details {
  flex: 1;
  margin: 0 10px;
}

.location-label {
  font-size: 12px;
  color: #666;
}

.location-value {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}
