/* ==========================================================================
   XENTRA HOME PAGE
   Pixel-perfect match with production app.mybangjo.com home page
   Uses tokens from tokens.css — no hardcoded colors
   ========================================================================== */


/* ── Hero Header ── */
.x-hero-header {
  background: var(--x-lime);
  padding: calc(14px + var(--x-safe-top)) var(--x-page-pad) 65px;
  position: relative;
  transition: background-color 0.3s ease;
}

.x-hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ── Location Pill Button (Left in Header) ── */
.x-hero-loc-pill {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background: var(--x-white) !important;
  color: #1e293b !important;
  font-family: var(--x-font) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  height: 36px;
  padding: 0 13px !important;
  border-radius: 20px !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: var(--x-shadow-hero) !important;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 90px;
  max-width: 175px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
}

.x-hero-loc-pill:active {
  transform: scale(0.97);
}

.x-hero-loc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.x-hero-loc-icon img,
.x-hero-loc-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.x-hero-loc-text {
  font-size: 13px;
  font-weight: 800;
  color: #1e1e1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-align: left;
}

/* ── Hero Right Actions ── */
.x-hero-btn-join {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background: var(--x-white) !important;
  color: #0f172a !important;
  font-family: var(--x-font) !important;
  font-weight: 800;
  font-size: 13px;
  height: 36px;
  padding: 0 15px !important;
  border-radius: 20px !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: var(--x-shadow-hero) !important;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  box-sizing: border-box;
}

.x-hero-btn-join:active {
  transform: scale(0.97);
}

.x-hero-action-icons {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.x-hero-icon-btn {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  background: var(--x-white) !important;
  border: 0 !important;
  outline: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  box-shadow: var(--x-shadow-hero) !important;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  transition: transform 0.15s ease;
  box-sizing: border-box;
}

.x-hero-icon-btn:active {
  transform: scale(0.95);
}

.x-hero-icon-btn img,
.x-hero-icon-btn svg {
  display: block;
}

/* Specific icon sizing to balance visually against 36px circle */
.x-hero-icon-btn-library img,
.x-hero-icon-btn-library svg {
  width: 17px;
  height: 17px;
}

.x-hero-icon-btn-profile img,
.x-hero-icon-btn-profile svg {
  width: 22px;
  height: 22px;
}

.x-hero-clock-wrap {
  text-align: center;
  margin-top: 14px;
}

.x-hero-time {
  font-size: 52px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -1.5px;
  line-height: 1;
}

.x-hero-date {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 6px;
}


/* ── Carousel Banner ── */
.x-carousel-container {
  position: relative;
  margin: -50px var(--x-page-pad) var(--x-page-pad);
  z-index: 20;
}

.x-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
  scrollbar-width: none;
}

.x-carousel-track::-webkit-scrollbar {
  display: none;
}

.x-carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.x-carousel-slide img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
}

.x-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.x-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--x-gray-200);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.x-carousel-dot.active {
  width: 20px;
  border-radius: 3px;
  background: var(--x-charcoal);
}


/* ── Category Navigation ── */
.x-cat-wrap {
  width: 100%;
  overflow: hidden;
}

.x-cat-track {
  display: flex;
  align-items: flex-start !important;
  gap: 18px;
  overflow-x: auto;
  padding: 4px var(--x-page-pad) 10px;
  scrollbar-width: none;
}

.x-cat-track::-webkit-scrollbar {
  display: none;
}

.x-cat {
  flex: 0 0 92px;
  width: 92px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  vertical-align: top;
  align-self: flex-start;
}

.x-cat-image {
  width: 92px;
  height: 92px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--x-radius-sm);
  background: var(--x-gray-bg);
  flex-shrink: 0;
  margin: 0 0 8px;
}

.x-cat-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--x-radius-sm);
}

.x-cat-image-mono {
  font-size: 26px;
  font-weight: 700;
  color: var(--x-gray-400);
}

.x-cat-name {
  color: var(--x-charcoal) !important;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  width: 100%;
  word-break: break-word;
}

.x-cat.active .x-cat-name {
  color: var(--x-charcoal) !important;
  font-weight: 700;
}

.x-cat-line {
  display: block;
  width: 0;
  height: 3px;
  margin: 6px auto 0;
  background: var(--x-lime);
  border-radius: 3px;
  transition: width 0.2s ease;
  flex-shrink: 0;
}

.x-cat.active .x-cat-line {
  width: 82px;
}


/* ── Products List ── */
.x-products {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px var(--x-page-pad) calc(84px + var(--x-safe-bottom, 12px));
}

.x-loading,
.x-error,
.x-empty {
  padding: 35px 10px;
  text-align: center;
  color: var(--x-text-muted);
}


/* ── Product Card ── */
.x-product {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px;
  gap: 12px;
  padding: 14px;
  background: var(--x-white);
  border-radius: var(--x-radius-lg);
  box-shadow: var(--x-shadow-md);
}

.x-product-info {
  min-width: 0;
}

.x-product-name {
  font-size: 16px;
  line-height: 21px;
  font-weight: 700;
}

.x-product-description {
  margin-top: 3px;
  color: var(--x-text-muted);
  font-size: 14px;
  line-height: 18px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.x-price {
  margin-top: 13px;
}

.x-old-price {
  color: var(--x-gray-400);
  font-size: 13px;
  text-decoration: line-through;
}

.x-current-price {
  font-size: 17px;
  margin-top: 1px;
  font-weight: 700;
}


/* ── Product Right Column ── */
.x-product-right {
  width: 105px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.x-product-image {
  width: 105px !important;
  height: 105px !important;
  object-fit: contain !important;
  border-radius: 15px !important;
  display: block;
  background: var(--x-gray-bg);
  overflow: hidden;
}


/* ── Add Button ── */
.x-add {
  width: 100%;
  height: 34px;
  margin-top: 7px;
  border: 0;
  border-radius: var(--x-radius-xl);
  background: var(--x-lime);
  color: var(--x-black);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}


/* ── Quantity Stepper ── */
.x-quantity {
  width: 100%;
  height: 34px;
  margin-top: 7px;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  background: var(--x-lime);
  border-radius: var(--x-radius-lg);
}

.x-quantity button {
  width: 28px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.x-quantity button img {
  width: 13px;
  height: 13px;
}

.x-quantity-value {
  text-align: center;
  font-size: 14px;
  line-height: 30px;
  font-weight: 700;
}


/* ── Note Button ── */
.x-note-button {
  width: 100%;
  height: 34px;
  margin-top: 7px;
  border: 1px solid #ddd;
  border-radius: var(--x-radius-lg);
  background: var(--x-white);
  color: var(--x-gray-700);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
}

.x-note-button .x-note-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  object-fit: contain;
  display: block;
}

.x-note-button.has-note {
  border-color: var(--x-lime);
  background: var(--x-lime-bg);
}

.x-product-discount {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--x-danger);
  font-size: 12px;
  font-weight: 600;
}

.x-product-discount-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}


/* ── Cart Dock (Floating Bottom Bar) ──
   position:fixed escapes the page box; constrain it to the app-shell width so
   the dock never spans a wider desktop viewport (mobile: shell == viewport). */
.x-cart-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--x-page-max);
  margin: 0 auto;
  z-index: var(--x-z-dock);
  transform: translateY(110%);
  transition: transform var(--x-duration-sheet) var(--x-ease-sheet);
  pointer-events: none;
}

.x-cart-dock.visible {
  transform: translateY(0);
  pointer-events: auto;
}


/* ── Promo Bar ── */
.x-promo {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #F4F4F4;
}

.x-promo-body {
  flex: 1;
}

#x-promo-text {
  font-size: 12px;
  line-height: 17px;
  margin-bottom: 5px;
}

.x-progress {
  width: 100%;
  height: 4px;
  background: #d8d8d8;
}

#x-progress-fill {
  width: 0;
  height: 100%;
  background: var(--x-danger);
  transition: width 0.3s ease;
}

.x-promo-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--x-promo-yellow);
}

.x-promo-icon-img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  display: block;
}


/* ── Bottom Cart Bar ── */
.x-bottom-cart {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px var(--x-page-pad) calc(8px + var(--x-safe-bottom));
  background: var(--x-white);
  box-shadow: var(--x-shadow-dock);
}

.x-cart-checkout-link {
  flex: 1 1 auto;
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 32px;
  background: var(--x-lime);
  color: var(--x-charcoal) !important;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}

.x-cart-summary {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.x-cart-summary strong {
  font-size: 14px;
  line-height: 20px;
  font-weight: 700;
}

.x-cart-summary span {
  margin-top: -2px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#x-cart-total {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 30px;
  font-weight: bold;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

#x-cart-button {
  position: relative;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--x-radius-lg);
  background: var(--x-white);
  box-shadow: var(--x-shadow-btn);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#x-cart-button:active {
  transform: scale(0.97);
}

.x-cart-icon {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
}

@media (max-width: 390px) {
  .x-bottom-cart {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .x-cart-checkout-link {
    gap: 8px;
    padding-left: 16px;
    padding-right: 14px;
  }

  #x-cart-button {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    border-radius: 17px;
  }

  .x-cart-icon {
    width: 34px;
    height: 34px;
  }
}

#x-cart-badge {
  position: absolute;
  top: -5px;
  right: -3px;
  width: 23px;
  height: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--x-danger);
  color: white;
  font-size: 12px;
}


/* ── Cart Sheet Heading ── */
.x-sheet-content h2,
.x-sheet-title {
  font-size: 15px !important;
  line-height: 20px !important;
  font-weight: 700 !important;
  color: var(--x-charcoal, #222) !important;
  margin: 0 0 12px !important;
}

/* ── Cart Sheet Items ── */
.x-sheet-item {
  width: 100%;
  padding: 14px 14px 10px;
  margin: 0 0 12px;
  background: var(--x-white);
  border: 1px solid var(--x-gray-100);
  border-radius: var(--x-radius-md);
  box-shadow: var(--x-shadow-lg);
}

.x-sheet-item-main {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 24px;
  column-gap: 12px;
  align-items: start;
}

.x-sheet-item-image {
  width: 68px;
  height: 68px;
  border-radius: var(--x-radius-sm) !important;
  object-fit: cover !important;
  display: block;
  background: var(--x-gray-bg);
  overflow: hidden;
}

.x-sheet-item-image img {
  border-radius: var(--x-radius-sm);
}

.x-sheet-item-body {
  min-width: 0;
}

.x-sheet-item-name {
  margin: 1px 0 2px;
  font-size: 15px;
  line-height: 19px;
  font-weight: 700;
  color: var(--x-charcoal);
}

.x-sheet-item-qty-price {
  margin-top: 4px;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  color: var(--x-charcoal);
}

.x-sheet-item-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: var(--x-gray-400);
  font-size: 12px;
  line-height: 16px;
  margin-top: 1px;
  cursor: pointer;
}

.x-sheet-item-note img {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  flex: 0 0 auto;
  object-fit: contain;
  display: block;
}

.x-sheet-item-discount {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--x-danger);
  font-size: 11px;
  line-height: 15px;
}

.x-sheet-item-discount img {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  object-fit: contain;
  display: block;
}

.x-sheet-item-delete {
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.x-sheet-item-delete img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.x-sheet-item-footer {
  width: 100%;
  min-height: 32px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--x-gray-150);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.x-sheet-item-footer:active {
  opacity: 0.65;
  transform: scale(0.99);
}

.x-sheet-item-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.x-sheet-item-footer img.x-bike-icon {
  width: 20px;
  height: 20px;
}

.x-sheet-item-footer-left span {
  font-size: 13px;
  line-height: 18px;
  color: var(--x-gray-800);
  font-weight: 600;
  white-space: nowrap;
}

.x-sheet-item-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.x-sheet-item-footer-right strong {
  font-size: 14px;
  line-height: 18px;
  color: var(--x-gray-800);
  font-weight: 700;
}

.x-sheet-item-footer-right img.x-arrow-icon {
  width: 14px;
  height: 14px;
}


/* ── Cart Sheet Summary ── */
.x-sheet-total {
  margin-top: 2px;
  padding: 8px 0 12px;
}

.x-sheet-summary-title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  margin: 0 0 10px;
}

.x-sheet-summary-card {
  width: 100%;
  background: var(--x-white);
  border-radius: var(--x-radius-md);
  box-shadow: var(--x-shadow-lg);
  padding: 14px;
}

.x-sheet-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 18px;
}

.x-sheet-summary-row .label {
  color: var(--x-gray-400);
  font-weight: 500;
}

.x-sheet-summary-row .value {
  color: var(--x-gray-400);
  font-weight: 500;
  white-space: nowrap;
}

.x-sheet-summary-row.discount .label,
.x-sheet-summary-row.discount .value {
  color: var(--x-danger);
}

.x-sheet-summary-divider {
  height: 1px;
  background: var(--x-gray-150);
  margin: 10px 0;
}

.x-sheet-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.x-sheet-summary-total .label {
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  color: var(--x-gray-800);
}

.x-sheet-summary-total .value {
  font-size: 18px;
  line-height: 22px;
  font-weight: 700;
  color: var(--x-charcoal);
  white-space: nowrap;
}

.x-sheet-summary-total .old {
  margin-right: 7px;
  color: var(--x-gray-400);
  text-decoration: line-through;
  font-size: 14px;
  font-weight: 500;
}

.x-sheet-checkout {
  position: sticky;
  bottom: 0;
  z-index: 2;
  width: 100%;
  height: 52px;
  margin-top: 10px;
  border: 0;
  border-radius: 26px;
  background: var(--x-lime);
  color: var(--x-black);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}


/* ── Cart Sheet: Multi-Branch Sections ── */
.x-sheet-group-divider {
  height: 1px;
  background: var(--x-gray-150);
  margin: 14px 0;
}

.x-sheet-branch {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 2px 10px;
}

.x-sheet-branch-name {
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
  color: var(--x-charcoal);
}

.x-sheet-branch-count {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--x-gray-400);
  white-space: nowrap;
}

/* ── Cart Sheet: Multi-Branch Bottom CTA ──
   "N Pesanan · dari N cabang" + aggregate total. Opens the Branch Order
   Switcher — never a merged multi-branch checkout. */
.x-sheet-multi-cta {
  position: sticky;
  bottom: 0;
  z-index: 2;
  width: 100%;
  min-height: 64px;
  margin-top: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: 26px;
  background: var(--x-lime);
  color: var(--x-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.x-sheet-multi-cta:active {
  opacity: 0.85;
}

.x-sheet-multi-cta-left {
  min-width: 0;
}

.x-sheet-multi-cta-left strong {
  display: block;
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
  color: var(--x-charcoal);
}

.x-sheet-multi-cta-left span {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--x-gray-600);
}

.x-sheet-multi-cta-total {
  font-size: 18px;
  line-height: 22px;
  font-weight: 700;
  color: var(--x-charcoal);
  white-space: nowrap;
}


/* ── Branch Order Switcher (multi-branch gateway) ── */
.x-branch-switcher-sheet {
  max-height: 76vh;
}

.x-branch-switcher-head {
  padding: 2px 18px 14px;
}

.x-branch-switcher-title {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  color: var(--x-charcoal);
  letter-spacing: -0.2px;
}

.x-branch-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 18px max(24px, calc(16px + var(--x-safe-bottom, 0px)));
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.x-branch-switcher-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--x-white);
  border: 1px solid var(--x-gray-100);
  border-radius: var(--x-radius-md);
  box-shadow: var(--x-shadow-md);
}

.x-branch-switcher-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.x-branch-switcher-name {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  color: var(--x-charcoal);
}

.x-branch-switcher-body-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13px;
  color: var(--x-gray-500);
}

.x-branch-switcher-meta {
  font-size: 13px;
  color: var(--x-gray-500);
  font-weight: 500;
}

.x-branch-switcher-total {
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  color: var(--x-charcoal);
}

.x-branch-switcher-action-line {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.x-branch-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--x-radius-pill);
  background: var(--x-lime);
  color: var(--x-charcoal);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.x-branch-switcher-btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}


/* ── Note Sheet ── */
.x-note-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: var(--x-z-overlay) !important;
  display: flex !important;
  align-items: flex-end;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  isolation: isolate;
}

.x-note-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.x-note-sheet {
	position: absolute !important;
	left: 0 !important;
	right: 0 !important;
	bottom: var(--x-note-keyboard, 0px) !important;
	width: 100% !important;
	height: min(75dvh, var(--x-note-visible-height, 75dvh)) !important;
	max-height: none !important;
	margin: 0 !important;
	background: #fff;
	border-radius: 22px 22px 0 0;
	padding: 8px 26px max(12px, env(safe-area-inset-bottom));
	transform: translateY(105%);
	transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
	display: flex !important;
	flex-direction: column;
	overflow: hidden;
	touch-action: pan-y;
	box-sizing: border-box !important;
}

.x-note-overlay.open .x-note-sheet {
	transform: translateY(0);
}

.x-note-handle {
	width: 42px;
	height: 3px;
	margin: 0 auto 20px;
	background: #aeb4c0;
	border-radius: 10px;
	flex: 0 0 auto;
}

.x-note-header {
	padding-bottom: 13px;
	border-bottom: 1px solid #dedede;
	flex: 0 0 auto;
}

.x-note-header h3 {
	margin: 0;
	color: #161616;
	font-size: 16px;
	line-height: 22px;
	font-weight: 700;
}

#x-note-input {
	width: 100%;
	min-height: 0;
	padding: 12px 0;
	border: 0;
	outline: 0;
	resize: none;
	background: transparent;
	color: #333;
	font-family: 'Plus Jakarta Sans', Arial, sans-serif;
	font-size: 14px;
	line-height: 21px;
	flex: 1 1 auto;
	box-sizing: border-box;
}

#x-note-input::placeholder {
	color: #999;
}

.x-note-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 10px;
	border-top: 1px solid #dedede;
	flex: 0 0 auto;
}

#x-note-counter {
	font-size: 12px;
	color: #777;
}

#x-note-save {
	width: 86px;
	height: 34px;
	border: 0;
	border-radius: 18px;
	background: #b6ff00;
	color: #111;
	font-family: 'Plus Jakarta Sans', Arial, sans-serif;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

#x-note-input::placeholder {
  color: var(--x-gray-400);
}

.x-note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--x-gray-150);
  flex: 0 0 auto;
}

#x-note-counter {
  font-size: 12px;
  color: var(--x-gray-500);
}

#x-note-save {
  width: 86px;
  height: 34px;
  border: 0;
  border-radius: var(--x-radius-lg);
  background: var(--x-lime);
  color: var(--x-black);
  font-family: var(--x-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}


/* ── PWA Install Banner ── */
.x-pwa-banner {
  position: fixed;
  top: max(12px, var(--x-safe-top, 12px));
  left: 12px;
  right: 12px;
  max-width: var(--x-page-max);
  margin: 0 auto;
  z-index: var(--x-z-pwa);
  transform: translateY(-130%);
  transition: transform 0.4s var(--x-ease-spring), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}

.x-pwa-banner.x-pwa-banner-show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.x-pwa-banner-card {
  background: var(--x-white);
  border-radius: var(--x-radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--x-shadow-xl), var(--x-shadow-sm);
  border: 1px solid var(--x-gray-75);
}

.x-pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.x-pwa-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--x-radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--x-shadow-sm);
}

.x-pwa-banner-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.x-pwa-banner-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--x-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-pwa-banner-text span {
  font-size: 11px;
  color: var(--x-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.x-pwa-banner-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.x-pwa-btn-install {
  background: var(--x-black);
  color: var(--x-white);
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--x-duration-fast) ease, transform 0.1s ease;
}

.x-pwa-btn-install:active {
  transform: scale(0.96);
  background: var(--x-gray-800);
}

.x-pwa-btn-dismiss {
  background: transparent;
  border: none;
  color: var(--x-gray-400);
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}

.x-pwa-btn-dismiss:active {
  background: var(--x-gray-50);
  color: var(--x-gray-800);
}


/* ── iOS PWA Guide Sheet ── */
.x-pwa-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: hidden;
  transition: visibility 0.3s;
}

.x-pwa-guide-overlay.open {
  visibility: visible;
}

.x-pwa-guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.x-pwa-guide-overlay.open .x-pwa-guide-backdrop {
  opacity: 1;
}

.x-pwa-guide-sheet {
  position: relative;
  background: var(--x-white);
  border-radius: 24px 24px 0 0;
  padding: 16px 20px calc(24px + var(--x-safe-bottom, 16px));
  max-width: var(--x-page-max);
  width: 100%;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.35s var(--x-ease-spring);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}

.x-pwa-guide-overlay.open .x-pwa-guide-sheet {
  transform: translateY(0);
}

.x-pwa-guide-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.x-pwa-guide-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.x-pwa-guide-head h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--x-black);
  margin: 0;
}

.x-pwa-guide-head p {
  font-size: 12px;
  color: var(--x-gray-500);
  margin: 2px 0 0;
}

.x-pwa-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.x-pwa-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--x-gray-25);
  padding: 12px 14px;
  border-radius: var(--x-radius-sm);
}

.x-pwa-step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--x-black);
  color: var(--x-white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.x-pwa-step-body {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.4;
  color: var(--x-gray-800);
}

.x-pwa-step-body strong {
  color: var(--x-black);
  font-weight: 600;
  margin-bottom: 2px;
}

.x-pwa-step-body span {
  color: var(--x-gray-600);
  font-size: 12px;
}

.x-pwa-guide-close-btn {
  width: 100%;
  background: var(--x-black);
  color: var(--x-white);
  border: none;
  border-radius: var(--x-radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--x-duration-fast);
}

.x-pwa-guide-close-btn:active {
  opacity: 0.85;
}

/* ── P2 Fast Branch Discovery ──
   Home discovery is presentation-only: no ETA, no routing, cheap proximity.
   The section is a compact horizontal carousel: the active card only expresses
   "you are browsing this branch's menu", never fulfillment. Home is a discovery
   surface, not a branch directory. */
.x-branch-discovery {
  display: block;
  padding: 14px 0 2px;
}

.x-branch-discovery[hidden] {
  display: none !important;
}

.x-branch-head {
  padding: 0 var(--x-page-pad) 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--x-charcoal);
  margin-bottom: 8px;
}

.x-branch-loc-note {
  padding: 0 var(--x-page-pad) 2px;
  font-size: 12px;
  color: var(--x-gray-500);
  margin-bottom: 8px;
}

.x-branch-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px var(--x-page-pad) 8px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.x-branch-scroll::-webkit-scrollbar {
  display: none;
}

.x-branch-card {
  flex: 0 0 200px;
  display: block;
  text-align: left;
  background: var(--x-white);
  border: 1.5px solid var(--x-border);
  border-radius: var(--x-radius-md);
  padding: 0;
  font-family: var(--x-font);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--x-shadow-sm);
  scroll-snap-align: start;
  transition: border-color var(--x-duration-fast), box-shadow var(--x-duration-fast), transform var(--x-duration-fast);
}

.x-branch-card:active {
  transform: scale(0.98);
}

.x-branch-card.is-active {
  border-color: var(--x-lime-dark);
  box-shadow: var(--x-shadow-md);
}

/* Branch photo: image_url when the contract supplies one, otherwise a
   data-derived initials monogram (never a product/brand image as identity). */
.x-branch-card-photo {
  display: block;
  width: 100%;
  height: 88px;
  background: var(--x-gray-50);
  position: relative;
}

.x-branch-card-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.x-branch-card-photo-mono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--x-gray-400);
  letter-spacing: 1px;
}

.x-branch-card-body {
  display: block;
  padding: 10px 12px 12px;
}

.x-branch-card-name {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--x-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-branch-cats-text {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--x-gray-600);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-branch-promo {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--x-gray-700);
  line-height: 1.4;
}

.x-branch-card-error {
  border-style: dashed;
  cursor: default;
  padding: 14px 16px;
  margin: 0 var(--x-page-pad);
}

.x-branch-empty-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--x-charcoal);
}

.x-branch-empty-sub {
  font-size: 12px;
  color: var(--x-gray-500);
  margin-top: 4px;
}


/* ── P3 Product / Catalog ── */

/* Branch-level availability is displayed ONLY from the server-provided
   is_available flag present on branch-scoped menus (never client-derived). */
.x-product-unavailable {
  opacity: 0.55;
}

.x-product-unavailable .x-product-name {
  color: var(--x-gray-500);
}

.x-unavailable-tag {
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--x-gray-bg);
  color: var(--x-gray-500);
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  display: inline-block;
  margin-right: 8px;
}

.x-unavailable-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  margin-top: 7px;
  border-radius: var(--x-radius-lg);
  background: var(--x-gray-bg);
  color: var(--x-gray-500);
  font-size: 11px;
  font-weight: 700;
}

/* Product Detail sheet — reuses the note overlay/sheet base (home.css above). */
.x-detail-overlay .x-detail-sheet {
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.x-detail-close {
  position: absolute;
  top: 12px;
  right: 18px;
  z-index: 2;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.08);
  color: var(--x-charcoal);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.x-detail-image-wrap {
  flex: 0 0 auto;
  width: 100%;
  height: 200px;
  margin-bottom: 6px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--x-gray-bg);
}

.x-detail-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.x-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 12px;
}

.x-detail-name {
  margin: 0;
  font-size: 20px;
  line-height: 26px;
  font-weight: 800;
  color: var(--x-charcoal);
}

.x-detail-branch {
  margin-top: 5px;
  color: var(--x-text-muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.x-detail-desc {
  margin-top: 9px;
  color: var(--x-text-muted);
  font-size: 14px;
  line-height: 21px;
  white-space: pre-line;
}

.x-detail-price {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.x-detail-old-price {
  font-size: 14px;
  color: var(--x-gray-400);
  text-decoration: line-through;
}

.x-detail-current {
  font-size: 22px;
  font-weight: 800;
}

.x-detail-add-area {
  margin-top: 18px;
}

.x-detail-add {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: var(--x-radius-xl);
  background: var(--x-lime);
  color: var(--x-black);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.x-detail-add:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.x-detail-cart-hint {
  margin-top: 9px;
  color: var(--x-text-muted);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   AUX PAGES (Affiliate, History, Profile)
   ══════════════════════════════════════════════════════════════ */
.x-aux-page {
  min-height: 100vh;
  background: #f8fafc;
  padding-bottom: 60px;
}

.x-aux-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--x-white);
  padding: calc(14px + var(--x-safe-top)) var(--x-page-pad) 14px;
  border-bottom: 1px solid #f1f5f9;
}

.x-aux-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.x-aux-back-btn img {
  width: 16px;
  height: 16px;
}

.x-aux-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.x-aux-body {
  padding: 16px var(--x-page-pad);
}

.x-aux-hero-card {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border-radius: 20px;
  padding: 24px 20px;
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}

.x-aux-hero-card h2 {
  color: #ffffff !important;
}

.x-aux-hero-card p {
  color: #cbd5e1 !important;
}

.x-aux-badge {
  display: inline-block;
  background: var(--x-lime);
  color: #000;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
}

.x-aux-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.x-aux-stat-box {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}

.x-aux-stat-box .num {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--x-lime);
}

.x-aux-stat-box .lbl {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.x-aux-card {
  background: var(--x-white);
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
}

.x-aux-action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 24px;
  border: none;
  background: var(--x-lime);
  color: #0f172a;
  font-size: 14.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(182, 255, 0, 0.35);
  display: block;
  text-align: center;
}

/* History Cards */
.x-history-card {
  background: var(--x-white);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
}

.x-history-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.x-history-branch {
  display: block;
  font-weight: 800;
  font-size: 14.5px;
  color: #0f172a;
}

.x-history-date {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.x-history-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

.x-history-items {
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
  padding: 8px 0;
  border-top: 1px dashed #e2e8f0;
  border-bottom: 1px dashed #e2e8f0;
  margin: 6px 0 10px;
}

.x-history-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.x-history-card-foot .lbl {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.x-history-card-foot .price {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.x-history-view-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* Profile Card & Menu */
.x-profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--x-white);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
  border: 1px solid #f1f5f9;
}

.x-profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.x-profile-avatar img {
  opacity: 0.8;
}

.x-profile-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.x-profile-phone {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.x-profile-menu-list {
  background: var(--x-white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.x-profile-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.x-profile-menu-item:last-child {
  border-bottom: none;
}

.x-profile-menu-item .left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.x-profile-menu-item .icon {
  font-size: 17px;
}

.x-profile-logout-btn {
  width: 100%;
  padding: 13px;
  border-radius: 20px;
  border: 1px solid #fee2e2;
  background: #fff;
  color: #ef4444;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 16px;
}
