/* ==========================================================================
   BARAZA RESTAURANT & CAFE
   Online Ordering Styles — index2.html  (style2.css)

   Load order: style.css → style1.css → style2.css
   Colors, fonts, borders and radius variables are defined in style.css.
   ========================================================================== */


/* 1. MENU LAYOUT — space so the floating cart button doesn't cover items */
.menu-content {
  padding-bottom: 110px;
}


/* 2. MENU ITEM LAYOUT */
.menu-item {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
}

.menu-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 14px;
}

.menu-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}


/* 3. MENU CHOICE DROPDOWNS (Fried/BBQ, protein, sides) */
.side-select {
  flex: 1 1 170px;
  min-width: 0;
  max-width: 260px;

  min-height: 38px;
  padding: 7px 10px;

  border: 1.5px solid var(--line);
  border-radius: 999px;

  background: var(--cream);
  color: var(--ink);

  font-family: var(--font-body);
  font-size: 13px;

  cursor: pointer;
}

.side-select:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.side-select.needs-side {
  border-color: var(--red);
  background: #fdecec;
  animation: nudge 0.35s ease;
}

@keyframes nudge {
  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}


/* 4. ADD TO CART BUTTON */
.add-cart-btn {
  flex-shrink: 0;

  min-height: 38px;
  padding: 7px 16px;

  border: 1.5px solid var(--red);
  border-radius: 999px;

  background: transparent;
  color: var(--red);

  font-size: 13px;
  font-weight: 600;

  cursor: pointer;
  white-space: nowrap;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.add-cart-btn:hover {
  background: var(--red);
  color: var(--paper);
}

.add-cart-btn:active {
  transform: scale(0.96);
}

.add-cart-btn.added {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--red-dark);
}


/* 5. FLOATING CART BUTTON */
.cart-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;

  display: flex;
  align-items: center;
  gap: 8px;

  padding: 13px 20px;

  border: 0;
  border-radius: 999px;

  background: var(--red);
  color: var(--paper);

  font-size: 15px;
  font-weight: 600;

  cursor: pointer;

  box-shadow: 0 10px 24px rgba(63, 15, 15, 0.4);

  transition: transform 0.15s ease;
}

.cart-fab:hover {
  transform: translateY(-2px);
}

.cart-fab-count {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 22px;
  height: 22px;
  padding: 0 6px;

  border-radius: 999px;

  background: var(--gold);
  color: var(--red-dark);

  font-size: 12.5px;
  font-weight: 700;
}


/* 6. CART OVERLAY */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;

  background: rgba(43, 10, 16, 0.55);

  opacity: 0;
  transition: opacity 0.25s ease;
}

.cart-overlay.visible {
  opacity: 1;
}

body.cart-open {
  overflow: hidden;
}


/* 7. CART DRAWER (mobile: slides up from the bottom) */
.cart-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;

  display: flex;
  flex-direction: column;

  max-height: 92vh;
  max-height: 92dvh;

  background: var(--paper);

  border-radius: 20px 20px 0 0;

  box-shadow: 0 -8px 30px rgba(63, 15, 15, 0.3);

  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.cart-drawer.open {
  transform: translateY(0);
}


/* 8. CART HEADER */
.cart-drawer-header {
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px 18px 12px;

  border-bottom: 1px solid var(--line);
}

.cart-drawer-header h2 {
  margin: 0;

  color: var(--red);
  font-size: 1.2rem;
}

.cart-close-btn {
  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 50%;

  background: rgba(63, 15, 15, 0.08);
  color: var(--red-dark);

  font-size: 16px;
  cursor: pointer;
}


/* 9. CART BODY AND ITEM LIST */
.cart-body {
  flex: 1 1 auto;
  min-height: 0;

  overflow-y: auto;
  overscroll-behavior: contain;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 12px 18px;
}


/* 10. INDIVIDUAL CART ITEM */
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 12px 14px;

  background: var(--cream);

  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.cart-item-info {
  flex: 1 1 auto;
  min-width: 0;
}

.cart-item-name {
  margin: 0;

  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;

  overflow-wrap: anywhere;
}

.cart-item-unit-price {
  margin: 3px 0 0;

  color: var(--ink-soft);
  font-size: 12px;
}

.cart-item-controls {
  flex: 0 0 auto;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}


/* 11. QUANTITY CONTROLS */
.cart-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;
  flex: 0 0 30px;

  border: 1.5px solid var(--red);
  border-radius: 50%;

  background: var(--paper);
  color: var(--red);

  font-size: 16px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
}

.cart-qty-value {
  min-width: 18px;

  text-align: center;

  font-size: 14px;
  font-weight: 600;
}


/* 12. CART SUBTOTAL AND REMOVE BUTTON */
.cart-item-subtotal {
  margin: 0;

  color: var(--red);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;

  white-space: nowrap;
}

.cart-remove-btn {
  padding: 2px;

  border: 0;
  background: none;

  color: var(--ink-soft);
  font-size: 11.5px;
  text-decoration: underline;

  cursor: pointer;
}


/* 13. EMPTY CART STATE */
.cart-empty {
  padding: 40px 24px 44px;

  color: var(--ink-soft);
  text-align: center;
}

.cart-browse-btn {
  padding: 10px 22px;

  border: 1.5px solid var(--red);
  border-radius: 999px;

  background: transparent;
  color: var(--red);

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}


/* 14. CHECKOUT FOOTER AND ORDER DETAILS */
.cart-footer {
  padding: 6px 18px calc(18px + env(safe-area-inset-bottom));
}

.order-details-box {
  position: relative;

  margin-bottom: 14px;
  padding: 16px 16px 14px;

  background: var(--cream);

  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
}

.order-details-box::before {
  content: "";

  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;

  width: 4px;

  background: var(--red);
  border-radius: 0 4px 4px 0;
}


/* 15. ORDER TYPE LABEL */
.order-type-label {
  display: flex;
  align-items: center;
  gap: 8px;

  margin: 0 0 10px;

  color: var(--red-dark);
  font-size: 13px;
  font-weight: 600;
}

.order-type-label-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--gold);
}


/* 16. DELIVERY AND PICKUP BUTTONS */
.order-type-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.order-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;

  min-height: 70px;
  padding: 10px 4px;

  border: 1.5px solid var(--line);
  border-radius: var(--r-md);

  background: var(--paper);
  color: var(--ink-soft);

  font-size: 12px;
  font-weight: 600;
  text-align: center;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.order-type-icon {
  font-size: 19px;
  line-height: 1;
}

.order-type-btn:hover {
  border-color: var(--red);
}

.order-type-btn:active {
  transform: scale(0.96);
}

.order-type-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);

  box-shadow: 0 4px 12px rgba(175, 40, 40, 0.3);
}

.order-type-hint {
  margin: 10px 2px 0;

  color: var(--ink-soft);
  font-size: 11.5px;
  font-style: italic;
}


/* 17. CHECKOUT DIVIDER */
.order-details-divider {
  height: 1px;
  margin: 14px 2px 12px;

  background: var(--line);
}


/* 18. CUSTOMER INPUT FIELDS (name, phone, area, address, notes) */
.cart-customer-fields,
.cart-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-input-label {
  margin-bottom: -4px;

  color: var(--red-dark);
  font-size: 12.5px;
  font-weight: 600;
}

.cart-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;

  border: 1.5px solid var(--line);
  border-radius: var(--r-md);

  background: var(--paper);
  color: var(--ink);

  font-family: var(--font-body);
  font-size: 13.5px;
}

.cart-input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 1px;
}

/* Area dropdown (Town / Upanga / Kariakoo / Other area) */
.cart-select {
  appearance: none;
  -webkit-appearance: none;

  padding-right: 34px;
  cursor: pointer;

  background-image:
    linear-gradient(45deg, transparent 50%, var(--red) 50%),
    linear-gradient(135deg, var(--red) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Optional customer notes */
.cart-textarea {
  min-height: 82px;

  resize: none;
  overflow: hidden;

  line-height: 1.45;
}

.cart-textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.8;
}


/* 19. PRICE SUMMARY (Food Total + Delivery Fee = Total) */
.cart-total-breakdown {
  margin-bottom: 12px;
}

.cart-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 4px 0;

  font-size: 14px;
}

/* Long text such as "TSh 20,000/= + fee" wraps neatly on the right */
.cart-total-line span:last-child {
  text-align: right;
}

.cart-grand-total {
  margin-top: 6px;
  padding-top: 10px;

  border-top: 1px solid var(--line);

  color: var(--red);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}


/* 20. WHATSAPP ORDER BUTTON */
.whatsapp-btn {
  display: block;

  width: 100%;
  min-height: 48px;

  margin-bottom: 8px;
  padding: 14px 16px;

  border: 0;
  border-radius: 999px;

  background: #25D366;
  color: #06210F;

  font-size: 15.5px;
  font-weight: 700;

  cursor: pointer;
}

.whatsapp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.whatsapp-btn:not(:disabled):hover {
  filter: brightness(1.05);
}

.whatsapp-hint {
  margin: 0 0 10px;

  color: var(--ink-soft);

  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
}

.clear-cart-btn {
  display: block;

  width: 100%;
  padding: 6px;

  border: 0;
  background: none;

  color: var(--ink-soft);
  font-size: 12.5px;
  text-decoration: underline;

  cursor: pointer;
}


/* 21. DESKTOP CART MODAL (700px and wider) */
@media (min-width: 700px) {

  .cart-drawer {
    left: 50%;
    right: auto;
    bottom: 50%;

    width: 440px;
    max-width: calc(100vw - 40px);
    max-height: 85vh;

    border-radius: var(--r-lg);

    transform: translate(-50%, 50%) scale(0.96);
    opacity: 0;

    transition:
      transform 0.25s ease,
      opacity 0.25s ease;
  }

  .cart-drawer.open {
    transform: translate(-50%, 50%) scale(1);
    opacity: 1;
  }
}


/* 22. SMALL MOBILE SCREENS (380px and narrower) */
@media (max-width: 380px) {

  .cart-fab {
    padding: 11px 16px;
    font-size: 13.5px;
  }

  .cart-items {
    padding: 10px 14px;
  }

  .cart-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .order-details-box {
    padding: 13px 12px 12px;
  }

  .order-type-btn {
    font-size: 10.5px;
  }
}
