
body {
    display: flex;
    flex-direction: column;
    grid-template-rows: min-content min-content 1fr max-content;
    align-items: center;
}

#cart-button {
    position: fixed;
    right: 1rem;
    bottom: calc(3rem + 1rem);
    height: 4rem;
    width: 4rem;
    background-color: white;
    background-image: url(/cart.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
    border-radius: 50%;
    border: 2px solid black;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    z-index: 15;
}
#cart-button:disabled {
    display: none;
}


nav {
    width: 100%;
}
#top-nav {
    --nav-item-border-width: 2px;
    --nav-item-height: 2rem;
    --nav-item-after-height: calc(var(--nav-item-height) / 1.414);

    background-image: linear-gradient(to right, var(--secondary-color) 50%, var(--secondary-color-dark) 51%);
    border-block: black solid var(--nav-item-border-width);
    position: sticky;
    top: 0px;

    z-index: 10;
}
#nav-bar {
    width: min-content;
    display: flex;
    justify-content: center;
    margin-inline: auto;
    position: relative;
}
.nav-button {
    font-family: Verdana, Geneva, sans-serif;
    border: none;
    background-color: var(--secondary-color);
    color: black;

    position: relative;
    height: var(--nav-item-height);
    padding-inline: calc(1rem + var(--nav-item-height) / 2) 1rem;
}
.nav-button::after
, .nav-button::before 
, #nav-bar::after
{
    position: absolute;
    rotate: 45deg;
    height: var(--nav-item-after-height);
    width: var(--nav-item-after-height);
    content: "";
    background-color: inherit;

    border-style: solid solid none none;
    border-color: black;
    border-width: var(--nav-item-border-width);

    top: calc(((var(--nav-item-height) - var(--nav-item-after-height) - var(--nav-item-border-width)) / 2));
}
.nav-button::after {
    right: calc((var(--nav-item-after-height) / -2) - var(--nav-item-border-width));
    z-index: 2;
}
#nav-bar::after {
    left: calc(var(--nav-item-after-height) / -2);
    background-color: var(--secondary-color);
    z-index: 2;
}
.nav-button::before {
    background: none;
    left: calc(var(--nav-item-after-height) / -2);
    z-index: 1;
}
.nav-button:disabled {
    background-color: var(--secondary-color-dark);
}
.nav-button:enabled:hover {
    background-color: var(--secondary-color-light);
    cursor: pointer;
}
.nav-button-active.nav-button:enabled {
    font-weight: bold;
    text-decoration: underline;
}


main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;

    width: 100%;

    /* overflow: hidden; */

    flex-grow: 1;
    position: relative;
}

#main-content { 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%; 

    flex-grow: 1;
    padding: 1rem;
}
#main-content > section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;

    width: 100%;
    max-width: var(--content-max-width);
    min-height: 100%;
}
#main-content  h1 {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0;

    font-variant-caps: small-caps;
    text-align: center;

    border-block: 2px solid black;
    margin-block-end: 0.6rem;
}
#main-content > section > * {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.5);

    width: 100%;
}

dialog::backdrop {
    background-color: hsla(0, 0%, 0%, 0.25);
}


#android-app-banner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: white;
    border-bottom: 1px solid black;
}
#android-app-banner-close {
    height: 1.25rem;
    width: 1.25rem;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
#android-app-banner-close img {
    height: 100%;
    width: 100%;
}
#android-app-banner-icon {
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}
#android-app-banner-text {
    flex-grow: 1;
    min-width: 0;
}
#android-app-banner-title {
    margin: 0;
    font-weight: bold;
}
#android-app-banner-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: gray;
}
#android-app-banner-open {
    flex-shrink: 0;
    width: max-content;
    padding: 0.4rem 1rem;
    font-size: 1rem;
    border-radius: 0.4rem;
    text-decoration: none;
    text-align: center;
}

.banner {
    /* width: 100%; */
    margin-inline: 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid black;
    background-color:rgb(91, 199, 123);
    text-align: center;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 1rem;
    position: relative;
    overflow: visible;
}
.banner img {
    height: 1rem;
}
.button-banner-close {
    height: 1rem;
    width: 1rem;
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    border: none;
}
.banner-close {
    background-color: white;
}

.btn-quantity-decrease, .btn-quantity-increase {
    height: 1.75rem;
    width: 1.75rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid black;
    background-color: white;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
.btn-quantity-decrease:hover:enabled, .btn-quantity-increase:hover:enabled {
    background-color: var(--secondary-color-light);
}
.btn-quantity-decrease:disabled, .btn-quantity-increase:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.menu-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-block-start: 0.25rem;
}
.menu-item-quantity-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.button-location, .button-time {
    width: 100%;
    text-align: center;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    margin-block-start: 0.5rem;
    border-radius: 0.25rem;
    position: relative;
    padding-inline-start: 4.6rem;
    height: 2.75rem;
    font-size: 1rem;
}
.button-location img, .button-time img {
    height: 2rem;
    position: absolute;
    left: 0.5rem;
    top: 0.25rem;
}
.button-primary.button-time img {
    filter: invert(90%);
}
#order-details-location img, .button-location img {
    transform: scaleX(-1);
}
#order-details-time img, .button-time img {
    margin-inline-start: 0.8rem;
}
#order-details-location-panel {
    transition: height 0.3s ease;
}
#order-details-delivery-selection {
    width: 200%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    transition: transform 0.3s ease, height 0.3s ease;
}
.delivery-selection-sites {
    transform: translateX(-50%)
}
#order-details-location-subcamps {
    border-block-start: solid gray 1px;
}
#order-details-location-sites {
    overflow-y: scroll;
    max-height: 100%;
}
.button-category {
    width: 100%;
    background: none;
    border: none;
    border-block-end: solid gray 1px;
    position: relative;
    font-size: 1.5rem;
    padding-block: 0.3rem;
}
.button-category::after {
    content: ">";
    position: absolute;
    right: 1rem;
}

#order-date-picker {
    padding: 1rem;
}
#order-date-picker > .datepicker {
    margin-inline: auto;
}

#menu {
    display: grid;
    overflow-x: visible;
}
.menu-category {
    width: 100%;
}
.menu-category-title {
    border-block-end: 2px solid gray;
    padding-block: 0rem 0.2rem;
    font-size: 2rem;
    text-align: center;
    margin-block: 0rem 1rem;
}
.menu-category-items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}
@media (min-width: 640px) {
    .menu-category-items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}
.menu-item, .menu-item-details {
    --menu-item-image-size: 5rem;
}
.menu-item * {
    cursor: pointer;
}
.menu-item .menu-item-title, .menu-item-details .menu-item-title,
.menu-item .menu-item-price, .menu-item-details .menu-item-price {
    margin: 0;
}
.menu-item .menu-item-description, .menu-item-details .menu-item-description {
    margin: 0;
}
.menu-item-price {
    color: rgb(75, 75, 75);
    font-weight: bold;
}
.out-of-stock {
    filter: brightness(50%);
}

/* Horizontal card layout used in the menu grid */
.menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    width: 100%;
    border: 1px solid black;
    border-radius: 0.75rem;
}
.menu-item > img {
    flex-shrink: 0;
    width: var(--menu-item-image-size);
    height: var(--menu-item-image-size);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5rem;
}
.menu-item .menu-item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    flex-grow: 1;
    min-width: 0;
    text-align: center;
}
.menu-item .menu-item-description {
    display: none;
}

/* Vertical layout used in the item details overlay */
.menu-item-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-inline: auto;
    padding: 0.5rem;
}
.menu-item-details > img {
    max-width: 15rem;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.5rem;
}
.menu-item-details .menu-item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}
.menu-item-details .menu-item-description {
    display: block;
    text-wrap: balance;
}


.overlay-panel {
    background: none;
    border: none;
    width: 100%;
}
.overlay-element {
    background-color: white;
    border: black solid 2px;
    border-radius: 0.5rem;
    min-width: 15rem;
    margin: auto;
    padding: 0.5rem; 
    position: relative;
    max-width: var(--content-max-width);
    text-align: center;
}

#bill {
    margin-block-end: 1rem;
}

/* Off-canvas cart panel: rolls up from the bottom of the screen when the
   floating cart button is pressed, slides back down when closed */
#cart-contents-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;

    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}
#cart-contents-panel.cart-panel-open {
    transform: translateY(0);
}
#cart-contents-panel.cart-panel-dragging {
    transition: none;
}
#cart-contents-panel .overlay-element {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: none;
}

#cart-drag-handle {
    position: relative;
    width: 100%;
    padding: 0.6rem 0;
    margin-block-end: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    cursor: grab;
}
#cart-drag-handle::before {
    content: "";
    width: 3rem;
    height: 0.3rem;
    border-radius: 999px;
    background-color: lightgrey;
}

#cart-close-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 1.75rem;
    width: 1.75rem;
    border: none;
    border-radius: 50%;
    background: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
#cart-close-button:hover {
    background-color: lightgrey;
}

#cart-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 25;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
#cart-panel-overlay.cart-panel-overlay-visible {
    opacity: 1;
    pointer-events: auto;
}

#cart-contents-window {
    text-align: start;
}
#cart-contents-header {
    display: flex;
    grid-template-columns: 2rem 1fr 2rem;
    align-items: center;
    justify-content: stretch;
    width: 100%;
    gap: 0.5rem;
    border-block-end: black solid 1px;
}
#cart-contents-header > h2 {
    margin: 0;
    flex-grow: 1;
}
#cart-contents-footer {
    width: min-content;
    min-width: 100%;
    border-block-start: black solid 1px;
    display: grid;
    grid-template-columns: 1fr min-content;
    grid-template-rows: 1fr 1fr 2fr;
}
#cart-contents-footer > :has(span) {
    text-align: right;
}
#cart-contents-footer > * {
    margin: 0;
}
#cart-contents-shipping-note {
    grid-column: 1 / 3;
    color: firebrick;
    font-style: italic;
    margin-inline-start: 1rem;
}
#cart-coupon-notice {
    grid-column: 1 / 3;
    color: darkgreen;
    background-color: #e6f4ea;
    border: 1px solid #b7dfc0;
    border-radius: 0.3rem;
    padding: 0.4rem 0.6rem;
    margin-block: 0.4rem;
    font-size: 0.9rem;
}
.cart-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    border-block-end: black dotted 1px;
    padding: 0.5rem;
    height: 4rem;
}
.cart-item > img {
    max-height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.3rem;
    flex-shrink: 0;
}
.cart-item-name {
    flex-grow: 1;
    text-align: left;
    margin: 0;
}
.cart-item-quantity {
    margin: 0;
    color: rgb(75, 75, 75);
    white-space: nowrap;
}
.cart-item-line-total {
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
    min-width: 3.5rem;
    text-align: right;
}
.btn-delete-from-cart {
    height: 1.5rem;
    width: 1.5rem;
    flex-shrink: 0;
    filter: var(--primary-color-filter);
    cursor: pointer;
}
.overlay-panel-close-button {
    text-align: center;
    position: absolute;
    right: -0.35rem;
    top: -0.35rem;
    z-index: 1;
    border: none;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
}
.overlay-panel-close-button:hover {
    background-color: lightgrey;
    cursor: pointer;
}


#details {
    gap: 1rem;
    height: 100%;
}
#order-details-form {
    width: 100%;
}

#cart-coupon-stub {
    margin-block-start: 1rem;
    --ticket-frame: var(--primary-color-dark);
    --ticket-bg: var(--secondary-color-light);
    --ticket-button-bg: var(--secondary-color);
    --ticket-button-bg-hover: var(--secondary-color-dark);
    /* Zigzag left/right edges: 5 inward-pointing teeth per side, cut a
       fixed 8px deep so they stay proportional regardless of box width. */
    --ticket-clip: polygon(
        0% 0%, 8px 10%, 0% 20%, 8px 30%, 0% 40%, 8px 50%, 0% 60%, 8px 70%, 0% 80%, 8px 90%, 0% 100%,
        100% 100%, calc(100% - 8px) 90%, 100% 80%, calc(100% - 8px) 70%, 100% 60%, calc(100% - 8px) 50%, 100% 40%, calc(100% - 8px) 30%, 100% 20%, calc(100% - 8px) 10%, 100% 0%
    );
}
#coupon-ticket {
    clip-path: var(--ticket-clip);
    background-color: var(--ticket-frame);
    padding: 3px;
}
#coupon-form {
    display: flex;
    position: relative;
    clip-path: var(--ticket-clip);
    background-color: var(--ticket-bg);
}
#ipt-couponCode {
    flex-grow: 1;
    min-width: 0;
    border: none;
    background: none;
    padding: 0.6rem 1rem;
    font-size: 1.1rem;
    font-family: inherit;
    font-variant-caps: small-caps;
    color: var(--primary-color-dark);
    outline: none;
}
#ipt-couponCode::placeholder {
    color: var(--primary-color);
}
#btn-apply-coupon {
    flex-shrink: 0;
    width: 3rem;
    position: relative;
    border: none;
    border-inline-start: 2px dashed var(--ticket-frame);
    background-color: var(--ticket-button-bg);
    color: var(--ticket-frame);
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}
#btn-apply-coupon:hover {
    background-color: var(--ticket-button-bg-hover);
}
#btn-apply-coupon::before,
#btn-apply-coupon::after {
    content: "";
    position: absolute;
    left: -0.55rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background-color: white;
}
#btn-apply-coupon::before {
    top: -0.55rem;
}
#btn-apply-coupon::after {
    bottom: -0.55rem;
}
#coupon-form-error {
    color: red;
    font-size: 0.9rem;
    margin: 0.4rem 0 0;
}
#paypal-buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#btn-submit-free-order {
    width: 100%;
    font-size: 1.5rem;
    font-variant-caps: small-caps;
    border-radius: 0.2rem;
}
#paypal-result-message:empty {
    display: none;
}
