/* ---------------- Universal ---------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  background: #f7f7f7;
}

main.container {
  flex-grow: 1;
  max-width: 1200px; /* wider default content */
  margin: 0 auto 40px;
  padding: 80px 20px 20px; /* top padding replaces removed menu-title-box */
  text-align: center;
}

/* Fixed logo */
.fixed-logo {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
}
.fixed-logo img {
  width: 100px;
  height: auto;
}

/* Home icon */
.floating-home {
  position: fixed;
  top: 20px;
  right: 50px;
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 20px;
  border-radius: 50px;
  color: #000;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  font-size: 1.1rem;
}

/* Hover effect: smooth magnify */
.floating-home:hover {
  background: #fff;
  transform: scale(1.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.floating-home:focus-visible {
  outline: 2px solid #2a7b62;
  outline-offset: 3px;
}

/* Collapsible box (default / closed view too) */
.collapsible-box {
  position: relative; /* allow transform centering */
  border: 2px solid #bbb;
  border-radius: 12px;
  background-color: #fff;
  cursor: pointer;
  margin: 0 auto 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 150%; /* a bit wider than parent */
  max-width: 1150px;
  text-align: left;
  left: 50%; /* move origin to center of parent */
  transform: translateX(-50%); /* pull it back so it’s centered */
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.collapsible-box:hover {
  border-color: #ff6b6b;
  box-shadow: 0 6px 20px rgba(42, 123, 98, 0.4);
}

/* Desktop-only tweak: center and widen default boxes a bit more */
@media screen and (min-width: 769px) {
  .collapsible-box {
    padding-right: 10px; /* tiny visual widen without crowding */
    padding-left: 10px;
  }
}

.collapsible-summary {
  all: unset;
  display: block;
  cursor: pointer;
  padding: 18px 36px;
  font-size: 1.4rem;
  font-weight: bold;
  user-select: none;
  color: #000;
}
.collapsible-summary:hover {
  color: #2a7b62;
}
.collapsible-summary::-webkit-details-marker {
  display: none;
}

/* Menu grid */
.menu-grid {
  display: none;
  gap: 25px;
  justify-items: center;
  padding: 20px 10px 30px;
  grid-template-columns: repeat(2, 1fr);
}
.collapsible-box[open] .menu-grid {
  display: grid;
}

/* Menu cards */
.menu-card {
  background: #f4f3f3;
  border-radius: 22px;
  overflow: hidden;
  width: 100%;
  max-width: 920px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05), 0 0 20px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  transition: transform 0.2s, box-shadow 0.2s;
}
.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* Card image */
.menu-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: block;
}

/* Card info */
.menu-card .info {
  padding: 12px 20px;
  margin-top: 0;
  box-sizing: border-box;
}

/* Title inside card */
.menu-card .info h3 {
  font-size: 1.15rem;
  margin: 0;
  line-height: 1;
  font-weight: 700;
}

/* Price styling */
.menu-card .info .price {
  font-weight: 700;
  color: #ff6b6b;
  font-size: 1.05rem;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.menu-card .info .price span {
  white-space: nowrap;
  font-size: 1.05rem;
  line-height: 1;
}

/* Ice cream wrapper */
.icecream-flex {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
}
.icecream-flex h3,
.icecream-flex .price {
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

/* Topping paragraph style */
.menu-card.topping-card .info p {
  margin: 8px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff6b6b;
  text-align: center;
}

/* Ice Cream Price */
#icecream-items .price {
  font-size: 1.3rem;
  font-weight: bold;
  color: #ff6b6b;
  margin-top: 0;
}

/* Make toppings image full-width */
.menu-card.topping-card {
  grid-column: span 2;
}
.menu-card.topping-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px 0;
  font-size: 0.9rem;
  color: #444;
  width: 100%;
  flex-shrink: 0;
}

/* CTA */
.menu-cta {
  margin: 32px auto 0;
  max-width: 780px;
  background: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  text-align: center;
}
.menu-cta h2 {
  margin-bottom: 8px;
  color: #2a7b62;
}
.menu-cta p {
  margin-bottom: 16px;
  color: #333;
}
.cta-button {
  background: #2a7b62;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  padding: 12px 26px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.cta-button:hover {
  background: #16624b;
  transform: translateY(-1px) scale(1.01);
}
.cta-button:focus-visible {
  outline: 2px solid #2a7b62;
  outline-offset: 3px;
}

/* ---------- Desktop only layout ---------- */
@media screen and (min-width: 769px) {
  #boba-items,
  #fruittea-items {
    grid-template-columns: repeat(2, 1fr);
  }
  #boba-items > .menu-card:last-child,
  #fruittea-items > .menu-card:last-child {
    width: 100%;
  }
}

/* ---------------- Mobile View Fix ---------------- */
@media screen and (max-width: 768px) {
  /* FIX: Prevent mobile truncation of extra menu cards */
  .collapsible-box {
    overflow: visible !important;
    height: auto !important;
    width: 100%;
    max-width: 100%;
  }

  /* Container adjustments */
  main.container {
    max-width: 90%;
    margin: 0 auto 40px;
    padding: 80px 20px 20px;
    text-align: left;
  }

  /* Force all collapsible grids to single column on mobile */
  .collapsible-box .menu-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center;
    gap: 15px;
  }

  /* Cards take full width of grid */
  .collapsible-box .menu-grid .menu-card,
  .collapsible-box .menu-grid .menu-card.topping-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
    grid-column: span 1 !important;
  }

  /* Images adapt */
  .menu-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    display: block;
  }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
  main.container {
    max-width: 97%;
  }
  .collapsible-box .menu-grid .menu-card,
  .collapsible-box .menu-grid .menu-card.topping-card {
    width: 100%;
  }
}

/* ---------- Ice Cream FREE text ---------- */
.icecream-free {
  color: #ff6b6b;
  font-weight: 700;
  text-align: center;
  font-size: 1.5rem;
  margin-top: 8px;
}

@media screen and (max-width: 768px) {
  .menu-card {
    cursor: pointer;
  }
}

@media screen and (max-width: 768px) {
  /* Make logo smaller on mobile */
  .fixed-logo img {
    width: 60px; /* smaller than desktop 100px */
    height: auto;
  }

  /* Move Home icon higher and away from buttons on mobile */
  .floating-home {
    top: 20px; /* closer to top edge */
    right: 5px; /* closer to right edge, away from other buttons */
    padding: 10px 14px; /* a bit more compact */
    font-size: 0.95rem; /* slightly smaller text */
  }
  .menu-cta {
    padding: 20px;
  }
  .cta-button {
    width: 100%;
  }
}
