/* Universal Box-Sizing */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Ensure full height and prevent horizontal scroll */
html,
body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

main > section {
  width: 100%;
}

/* New Flex Container for the Entire Order Page */
#order-page-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background-color: #f8f8f8;
  min-height: 100vh; /* replaces height: 100vh */
  overflow: visible; /* replaces overflow: hidden */
}

#masthead-page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 720px;
  margin: auto;
  background-color: #f8f8f8;
  /* 🚫 No overflow: hidden here! */
}

/* Header with Fixed Height (50px) */
header {
  flex: 0 0 60px;
  width: 100%;
  max-width: 720px;
  background-color: rgba(13, 110, 253, 1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
  padding: 0 5px;
  z-index: 1000;
  margin: 0 auto;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Style for the Back button */
.back-btn {
  background-color: white;
  color: blue;
  border: none;
  font-size: 16px;
  padding: 8px 12px;
  margin-right: 10px;
  border-radius: 4px;
  cursor: pointer;
}

/* Increase touch target size on mobile devices */
@media (max-width: 720px) {
  .back-btn {
    font-size: 18px;
    padding: 10px 14px;
  }
}

/* Content Container that Expands and Scrolls */
#content-container {
  flex: 1 1 auto;
  width: 100%;
  max-width: 720px;
  overflow-y: auto;
  padding: 5px;
}

/* Main Content Area within the Content Container */
main {
  width: 100%;
  max-width: 720px;
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Category Header Styles - Always full width */
.category-header {
  width: 100%;
  min-width: 100%;
  margin: 0;
  background-color: rgba(13, 110, 253, 0.15);
  padding: 18px;
  min-height: 60px;
  font-size: 1.3rem;
  font-weight: bold;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.category-header:hover {
  background-color: rgba(13, 110, 253, 0.3);
}

.category-header > span {
  flex: 1;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Dropdown Button for Collapsible Categories */
.toggle-category {
  background-color: rgba(13, 110, 253, 1);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 100px;
  min-height: 40px;
  transition: background-color 0.2s ease;
}

.toggle-category:hover {
  background-color: rgba(13, 110, 253, 0.8);
}

.toggle-category .toggle-line {
  display: block;
}

/* Checkbox and Radio Button Styling */
.product-item input[type="checkbox"],
.product-item input[type="radio"] {
  width: 28px;
  height: 28px;
  margin-right: 15px;
}

/* Product Item Styling */
.product-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 18px;
  margin-bottom: 15px;
  border-radius: 8px;
  font-size: 1.2rem;
  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
}

/* Info bubble styling for the basement product */
.info-container {
  display: inline-block;
  position: relative;
  margin-left: 5px;
}

.info-icon {
  display: inline-block;
  width: 40px; /* your chosen display size */
  height: 40px;
  margin-left: 5px; /* keeps the same spacing */
  background: none; /* no gray behind the transparent image */
  cursor: pointer;
  vertical-align: middle;
}

/* Popover styling */
.popover-content {
  display: none;
  position: absolute;
  top: 25px; /* Position below the info icon */
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 4px;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  width: 200px; /* Suitable width for mobile screens */
  z-index: 100;
}

.popover-content.visible {
  display: block;
}

/* New Rules for Service Fee and Additional Service */
.service-fee,
.additional-service {
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 1.1rem;
  width: 100%;
  text-align: center;
}

/* Larger Quantity Dropdown */
.product-quantity {
  width: 120px;
  height: 45px;
  font-size: 18px;
  color: #ffffff;
  margin-left: 12px;
  padding: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background: rgba(13, 110, 253, 1);
}

/* Checkout (Order Summary) Container with Fixed Height (60px) */
#ck-out-div {
  flex: 0 0 60px;
  width: 100%;
  max-width: 720px;
  margin: 5px auto;
}

/* Order Summary Section Styling */
#order-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  min-height: 60px;
  gap: 10px;
  flex-wrap: nowrap;
  z-index: 1000;
}

/* Total Amount Display */
#order-total {
  margin-right: 20px;
  font-size: 1.6rem;
  font-weight: bold;
  color: green;
  text-align: end;
}

/* Checkout Button Styling */
#checkout-button {
  font-size: 1.4rem;
  padding: 14px;
  width: auto;
  min-width: 120px;
  max-width: 200px;
  background: #28a745;
  color: white;
  border-radius: 8px;
  text-align: center;
  border: none;
  cursor: pointer;
  margin-left: 20px;
  flex-shrink: 0;
}

#checkout-button:hover {
  background: #0056b3;
}

.top-bar,
.navbar.custom-navbar {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
}

.top-bar img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.top-bar {
  height: 60px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background-color: rgba(13, 110, 253, 1);
  max-width: 720px;
  margin: 0 auto;
}

.top-bar img {
  max-height: 50px;
  width: auto;
  object-fit: contain;
}

body {
  padding-top: 0 !important;
}

body > * {
  margin-top: 0;
}

.top-bar .container-fluid {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.mx-0 {
  margin-top: 0 !important;
}

/* Mobile Optimization */
@media (max-width: 768px) {
  body {
    font-size: 18px;
    padding: 10px;
  }
  header,
  main,
  #order-summary {
    max-width: 95vw;
  }
  #order-summary {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
  }
  #checkout-button,
  #order-total {
    order: 0;
  }
  #checkout-button {
    width: auto;
  }
  #ck-out-div {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95vw;
    max-width: 720px;
    margin: 0;
    z-index: 1000;
  }
  #content-container {
    padding-bottom: 70px;
  }

  .navbar {
    height: 60px;
    z-index: 1039 !important;
  }

  .navbar.custom-navbar {
    display: block;
  }
}

/* ORIGINAL STYLE SHEET----------------------------------*/

/* General Reset for body */
body {
  padding-top: 0 !important;
}

/* Top Bar Styles */
.top-bar {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  background-color: rgba(13, 110, 253, 1);
}

.top-bar img {
  flex: 1 2 auto;
  width: 100%;
  max-width: 415px;
  height: auto;
  padding-left: 0;
  margin: 0 auto;
}

.top-bar .btn {
  flex: 0 2 auto;
  flex-shrink: 1;
  white-space: nowrap;
  color: #ffffff;
  background-color: green;
  border-color: white;
  margin: 0 auto;
  padding-left: 1;
}

/* Navbar Styles */
.navbar.custom-navbar {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  background-color: rgba(13, 110, 253, 1);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  padding: 05px 05px;
}

.navbar-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex-direction: row !important;
  justify-content: space-evenly;
  gap: 15px;
}

.navbar-nav .nav-link {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 10px 15px;
  color: white;
  transition: color 0.3s ease-in-out;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
  color: #ffcc00;
}

/* Dropdown Divider */
.dropdown-divider {
  border-top-width: 2px;
  border-top-color: #0d6efd;
}

/* Dropdown Menu Styles */
.dropdown-item {
  font-size: 1rem;
  font-weight: 700;
}

.dropdown-menu {
  max-height: 350px;
  overflow-y: scroll;
  background-color: rgba(13, 110, 253, 1);
}

/* Menu Button */
#menuButton {
  color: white;
  font-size: 1rem;
  font-weight: bold;
  background-color: transparent;
  border: none;
  transition: background-color 0.3s ease-in-out;
}

#menuButton:focus {
  outline: none;
  box-shadow: none;
}

/* Offcanvas Styles */
.offcanvas {
  background-color: #f8f8fa;
}

.offcanvas-header {
  border-bottom: 1px solid #ddd;
}

.offcanvas-body .navbar-nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: start !important;
  width: 75%;
}

.offcanvas-body .nav-item {
  margin: 5px 0;
}

.offcanvas-body .nav-link {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  padding: 10px;
  transition: background-color 0.3s ease-in-out;
}

.offcanvas-body .nav-link:hover {
  background-color: #e9ecef;
}

/* ORIGINAL FOOTER STYLES-------------------*/

/* Bootstrap Footer Constrain to 720px */
.bd-footer {
  max-width: 720px;
  margin: 0 auto;
}

/* General Bootstrap Button Style in Footer */
.btn {
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn:hover {
  background: #0056b3;
}

/* Container Style */
.container {
  max-width: 720px;
  margin: auto;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Footer Logo Style */
.footer-logo {
  width: 40px;
  height: 40px;
  padding: 0 !important;
  display: block;
  object-fit: contain;
  aspect-ratio: 1 / 1;
}
@media (max-width: 768px) {
  .category-header > span wbr::after {
    content: "\A"; /* line break */
    white-space: pre;
  }
}
