/* Order Page Specific Styles */
/* This CSS file works alongside test.css for the order page */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}
/* CAPTCHA Container */
.g-recaptcha {
  margin: 2rem auto;
  display: flex;
  justify-content: center;
}

.g-recaptcha + input[type="submit"] {
  display: block;
  margin: 1rem auto;
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-family: var(--font-family-heading);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.captcha-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}


.g-recaptcha + input[type="submit"]:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(150, 120, 211, 0.2);
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}


/* ====== RESPONSIVE STYLES ====== */
@media (max-width: 992px) {
  .about-content {
    flex-direction: column;
  }

  .about-image {
    margin-bottom: var(--spacing-md);
  }
  
  h1 {
    font-size: 2.25rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 768px) {
  .header-content {
    position: relative;
  }

  .menu,
  .phone {
    display: none;
  }

  .menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-image: linear-gradient(180deg, #ffc0cb 0%, #c1a3e6 100%);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    z-index: 10;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
  
  .menu.active a {
    margin-bottom: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.2);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }
  
  .hero h2 {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
  }
  
  .hero-buttons .btn {
    width: 100%;
  }

  .dishes {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }
}
/* Success Message */
p[style*="color: green"] {
  text-align: center;
  font-size: 1.2rem;
  margin: 2rem 0;
  padding: 1rem;
  background-color: #e6ffe6;
  border-radius: 8px;
  border: 1px solid #4caf50;
}

/* Order Form Container */
form {
  /* shrink to the content’s width, then center via auto-margins */
  width: fit-content;
  margin: 2rem auto;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}


/* Fieldset Styling */
fieldset {
  background-color: white;
  border: 2px solid var(--primary-light);
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  max-width: 800px;
}

legend {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0 1rem;
  background-color: white;
  border-radius: 20px;
}

/* Form Labels */
label {
  display: block;
  font-weight: 600;
  color: var(--dark);
  font-family: var(--font-family-heading);
}

/* Form Inputs and Selects */
input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid #e6e0f5;
  border-radius: 8px;
  font-family: var(--font-family-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(150, 120, 211, 0.1);
  outline: none;
}

select {
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239678d3"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

select option:disabled {
  color: #999;
  background-color: #f5f5f5;
}

/* Readonly Price Field */
#price_field {
  background-color: #f8f5ff;
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

#price_field.price-updated {
  animation: priceUpdate 0.5s ease-out;
}

@keyframes priceUpdate {
  0% {
    background-color: var(--accent-light);
    transform: scale(1.05);
  }
  100% {
    background-color: #f8f5ff;
    transform: scale(1);
  }
}

/* Visual feedback for form changes */
.form-changed {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
  animation: formHighlight 1s ease-out;
}

@keyframes formHighlight {
  0% {
    outline-color: var(--accent);
    outline-width: 4px;
  }
  100% {
    outline-color: var(--accent);
    outline-width: 2px;
  }
}

/* Live update indicators */
.update-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--secondary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-family: var(--font-family-heading);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.update-indicator.show {
  display: block;
}

/* Item count badge */
.item-count-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: var(--accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  0% {
    transform: scale(0);
  }
  70% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Quantity Controls */
.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

button[onclick*="decreaseValue"],
button[onclick*="increaseValue"] {
  background-color: var(--secondary);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

button[onclick*="decreaseValue"]:hover,
button[onclick*="increaseValue"]:hover {
  background-color: var(--secondary-dark);
  transform: scale(1.1);
}

button[onclick*="decreaseValue"]:active,
button[onclick*="increaseValue"]:active {
  transform: scale(0.95);
}

#quantityInput {
  width: 60px;
  text-align: center;
  background-color: #f8f5ff;
  border: 2px solid var(--primary-light);
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

#quantityInput.changing {
  animation: quantityChange 0.3s ease-out;
}

@keyframes quantityChange {
  0% {
    transform: scale(1.2);
    color: var(--accent);
  }
  100% {
    transform: scale(1);
    color: var(--dark);
  }
}

/* Add Item Button */
#add_item {
  background-color: var(--secondary-light);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-family: var(--font-family-heading);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

#add_item:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 181, 193, 0.3);
}

#add_item:active {
  transform: translateY(0);
}

#add_item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s ease-out;
  opacity: 0;
}

#add_item:active::after {
  animation: none;
  opacity: 0.5;
  transform: translate(-50%, -50%) scale(0);
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(50);
    opacity: 0;
  }
}

/* Order Summary Section */
#orderSummary {
  background-color: #f8f5ff;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 100px;
  border: 2px solid var(--primary-light);
  box-shadow: 0 4px 10px rgba(150, 120, 211, 0.1);
  transition: all 0.3s ease;
}

#orderSummary.highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 181, 193, 0.3);
  transform: scale(1.01);
}

#orderSummary p {
  color: var(--gray);
  font-style: italic;
  text-align: center;
}

#orderSummary .item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background-color: white;
  border-radius: 8px;
  border: 1px solid #e6e0f5;
  position: relative;
  transition: all 0.3s ease;
  animation: itemAdded 0.5s ease-out;
}

@keyframes itemAdded {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    background-color: var(--accent-light);
  }
  50% {
    background-color: var(--accent-light);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    background-color: white;
  }
}

#orderSummary .item-row:hover {
  transform: translateX(5px);
  box-shadow: 0 3px 10px rgba(150, 120, 211, 0.15);
  border-color: var(--primary);
}

#orderSummary .item-row.removing {
  animation: itemRemoved 0.5s ease-out forwards;
}

@keyframes itemRemoved {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(50px);
  }
}

#orderSummary .item-content {
  display: flex;
  flex-direction: column;
}

#orderSummary .item-name {
  font-weight: 600;
  color: var(--dark);
  font-size: 1rem;
}

#orderSummary .item-details {
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

#orderSummary .item-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#orderSummary .item-quantity {
  background-color: var(--primary-light);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.9rem;
  font-weight: 600;
}

#orderSummary .item-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 60px;
  text-align: right;
}

#orderSummary > div {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

#orderSummary span {
  white-space: nowrap;
}

#orderSummary input.edit-quantity {
  width: 60px;
  padding: 4px;
  border: 2px solid #4CAF50;
  border-radius: 4px;
  font-size: 14px;
}

#orderSummary .remove-item {
  background-color: #ff4d4f;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#orderSummary .remove-item:hover {
  background-color: #d9363e;
  transform: scale(1.1);
}

/* Order Total */
#orderSummary .order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-top: 1rem;
  background-color: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

#orderSummary .order-total span:last-child {
  font-size: 1.4rem;
  transition: all 0.3s ease;
}

#orderSummary .order-total.price-changed span:last-child {
  animation: priceChange 0.5s ease-out;
}

@keyframes priceChange {
  0% {
    transform: scale(1.2);
    color: var(--accent);
  }
  100% {
    transform: scale(1);
    color: white;
  }
}

/* Payment Section */
fieldset h3 {
  color: var(--primary);
  margin: 2rem 0 1rem;
  font-family: var(--font-family-heading);
}

#card-container {
  background-color: white;
  border: 2px solid #e6e0f5;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  min-height: 80px;
}

/* Terms and Conditions Checkbox */
label:has(#agree_terms) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

#agree_terms {
  width: auto;
  margin-bottom: 0;
}

label:has(#agree_terms) a {
  color: var(--primary);
  text-decoration: underline;
}

label:has(#agree_terms) a:hover {
  color: var(--primary-light);
}

/* Pay Button */
#card-button {
  background: linear-gradient(120deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-family: var(--font-family-heading);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(150, 120, 211, 0.3);
}

#card-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(150, 120, 211, 0.4);
}

#card-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#payment-total {
  font-size: 1.1em;
}

/* Form Validation Styles */
input:invalid,
select:invalid {
  border-color: #ff6b6b;
}

input:valid,
select:valid {
  border-color: #4caf50;
}

/* Custom Error Messages */
.error-message {
  color: #ff6b6b;
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  display: none;
}

input:invalid + .error-message {
  display: block;
}

/* Loading State */
.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  form {
    margin: 1rem;
  }
  
  fieldset {
    padding: 1rem;
  }
  
  legend {
    font-size: 1.25rem;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .quantity-controls {
    justify-content: center;
  }
  
  #card-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* Print Styles */
@media print {
  fieldset {
    border: 1px solid #ddd;
    box-shadow: none;
  }
  
  button,
  #card-container,
  #card-button,
  .g-recaptcha {
    display: none;
  }
}