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

:root {
  --primary: #FF5722;
  --primary-dark: #E64A19;
  --secondary: #4CAF50;
  --background: #f5f5f5;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--background);
  color: var(--text-primary);
  padding-bottom: 100px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.store-logo-container {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.store-logo {
  font-weight: bold;
  color: var(--primary);
  font-size: 1.2rem;
}

.store-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.store-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-top: 5px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
}

.status-dot.open {
  background: #4CAF50;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Categories */
.categories-nav {
  background: white;
  position: sticky;
  top: 80px;
  z-index: 99;
  box-shadow: var(--shadow);
}

.categories-scroll {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  overflow-x: auto;
  max-width: 1200px;
  margin: 0 auto;
  scrollbar-width: none;
}

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

.category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  background: var(--background);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
  background: var(--primary);
  color: white;
}

/* Search */
.search-bar {
  padding: 15px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.search-bar input {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 30px;
  background: white;
  font-size: 1rem;
  box-shadow: var(--shadow);
  font-family: inherit;
}

.search-bar input:focus {
  outline: 2px solid var(--primary);
}

/* Menu Container */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
}

#menuContainer {
  padding: 0 20px;
}

.category-section {
  margin-bottom: 30px;
}

.category-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

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

/* Menu Item Card */
.menu-item {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.menu-item.unavailable {
  opacity: 0.6;
  pointer-events: none;
}

.item-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.item-content {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.item-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  flex: 1;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.item-add-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.3s;
}

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

/* Cart Button */
.cart-button {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(255, 87, 34, 0.4);
  z-index: 1000;
  transition: transform 0.3s;
  font-family: inherit;
}

.cart-button:hover {
  transform: translateX(-50%) scale(1.05);
}

.cart-button.hidden {
  display: none;
}

.cart-count {
  background: white;
  color: var(--primary);
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: flex-end;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#modalImage {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.modal-body {
  padding: 20px;
}

.modal-body h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

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

.modal-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary) !important;
}

.quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.quantity-control button {
  width: 45px;
  height: 45px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: white;
  color: var(--primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
}

.quantity-control button:hover {
  background: var(--primary);
  color: white;
}

.quantity-control span {
  font-size: 1.5rem;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

#itemNotes {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  resize: none;
  height: 80px;
  margin-bottom: 20px;
}

.add-to-cart-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.3s;
}

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

/* Cart Modal */
.cart-modal {
  position: relative;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
}

.cart-header h2 {
  font-size: 1.3rem;
}

.cart-header .modal-close {
  position: static;
  background: var(--background);
  color: var(--text-primary);
}

.back-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px 10px;
}

.cart-items {
  padding: 15px;
  max-height: 40vh;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

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

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

.cart-item-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item-notes {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-quantity button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 1rem;
}

.cart-item-remove {
  color: #f44336;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.cart-summary {
  padding: 15px 20px;
  background: var(--background);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin-top: 10px;
}

.checkout-btn {
  width: calc(100% - 40px);
  margin: 20px;
  padding: 18px;
  border: none;
  border-radius: 12px;
  background: var(--secondary);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Checkout Modal */
.checkout-modal {
  padding-bottom: 20px;
}

.form-group {
  padding: 0 20px;
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group textarea {
  height: 100px;
  resize: none;
}

.order-summary {
  margin: 20px;
  padding: 15px;
  background: var(--background);
  border-radius: 10px;
}

.order-summary h3 {
  margin-bottom: 10px;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.9rem;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.submit-btn {
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 18px;
  border: none;
  border-radius: 12px;
  background: #25D366;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Success Modal */
.success-modal {
  text-align: center;
  padding: 40px 20px;
  border-radius: 20px;
  margin: auto 20px;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.success-modal h2 {
  margin-bottom: 15px;
}

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

.success-btn {
  margin-top: 20px;
  padding: 15px 50px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-cart-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

/* Responsive */
@media (min-width: 768px) {
  .modal-content {
    border-radius: 20px;
    margin: auto;
  }

  .modal {
    align-items: center;
    padding: 20px;
  }
}

@media (max-width: 400px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .cart-button {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* Loading */
.loading {
  display: flex;
  justify-content: center;
  padding: 50px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}