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

body {
  font-family: 'Georgia', serif;
  line-height: 1.6;
  color: #333;
  background: #fcf9f2;
  font-size: 16px;
}

/* Header Styles */
.header {
  background: #fcf9f2;
  padding: 15px 0;
  border-bottom: 1px solid #e0e0e0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 60px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: #ba9f38;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

/* Image Section */
.image-section {
  margin-top: 30px;
      position: relative;
}

.main-image-container {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  user-select: none;
}

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

.gallery-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(252, 249, 242, 0.9);
  border: 1px solid #333;
  color: #333;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.gallery-nav-button:hover {
  background: #ba9f38;
  color: #fcf9f2;
  transform: translateY(-50%) scale(1.1);
}

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

.gallery-nav-button.prev {
  left: 10px;
}

.gallery-nav-button.next {
  right: 10px;
}

.thumbnail-gallery {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
  overflow-x: auto;
      padding: 10px 0;
      -webkit-overflow-scrolling: touch;
}

.thumbnail-gallery::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-gallery::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.thumbnail-gallery::-webkit-scrollbar-thumb {
  background: #ba9f38;
  border-radius: 3px;
}

.thumbnail {
  width: 80px;
  height: 80px;
  min-width: 80px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  user-select: none;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: #333;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.thumbnail:focus {
  outline: 2px solid #ba9f38;
  outline-offset: 2px;
}

.back-to-menu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fcf9f2;
  color: #333;
  text-decoration: none;
  border: 1px solid #ddd;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 30px 0px;
  align-self: center;
}

.back-to-menu:hover {
  border-color: #ba9f38;
  color: #ba9f38;
  transform: translateX(-3px);
}

/* Product Details Section */
.product-details {
  background: #fcf9f2;
  padding: 20px 0;
}

.product-title {
  font-size: 2rem;
  color: #333;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.2;
}

.price-range {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 30px;
  font-weight: 600;
}

.description {
  font-size: 1rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 30px;
  background: #fcf9f2;
  text-align: justify;
}

.allergen-warning {
  background: #e1cc96;
  border: 1px solid #e4c984;
  color: black;
  padding: 15px;
  margin-bottom: 30px;
  font-size: 0.95rem;
  font-weight: 500;
}

.form-section {
  margin-top: 30px;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  font-size: 1rem;
  background: #fcf9f2;
  color: #333;
  transition: all 0.3s ease;
  font-family: 'Georgia', serif;
}

.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  font-size: 1rem;
  background: #fcf9f2;
  color: #333;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: 'Georgia', serif;

  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Add custom dropdown arrow */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 40px; /* Make room for custom arrow */
  
  /* Prevent text overflow on mobile */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.form-group select option {
  padding: 10px;
  background: #fcf9f2;
  color: #333;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #333;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: #ba9f38;
}

/* Enhanced Date Input */
.form-group input[type="date"] {
  position: relative;
  background: #fcf9f2;
  cursor: pointer;
  font-size: 16px;
  text-align: left;
  -webkit-appearance: none; /* Remove iOS default styling */
  -moz-appearance: none;
  appearance: none;
}

.form-group input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  background-color: #ba9f38;
  border-radius: 3px;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  opacity: 1;
  filter: none;
}

.form-group input[type="date"]::-moz-focus-inner {
  border: 0;
  padding: 0;
}

/* Add-ons Section */
.addons-section {
  margin-top: 30px;
  background: #fcf9f2;
}

.addons-title {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 15px;
}

.addons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.addon-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: #fcf9f2;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
  cursor: pointer;
}

.addon-item:hover {
  border-color: #ba9f38;
}

.addon-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.addon-content input[type="checkbox"],
.addon-content input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #ba9f38;
  cursor: pointer;
}

.addon-content label {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
}

.addon-price {
  font-weight: 600;
  color: #ba9f38;
  font-size: 0.95rem;
}

/* Allergen Section - styled like add-ons */
.allergen-section {
  margin-top: 30px;
}

.allergen-title {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 15px;
}

.allergen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.allergen-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: #fcf9f2;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
  cursor: pointer;
}

.allergen-item:hover {
  border-color: #ba9f38;
}

.allergen-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.allergen-content input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ba9f38;
  cursor: pointer;
}

.allergen-content label {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
}

.allergen-price {
  font-weight: 600;
  color: #ba9f38;
  font-size: 0.95rem;
}

/* Delivery Section - styled like add-ons */
.delivery-section {
  margin-top: 30px;
}

.delivery-title {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 15px;
}

.delivery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.delivery-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  background: #fcf9f2;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
  cursor: pointer;
}

.delivery-item:hover {
  border-color: #ba9f38;
}

.delivery-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delivery-content input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #ba9f38;
  cursor: pointer;
}

.delivery-content label {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
}

.delivery-price {
  font-weight: 600;
  color: #ba9f38;
  font-size: 0.95rem;
}

/* Additional Details Section */
.additional-details-section {
  margin-top: 30px;
  margin-bottom: 30px;
}

.additional-details-section textarea {
  min-height: 120px;
  resize: vertical;
  font-family: 'Georgia', serif;
}

.allergen-note {
  margin-top: 20px;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  line-height: 1.5;
  padding: 15px;
  background: #fcf9f2;
  border-left: 3px solid #cdd2d6;
}

/* Submit Button */
.add-to-cart {
  width: 100%;
  padding: 18px 24px;
  background: #fcf9f2;
  color: #333;
  border: 1px solid black;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 40px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Georgia', serif;
}

.add-to-cart:hover {
  background: #ba9f38;
  color: #fcf9f2;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(51, 51, 51, 0.2);
}

.add-to-cart:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(51, 51, 51, 0.2);
}

.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.form-group.error .error-message {
  display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    padding: 30px 20px;
  }
  
  .product-layout {
    gap: 40px;
  }
  
  .product-title {
    font-size: 2.2rem;
  }
}

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

  .main-image-container {
    height: 400px;
  }

  .gallery-nav-button {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .thumbnail {
    width: 70px;
    height: 70px;
    min-width: 70px;
  }

  .image-section {
    position: static;
    margin-top: 0;
  }

  .main-image {
    height: 400px;
  }

  .product-title {
    font-size: 2rem;
  }

  .price-range {
    font-size: 1.3rem;
  }

  .addons-grid,
  .allergen-grid,
  .delivery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .container {
    padding: 20px 15px;
  }

  .thumbnail-gallery {
    gap: 8px;
  }

  .nav-menu {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 14px 12px;
    min-height: 48px;
  }

  .form-group input[type="date"] {
    font-size: 16px; /* Critical for iOS - prevents auto-zoom */
    min-height: 44px; /* iOS touch target size */
  }

  .form-group select {
    font-size: 16px; /* CRITICAL: Prevents iOS auto-zoom */
    padding: 14px 40px 14px 12px;
    min-height: 48px; /* Better touch target for mobile */
  }
  
  .form-group select option {
    font-size: 16px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .gallery-nav-button {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  .product-title {
    font-size: 1.8rem;
  }
  
  .price-range {
    font-size: 1.2rem;
  }
  
  .add-to-cart {
    padding: 16px 20px;
    font-size: 1rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px;
    padding: 16px 12px;
    min-height: 50px;
  }

  .form-group select {
    font-size: 16px; /* Keep at 16px to prevent zoom */
    padding: 16px 40px 16px 12px;
    min-height: 50px; /* Even larger touch target */
  }
  
  .form-group label {
    font-size: 1rem; /* Slightly smaller labels on mobile */
  }
}

@supports (-webkit-overflow-scrolling: touch) {
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px !important; /* Force 16px on iOS to prevent zoom */
  }
}