/* ==========================================================================
   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);
}

/* Atribut hidden harus benar-benar menyembunyikan: .x-hero-icon-btn memakai
   display:flex, dan aturan kelas mengalahkan atribut hidden bawaan browser. */
.x-hero-icon-btn[hidden],
#x-my-table-badge[hidden] {
  display: none !important;
}

.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: var(--x-hero-text, #0f172a);
  letter-spacing: -1.5px;
  line-height: 1;
}

.x-hero-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--x-hero-text-sub, #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;
  /* M6 Layout Stability: reserve space before image loads to prevent banner height jump (CLS).
     Banner ratio: ~640/330 ≈ 1.94:1 (matches banner derivative spec). */
  aspect-ratio: 640 / 330;
  overflow: hidden;
  border-radius: 20px;
  background: var(--x-gray-bg, #f5f5f5);
}

.x-carousel-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 37%, #f0f0f0 63%);
  background-size: 400% 100%;
  animation: x-skeleton-pulse 1.4s ease infinite;
}

@keyframes x-skeleton-pulse {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.x-carousel-slide img {
  width: 100%;
  height: auto;
  /* Inline aspect-ratio from XentraMedia overrides correctly; this is a CSS fallback */
  aspect-ratio: 640 / 330;
  border-radius: 20px;
  display: block;
  object-fit: cover;
}

.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;
  color: #111;
}

.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: 8px;
}

.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;
  color: #111;
}


/* ── 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;
  /* M6 Layout Stability: 1:1 aspect-ratio reserves space before image loads (CLS prevention) */
  aspect-ratio: 1 / 1;
  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-primary);
  color: var(--x-primary-text, #111111);
  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-primary);
  color: var(--x-primary-text, #111111);
  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;
  font-size: 16px;
  font-weight: 800;
  color: var(--x-primary-text, #111111);
}

.x-quantity button svg {
  stroke: currentColor;
}

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

.x-quantity-value {
  text-align: center;
  font-size: 14px;
  line-height: 30px;
  font-weight: 700;
  color: var(--x-primary-text, #111111);
}


/* ── Note Button ──
   Owned by home.css: both Home product cards and Checkout item cards share
   this exact markup, so the effective (winning) values live here and are
   consumed by every page that loads home.css. */
.x-note-button {
  width: fit-content;
  height: 30px;
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--x-gray-700);
  font-family: var(--x-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  box-shadow: none;
}

.x-product-right .x-note-button {
  width: 100%;
  margin-top: 6px;
  border-radius: 18px;
}

.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-primary);
  background: var(--x-primary-bg);
  color: #111;
  font-weight: 700;
}

.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-primary);
  color: var(--x-primary-text, #111111) !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-primary);
  color: var(--x-primary-text, #111111);
  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-primary);
  color: var(--x-primary-text, #111111);
  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-primary);
  color: var(--x-primary-text, #111111);
  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;
}


/* ── Shared overlay primitive (moved out of checkout.css) ──
   Home and Checkout both build `.x-overlay` > `.x-sheet` dialogs. Declared
   here (before `.x-note-overlay`) so the note overlay keeps winning the
   same-specificity tie exactly as it did when checkout.css loaded last. */
.x-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: var(--x-overlay-bottom, 0px) !important;
  width: 100vw !important;
  height: auto !important;
  z-index: var(--x-z-overlay, 2147483000) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.45) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.35s ease, visibility 0.35s ease, bottom 0.2s ease !important;
  isolation: isolate;
}

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


/* ── 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: var(--x-primary);
	color: var(--x-primary-text, #111);
	font-family: 'Plus Jakarta Sans', Arial, sans-serif;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

/* NOTE: a second, token-valued duplicate of #x-note-input::placeholder,
   .x-note-footer, #x-note-counter and #x-note-save used to live here. It was
   the rule that took over once checkout.css stopped restating these (and it
   only differed in fallback font names), so it was removed to keep the exact
   pre-cleanup computed values. */


/* ── PWA Install Banner ── */
.x-pwa-banner {
  position: fixed;
  top: max(12px, var(--x-safe-top, 12px));
  left: 12px;
  right: 12px;
  width: calc(100% - 24px);
  max-width: var(--x-page-max);
  margin: 0 auto;
  box-sizing: border-box;
  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 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--x-shadow-xl), var(--x-shadow-sm);
  border: 1px solid var(--x-gray-75);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

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

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

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

.x-pwa-banner-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--x-black);
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.x-pwa-banner-text span {
  font-size: 11px;
  color: var(--x-gray-600);
  line-height: 1.25;
  margin-top: 2px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.x-pwa-btn-install {
  background: var(--x-black);
  color: var(--x-white);
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  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;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

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

@media (max-width: 360px) {
  .x-pwa-banner {
    left: 8px;
    right: 8px;
    width: calc(100% - 16px);
  }

  .x-pwa-banner-card {
    padding: 8px 10px;
    gap: 8px;
  }

  .x-pwa-banner-left {
    gap: 6px;
  }

  .x-pwa-banner-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
  }

  .x-pwa-banner-text strong {
    font-size: 12px;
  }

  .x-pwa-banner-text span {
    font-size: 10px;
  }

  .x-pwa-banner-right {
    gap: 4px;
  }

  .x-pwa-btn-install {
    padding: 6px 10px;
    font-size: 11px;
  }

  .x-pwa-btn-dismiss {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 12px;
  }
}


/* ── 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 note overlay base, strictly content-fitted */
.x-detail-overlay .x-detail-sheet {
  height: auto !important;
  min-height: 0 !important;
  max-height: min(88dvh, calc(100dvh - 36px)) !important;
  padding: 10px 18px max(16px, env(safe-area-inset-bottom)) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.x-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  min-height: 28px;
  margin-bottom: 8px;
}

.x-detail-topbar .x-note-handle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 !important;
}

.x-detail-close {
  margin-left: auto;
  position: relative;
  z-index: 5;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--x-gray-200, #e2e4e8);
  border-radius: 50%;
  background: #ffffff;
  color: var(--x-charcoal, #222222);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: background-color 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.x-detail-close svg {
  display: block;
  pointer-events: none;
}

.x-detail-close:active {
  transform: scale(0.92);
  background: var(--x-gray-50, #f5f5f5);
}

.x-detail-scroll-area {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
}

.x-detail-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 210px;
  min-height: 140px;
  margin-bottom: 12px;
  border-radius: var(--x-radius-md, 14px);
  overflow: hidden;
  background: var(--x-gray-bg, #fafafa);
  border: 1px solid var(--x-gray-100, #ececec);
}

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

.x-detail-body {
  padding: 0 2px;
}

.x-detail-name {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--x-charcoal, #222222);
  word-break: break-word;
}

.x-detail-branch {
  margin-bottom: 6px;
  color: var(--x-text-muted, #999999);
  font-size: 12.5px;
  line-height: 16px;
  font-weight: 600;
}

.x-detail-desc {
  margin-bottom: 10px;
  color: var(--x-gray-600, #555555);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  word-break: break-word;
}

.x-detail-desc:empty {
  display: none;
}

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

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

.x-detail-current {
  font-size: 20px;
  font-weight: 800;
  color: var(--x-charcoal, #222222);
}

.x-detail-footer {
  flex: 0 0 auto;
  margin-top: 4px;
  padding-top: 6px;
}

.x-detail-add {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: var(--x-radius-xl, 23px);
  background: var(--x-primary, #b6ff00);
  color: var(--x-primary-text, #111111);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.x-detail-add:active:not(:disabled) {
  transform: scale(0.98);
}

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

.x-detail-cart-hint {
  margin-top: 8px;
  color: var(--x-text-muted, #888888);
  font-size: 12px;
  line-height: 16px;
  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-primary);
  color: var(--x-primary-text, #111111);
  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-primary);
}

.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-primary);
  color: var(--x-primary-text, #111111);
  font-size: 14.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--x-primary-shadow, rgba(0, 0, 0, 0.15));
  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;
}

.x-profile-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  background: #fff;
  color: #111;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: background 0.15s;
}

.x-profile-google-btn:hover {
  background: #f9fafb;
}

.x-profile-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.4;
}


/* ==========================================================================
   SHARED OVERLAY / SHEET PRIMITIVES (moved out of checkout.css)

   Home renders its cart sheet, note sheet, product-detail sheet and branch
   switcher through the same `.x-overlay` > `.x-sheet` structure Checkout uses.
   These rules previously lived in checkout.css and only applied to Home
   because checkout.css loads last. They are owned here so Home no longer
   depends on checkout.css being present.

   NOTE: `.x-overlay` / `.x-overlay.open` are declared just above the Note
   Sheet section (not here) so that `.x-note-overlay` keeps winning the
   same-specificity tie it won when checkout.css loaded last.

   The rules below are deliberately placed at the END of home.css: they must
   keep winning the cascade against the view-specific rules above them (e.g.
   `.x-detail-overlay .x-detail-sheet`), exactly as checkout.css used to.
   ========================================================================== */

.x-overlay .x-sheet {
  background: #fff !important;
  width: 100% !important;
  max-width: 480px !important;
  margin: 0 auto !important;
  max-height: min(88dvh, calc(100% - 16px)) !important;
  overflow-y: auto !important;
  border-radius: 22px 22px 0 0 !important;
  padding: 14px 18px calc(20px + env(safe-area-inset-bottom)) !important;
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.15) !important;
  transform: translateY(105%) !important;
  transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
  will-change: transform !important;
  touch-action: pan-y !important;
  box-sizing: border-box !important;
  overscroll-behavior: contain !important;
}

.x-sheet.open,
.x-overlay.open .x-sheet {
  transform: translateY(0) !important;
}

/* Scroll lock while Home's note sheet is open (was body:has(...) in checkout.css) */
body:has(#x-note-overlay.open),
body:has(.x-note-overlay.open) {
  overflow: hidden;
}

