/* General Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
}

header {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

nav ul li a {
  transition: color 0.3s ease;
}

/* Product Card */
.product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.offer-highlight {
  color: #ff4d4d;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Modal */
#productModal {
  transition: opacity 0.3s ease;
  padding: 16px;
}

#productModal .scale-95 {
  transform: scale(0.95);
}

#productModal .scale-100 {
  transform: scale(1);
}

#productModal .bg-white {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#closeModal {
  font-size: 24px;
  padding: 8px;
}

#modalBackButton {
  font-size: 16px;
  padding: 12px;
}

/* Google Login Popup */
#googleLoginPopup {
  transition: opacity 0.3s ease;
}

#googleLoginPopup .scale-95 {
  transform: scale(0.95);
}

#googleLoginPopup .scale-100 {
  transform: scale(1);
}

#googleLoginPopup .bg-white {
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Checkout Item Animation */
.checkout-item {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Remove Item Button */
.remove-item {
  font-size: 18px;
  color: #dc2626;
  transition: color 0.3s ease, transform 0.2s ease;
}

.remove-item:hover {
  color: #b91c1c;
  transform: scale(1.1);
}

/* Delivery Form */
#deliveryForm input {
  transition: box-shadow 0.3s ease;
}

#deliveryForm input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.3);
}

#deliveryForm input[readonly] {
  background-color: #e5e7eb;
  cursor: not-allowed;
}

/* Finalize Purchase Button Disabled */
#finalizePurchase.disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* Responsive Menu */
.nav-sidebar {
  transition: transform 0.3s ease;
}

.nav-sidebar-open {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .nav-sidebar {
      position: fixed;
      top: 0;
      right: 0;
      height: auto;
      max-height: 50vh;
      width: 200px;
      background-color: #1e3a8a;
      transform: translateX(100%);
      z-index: 50;
      padding: 60px 16px 16px 16px;
      box-shadow: -4px 0 8px rgba(0, 0, 0, 0.2);
  }

  .nav-sidebar-open {
      transform: translateX(0);
  }

  .nav-sidebar ul {
      padding: 0;
  }

  .nav-sidebar li {
      margin-bottom: 12px;
  }

  .nav-sidebar a {
      font-size: 16px;
  }

  #closeMenu {
      font-size: 24px;
      padding: 8px;
      transition: color 0.3s ease;
  }

  #closeMenu:hover {
      color: #facc15;
  }

  .menu-open {
      overflow: hidden;
  }

  #productModal {
      padding: 12px;
  }

  #productModal .bg-white {
      max-height: 85vh;
      padding: 16px;
  }

  #closeModal {
      font-size: 20px;
      padding: 6px;
  }

  #modalBackButton {
      padding: 10px;
  }

  #deliveryForm input {
    padding: 10px;
    font-size: 14px;
  }

  #deliveryForm button {
    padding: 10px;
    font-size: 16px;
  }
}

/* Brand Buttons */
#brandHeader {
  background-color: transparent;
  padding: 8px 0;
  margin-top: 4px;
}

#brandButtons {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#brandButtons::-webkit-scrollbar {
  display: none;
}

.brand-button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 20px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.brand-button:hover {
  background-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.brand-button.selected {
  background-color: #ffffff;
  color: #1e3a8a;
  font-weight: 600;
}

/* Cart Link Styling */
.cart-link {
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

.cart-link i {
  font-size: 18px;
  margin-right: 4px;
}

.cart-link:hover i {
  color: #facc15;
}

#cartCount {
  font-size: 14px;
  font-weight: 600;
}

/* Search Bar Styling */
#searchBar {
  transition: box-shadow 0.3s ease;
}

#searchBar:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.3);
}

#autocompleteResults {
  transition: opacity 0.3s ease;
}

.autocomplete-item {
  font-size: 14px;
  color: #1e3a8a;
  border-bottom: 1px solid #e5e7eb;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: #f3f4f6;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 640px) {
  #brandButtons {
      gap: 8px;
      padding: 0 12px;
  }

  .brand-button {
      padding: 6px 12px;
      font-size: 13px;
  }

  .cart-link i {
      font-size: 16px;
  }

  #cartCount {
      font-size: 12px;
  }

  .remove-item {
    font-size: 16px;
    padding: 6px;
  }
}