.bagButton {
  position: relative;
  width: 20pt;
  height: 20pt;
  cursor: pointer;
}

.badge {
  position: absolute;
  bottom: 1pt;
  right: 1pt;
  background-color: #0A0A0A;
  color: white;
  font-size: 7pt;
  height: 12pt;
  min-width: 12pt;
  border-radius: 6pt;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 0 2pt;
  padding-top: 1.2pt;
  line-height: 1;
  box-sizing: border-box;
  scale: 1;
  opacity: 1;
  transition: opacity 0.3s, scale 0.3s;
}

.badge-hidden {
    position: absolute;
    bottom: 1pt;
    right: 1pt;
    background-color: #0A0A0A;
    color: white;
    font-size: 7pt;
    height: 12pt;
    min-width: 12pt;
    border-radius: 6pt;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    padding: 0 2pt;
    padding-top: 1.2pt;
    line-height: 1;
    box-sizing: border-box;
    scale: 0;
    opacity: 0;
    transition: opacity 0.3s ease, scale 0.3s ease;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.bagPanel {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 40vw;
    max-width: 100vw;
    background-color: #fff;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.bagPanel.open {
    right: 0;
}

.closeBagButton {
    align-self: flex-end;
    font-size: 2rem;
    background: none;
    border: none;
    margin: 1rem;
    cursor: pointer;
}

/* Full screen on mobile */
@media (max-width: 768px) {
    .bagPanel {
        width: 100vw;
        padding-bottom: 2rem;
    }
    
    /* Ensure order button is easily accessible on mobile */
    .bagPanel > div > div:last-child {
        padding-bottom: 3rem;
        margin-bottom: 1rem;
    }
    
    /* Adjust scrollable content height on mobile */
    .bagPanel div[style*="height: 75vh"] {
        height: 65vh !important;
        padding-bottom: 1rem !important;
    }
}

#bagHeader {
    display: flex;
    justify-content: space-between;
    align-items: top;
    padding: 1rem;
    position: relative;
}

.right-aligned {
    text-align: right;
}

a {
    color: var(--primaryFontColor);        /* pick any link color you like */
    text-decoration: underline; /* hide underline by default */
    transition: text-decoration-color 0.2s ease;
    cursor: pointer;
}

/* Show underline on hover and when focused via keyboard */
a:hover,
a:focus-visible {
    text-decoration: underline;
    /* Optional extras for a crisper underline */
    text-decoration-thickness: 1.5px; /* bolder line */
    /* text-underline-offset: 0.15em; slight gap below text */
}

#bagOverlay {
    width: 100%;
    height: 100%;
    z-index: 9;
    background: white;
    position: absolute;
}

#bagMessageOverlay {
    width: 100%;
    height: 100%;
    z-index: 10;
    background: white;
    align-content: center;
}

.bagMessageOverlayContent {
    margin: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

/* Order button styling */
#orderButton {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* Prevent horizontal overflow in bag content */
#bagContent {
    overflow-x: hidden;
    width: 100%;
}

#bagContent table {
    width: 100%;
    max-width: 100%;
}

/* Order button styling */
.order-button {
    width: 80%;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: 1rem;
}

/* Logout button styling */
.logout-button {
    width: 80%;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    margin-top: 1rem;
    background-color: transparent;
    color: var(--secondaryFontColor);
    border: 1px solid var(--lightBorderColor);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background-color: var(--grayBackgroundColor);
}

/* Logout success message */
.logout-success {
    text-align: center;
    padding: 2rem;
}

.logout-success h3 {
    margin-bottom: 1rem;
    color: var(--primaryFontColor);
}

.logout-success p {
    color: var(--secondaryFontColor);
    margin-bottom: 1.5rem;
}

/* Checkout container styling */
.checkout-content {
    margin: 2rem;
    overflow-y: scroll;
    height: 75vh;
}
