/* --- General Styles & Variables --- */
:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --text-color: #2f2f2f;
  --bg-color: #f7f7f7;
  --card-bg: #ffffff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* --- Header & Navigation --- */
header {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--primary-color);
}

#cart-count {
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  vertical-align: top;
  margin-left: 5px;
}

/* --- Main Content --- */
main {
  padding: 2rem 5%;
}

.btn {
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  background: #e65c5c;
  transform: translateY(-2px);
}

/* --- Hero Section (Index Page) --- */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&q=80&w=2070")
      center/cover no-repeat;
  border-radius: 12px;
  color: white;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* --- Menu Section --- */
.menu-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

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

.menu-item-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.menu-item-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.menu-item-card .card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.card-content .description {
  color: #666;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-footer .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* --- Cart Page --- */
.cart-page h1,
.checkout-page h1 {
  text-align: center;
  margin-bottom: 2rem;
}

#cart-items-container {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  flex-grow: 1;
  margin-left: 1rem;
}

.cart-item img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
}

#cart-summary {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: right;
}

#cart-summary h3 {
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
}

.empty-cart-message {
  text-align: center;
  font-size: 1.2rem;
  color: #888;
}

/* --- Checkout Page --- */
.checkout-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box; /* Important for padding */
}

.form-group .error-message {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  min-height: 1.2rem; /* Reserve space to prevent layout shifts */
}

#success-message {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2rem;
  border-radius: 12px;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem 5%;
  margin-top: 2rem;
  background: #333;
  color: white;
}

/* --- Notification Toast/Popup --- */
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-color);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.toast-notification.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --- Cart Quantity Controls --- */
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.quantity-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  color: var(--text-color);
}

.quantity-display {
  padding: 0 0.5rem;
  font-weight: 600;
}

/* --- Checkout Form Enhancements --- */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1; /* Each group takes equal space */
}

/* Make select inputs look like text inputs */
.form-group select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  background-color: white; /* Ensure consistent background */
  -webkit-appearance: none; /* Removes default browser styling on Chrome/Safari */
  -moz-appearance: none; /* Removes default browser styling on Firefox */
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7em top 50%;
  background-size: 0.65em auto;
}
