/* Apple-style Navigation */
.apple-header {
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transform: translateZ(0);
  will-change: backdrop-filter;
}

.apple-nav {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px;
}

.nav-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 44px;
}

.apple-logo {
  font-size: 24px;
  color: #f5f5f7;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: opacity;
}

.apple-logo:hover {
  opacity: 1;
}

.nav-links {
  display: flex;
  gap: 30px;
  margin-right: 20px;
}

.nav-links a {
  color: #f5f5f7;
  text-decoration: none;
  font-size: 12px;
  opacity: 0.8;
  transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: opacity;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  width: 30px;
  height: 30px;
  position: relative;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #f5f5f7;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: transform;
}

.menu-toggle span:first-child {
  transform: translate3d(-50%, -50%, 0) translate3d(0, -8px, 0);
}

.menu-toggle span:last-child {
  transform: translate3d(-50%, -50%, 0) translate3d(0, 8px, 0);
}

.menu-toggle.active span:first-child {
  transform: translate3d(-50%, -50%, 0) rotate(45deg) !important;
}

.menu-toggle.active span:last-child {
  transform: translate3d(-50%, -50%, 0) rotate(-45deg) !important;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 20px;
  z-index: 9998;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.mobile-menu-content a {
  color: #f5f5f7;
  text-decoration: none;
  font-size: 17px;
  opacity: 0.8;
  transition: opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: opacity;
}

.mobile-menu-content a:hover,
.mobile-menu-content a.active {
  opacity: 1;
}

/* Adjust main content to account for fixed header */
body {
  padding-top: 44px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  padding: 0;
  background: #f0f0f5;
  color: #333333;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1rem;
  min-height: calc(100vh - 44px); /* Account for header height */
  width: 100%;
  box-sizing: border-box;
}

h1 {
  font-size: 56px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-align: center;
  margin: 3rem 0;
  color: #1a1a1a;
}

.subtitle {
  font-size: 28px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: .007em;
  text-align: center;
  margin-bottom: 3rem;
  color: #555555;
  padding: 0 1rem;
}

h2 {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: .003em;
  text-align: center;
  margin: 2.5rem 0 1.5rem;
  color: #1a1a1a;
}

.description {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 2.5rem 0;
  color: #555555;
  padding: 0 2rem;
}

.next-batch {
  background: #ffffff;
  padding: 3rem 2rem;
  border-radius: 18px;
  margin: 3rem auto;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 600px;
  box-sizing: border-box;
}

.batch-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.date {
  font-size: 24px;
  line-height: 1.33341;
  font-weight: 500;
  color: #1a1a1a;
}

.flavor-tag {
  display: inline-block;
  background: #f8f8f8;
  padding: 0.6rem 1.8rem;
  border-radius: 20px;
  font-weight: 500;
  color: #1a1a1a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 18px;
}

form {
  max-width: 600px;
  margin: 3rem auto;
  padding: 3rem 2rem;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 0.6rem;
  text-align: left;
  color: #1a1a1a;
}

input, textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 17px;
  background: #fcfcfc;
  color: #333333;
  transition: border-color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-sizing: border-box;
  -webkit-appearance: none;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0,113,227,0.1);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.rating-group,
.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.rating-group label,
.radio-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 17px;
  color: #333333;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rating-group input[type="radio"],
.radio-group input[type="radio"] {
  /* Reset default styles */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Custom visual styles */
  width: 20px;
  height: 20px;
  border: 2px solid #b3b3b3;
  border-radius: 50%;
  margin-right: 0.75rem;
  transition: background-color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  cursor: pointer;
  outline: none;
  vertical-align: middle;
  position: relative;
  background: #ffffff;
  will-change: background-color, border-color;
}

.rating-group input[type="radio"]:checked,
.radio-group input[type="radio"]:checked {
  background-color: #0071e3; /* Apple blue for checked state */
  border-color: #0071e3;
}

.rating-group input[type="radio"]:checked::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Focus styles for accessibility */
.rating-group input[type="radio"]:focus {
  box-shadow: 0 0 0 4px rgba(0,113,227,0.2);
}

button {
  background: #0071e3;
  color: #ffffff;
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  width: 100%;
  transition: background-color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  will-change: background-color, transform;
  transform: translateZ(0);
}

button:hover {
  background: #0077ed;
  transform: translate3d(0, -1px, 0);
}

button:active {
  transform: translate3d(0, 0, 0);
}

.footer-note {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-align: center;
  margin-top: 3rem;
  color: #888888;
  padding: 0 1rem;
}

/* Media Queries for Responsive Design */
@media only screen and (max-width: 734px) {
  body {
    padding-top: 44px; /* Height of the header */
  }

  .container {
    padding: 0.75rem 1rem;
  }

  h1 {
    font-size: 32px;
    margin: 1.5rem 0;
  }

  .subtitle,
  .thank-you-message {
    font-size: 19px;
    margin-bottom: 1.5rem;
  }

  h2 {
    font-size: 24px;
  }

  .next-batch {
    padding: 2rem 1rem;
    margin: 2rem 0;
    border-radius: 12px;
  }

  .date {
    font-size: 19px;
  }

  form {
    margin: 2rem auto;
    padding: 1.5rem;
  }

  input, textarea {
    font-size: 16px;
    padding: 0.7rem;
  }

  button {
    padding: 0.8rem 1.5rem;
    font-size: 16px;
  }

  .compliment-section {
    padding: 2rem 1rem;
    margin: 2rem 0;
    border-radius: 12px;
  }

  .compliment-section h2 {
    font-size: 24px;
    margin-bottom: 1rem;
  }

  .compliment-text {
    font-size: 19px;
  }

  .loaf-description-text {
    font-size: 16px;
    margin-top: 0;
  }

  .collapsible-toggle {
    font-size: 16px;
    padding: 0.4rem 0.8rem;
  }

  .nav-container {
    justify-content: flex-end;
  }

  .nav-links {
    display: none;
    margin-right: 0;
  }

  .menu-toggle {
    display: block;
    order: 2;
  }

  .mobile-menu.active {
    display: block;
  }

  .menu-toggle.active span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:last-child {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .mobile-menu {
    top: 44px; /* Match header height */
  }

  .collapsible-content {
    max-height: 300px; /* Adjusted max-height for mobile */
  }

  .collapsible-content:not(.collapsed) {
    padding: 0.75rem 1rem 0.75rem 1rem; /* Consistent vertical padding for mobile */
  }

  .description {
    padding: 0 1rem;
  }

  .thank-you-message {
    padding: 0 1rem;
  }

  .compliment-text {
    padding: 0 1rem;
  }

  .loaf-description-text {
    padding: 0 1rem;
  }
}

/* iPhone SE and smaller devices */
@media only screen and (max-width: 375px) {
  h1 {
    font-size: 28px;
  }

  .subtitle,
  .thank-you-message {
    font-size: 17px;
  }

  .next-batch {
    padding: 1.5rem 1rem;
  }

  .date {
    font-size: 17px;
  }

  .compliment-section h2 {
    font-size: 22px;
  }

  .compliment-text {
    font-size: 17px;
  }

  .loaf-description-text {
    font-size: 15px;
  }

  .collapsible-toggle {
    font-size: 15px;
    padding: 0.3rem 0.6rem;
  }

  .collapsible-content:not(.collapsed) {
    padding: 0.75rem 1rem;
  }
}

/* Ensure proper touch targets on mobile */
@media (hover: none) {
  button {
    padding: 1rem 2rem;
  }

  input, textarea {
    padding: 1rem;
  }
}

.thank-you-message {
  font-size: 19px;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  text-align: center;
  margin: 2rem 0;
  color: #555555;
  padding: 0 2rem;
}

.back-home-link {
  color: #0071e3; /* Apple blue */
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  transition: color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: color;
}

.back-home-link:hover {
  color: #0077ed;
}

.compliment-section {
  background: #ffffff;
  padding: 3rem 2rem;
  border-radius: 18px;
  margin: 3rem auto;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0,0,0,0.08);
  max-width: 600px;
}

.compliment-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 36px;
  line-height: 1.2;
}

.compliment-text {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 500;
  color: #1a1a1a;
  font-style: italic;
  padding: 0 2rem;
}

.loaf-description-text {
  font-size: 18px;
  line-height: 1.5;
  color: #555555;
  margin: 0; /* Crucial: ensure no internal margins affecting parent's scrollHeight */
  text-align: center;
  padding: 0;
  word-wrap: break-word;
  white-space: normal;
}

.collapsible-container {
  margin-top: 0; /* Rely on flex gap from parent .batch-details */
  margin-bottom: 1rem; /* Add consistent gap after the collapsible section */
  text-align: center;
}

.collapsible-toggle {
  display: inline-block;
  font-size: 17px;
  font-weight: 500;
  color: #0071e3; /* Apple blue */
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  will-change: color, background-color;
}

.collapsible-toggle:hover {
  color: #0077ed;
  background: rgba(0, 0, 0, 0.03);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: max-height, opacity;
  max-height: 0;
  opacity: 0;
}

.collapsible-content:not(.collapsed) {
  max-height: 500px;
  opacity: 1;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Adjustments for iPad-like screens (within 734px and 1024px, if needed) */
/* This section is intentionally left mostly blank for now, as base desktop styles will handle most iPad scaling */
/* If specific iPad breakpoints are needed, they would go here. */

/* Honeypot field for bot prevention */
.honeypot-field {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
}

/* Admin page styles */
.admin-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem;
}

/* FAQ Section Styles */
.faq-section {
  background: #ffffff;
  border-radius: 18px;
  margin: 3rem auto;
  padding: 3rem 2rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-align: center;
  box-sizing: border-box;
}
.faq-section h2 {
  text-align: center;
  font-size: 32px;
  margin-bottom: 2rem;
  color: #1a1a1a;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  align-items: center;
}
.faq-item {
  border-bottom: 1px solid #eee;
  padding-bottom: 0.2rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-question {
  display: block;
  font-size: 18px;
  font-weight: 500;
  color: #0071e3;
  text-decoration: none;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: color 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  text-align: center;
}
.faq-answer {
  font-size: 16px;
  color: #555;
  padding: 0;
  text-align: center;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0.0, 0.2, 1), padding 0.2s;
}
.faq-answer:not(.collapsed) {
  padding: 0.5rem 0 0.5rem 0;
  max-height: 500px; /* Large enough for any answer */
}
@media only screen and (max-width: 734px) {
  .faq-section {
    padding: 2rem 1rem;
    margin: 2rem auto 1.5rem auto;
    border-radius: 12px;
    max-width: 100%;
  }
  .faq-section h2 {
    font-size: 22px;
    margin-bottom: 1rem;
  }
  .faq-list {
    gap: 1rem;
  }
  .faq-item {
    max-width: 100%;
  }
  .faq-question {
    font-size: 16px;
  }
  .faq-answer {
    font-size: 15px;
  }
}

.faq-steps {
  list-style: disc inside;
  margin: 0.5em 0 0.5em 0;
  padding: 0;
  text-align: left;
  display: inline-block;
}
.faq-steps li {
  margin: 0.2em 0;
  padding: 0;
  font-size: 15px;
}
