/* ── Variables ── */
:root {
  --tw-fop-primary:      #64b2fa;
  --tw-fop-primary-dark: #3d9bf0;
  --tw-fop-primary-bg:   #edf5ff;
  --tw-fop-surface:      #ffffff;
  --tw-fop-bg:           #f5f5f7;
  --tw-fop-text:         #1c1c1e;
  --tw-fop-text-muted:   #6e6e73;
  --tw-fop-border:       #e5e5ea;
  --tw-fop-radius:       14px;
  --tw-fop-radius-sm:    10px;
  --tw-fop-shadow:       0 2px 16px rgba(0,0,0,.08);
  --tw-fop-shadow-lg:    0 8px 32px rgba(0,0,0,.12);
}

/* ── Reset scoped ── */
.tw-fop-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.tw-fop-wrap img { display: block; max-width: 100%; }
.tw-fop-wrap button { cursor: pointer; border: none; font: inherit; }
.tw-fop-wrap a { text-decoration: none; color: inherit; }
/* Các nút không có background riêng thì reset về none */
.tw-fop-wrap .tw-fop-sidebar__clear,
.tw-fop-wrap .tw-fop-mode-btn,
.tw-fop-wrap .tw-fop-modal__close,
.tw-fop-wrap .tw-fop-modal__back,
.tw-fop-wrap .tw-fop-note-btn,
.tw-fop-wrap .tw-fop-qty-btn,
.tw-fop-wrap .tw-fop-cat-nav__item,
.tw-fop-wrap .tw-fop-upsells__nav-btn,
.tw-fop-wrap .tw-fop-layout-toggle-btn { background: none; }

/* ── Utility ── */
.tw-fop-flex          { display: flex; }
.tw-fop-flex-col      { flex-direction: column; }
.tw-fop-items-center  { align-items: center; }
.tw-fop-justify-between { justify-content: space-between; }
.tw-fop-gap-2         { gap: 8px; }
.tw-fop-gap-4         { gap: 16px; }
.tw-fop-sticky        { position: sticky; }
.tw-fop-overflow-hidden { overflow: hidden; }
.tw-fop-text-sm       { font-size: 13px; }
.tw-fop-text-base     { font-size: 15px; }
.tw-fop-text-muted    { color: var(--tw-fop-text-muted); }
.tw-fop-font-semibold { font-weight: 600; }
.tw-fop-line-clamp-2  { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Wrap ── */
.tw-fop-wrap {
  font-family: inherit;
  color: var(--tw-fop-text);
  background: var(--tw-fop-bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Category nav ── */
.tw-fop-cat-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--tw-fop-surface);
  border-bottom: 1px solid var(--tw-fop-border);
  padding: 0 16px;
}
.tw-fop-cat-nav__track {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  padding: 12px 0;
}
.tw-fop-cat-nav__track::-webkit-scrollbar { display: none; }
.tw-fop-cat-nav__item {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tw-fop-text-muted);
  transition: all .2s;
  white-space: nowrap;
}
.tw-fop-cat-nav__item:hover,
.tw-fop-cat-nav__item.is-active {
  background: var(--tw-fop-primary-bg);
  color: var(--tw-fop-primary);
  font-weight: 600;
}

/* ── Search ── */
.tw-fop-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--tw-fop-bg);
  border-radius: var(--tw-fop-radius-sm);
  padding: 8px 12px;
  min-width: 200px;
}
.tw-fop-search svg { color: var(--tw-fop-text-muted); flex-shrink: 0; }
.tw-fop-search__input {
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  width: 100%;
  color: var(--tw-fop-text);
}
.tw-fop-search__input::placeholder { color: var(--tw-fop-text-muted); }
.tw-fop-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--tw-fop-border);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  color: var(--tw-fop-text-muted);
  padding: 0;
  transition: background 0.15s;
}
.tw-fop-search-clear:hover { background: #d1d1d6; }

/* ── Layout ── */
.tw-fop-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}
.tw-fop-layout__content { padding: 24px 24px 24px 0; }

/* ── Category section ── */
.tw-fop-category-section { margin-bottom: 40px; }
.tw-fop-category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tw-fop-category-title { font-size: 20px; font-weight: 700; }
.tw-fop-category-count { font-size: 13px; color: var(--tw-fop-text-muted); }

/* ── Product grid ── */
.tw-fop-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* POS center panel: fixed 3 columns, no description */
.ms-pos-main .tw-fop-product-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.ms-pos-main .tw-fop-card__body {
  padding: 10px 12px 12px;
  gap: 6px;
}
.ms-pos-main .tw-fop-card__name {
  font-size: 14px;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-pos-main .tw-fop-card__desc {
  display: none !important;
}
.ms-pos-main .tw-fop-card__footer {
  margin-top: 2px;
  position: relative;
  z-index: 2;
}
.ms-pos-main .tw-fop-card__add-btn {
  pointer-events: auto;
  position: relative;
  z-index: 3;
  background: var(--tw-fop-primary);
}
.ms-pos-main .tw-fop-card__image-wrap {
  pointer-events: none;
}

/* ── Product card ── */
.tw-fop-card {
  background: var(--tw-fop-surface);
  border-radius: var(--tw-fop-radius);
  box-shadow: var(--tw-fop-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.tw-fop-card:hover { transform: translateY(-2px); box-shadow: var(--tw-fop-shadow-lg); }
.tw-fop-card--unavailable { opacity: .5; pointer-events: none; }

.tw-fop-card__image-wrap { aspect-ratio: 1; overflow: hidden; }
.tw-fop-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tw-fop-card:hover .tw-fop-card__image { transform: scale(1.04); }
.tw-fop-card__image-placeholder { width: 100%; height: 100%; background: var(--tw-fop-bg); }

.tw-fop-card__body { padding: 12px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.tw-fop-card__top { flex: 1; }
.tw-fop-card__name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tw-fop-card__desc { font-size: 13px; color: var(--tw-fop-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tw-fop-card__footer { display: flex; align-items: center; justify-content: space-between; }
.tw-fop-card__price { font-size: 15px; font-weight: 700; }
.tw-fop-card__price-prefix { font-size: 11px; font-weight: 400; color: var(--tw-fop-text-muted); margin-right: 2px; }

.tw-fop-card__add-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tw-fop-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .1s;
  flex-shrink: 0;
}
.tw-fop-card__add-btn:hover { background: var(--tw-fop-primary-dark); }
.tw-fop-card__add-btn:active { transform: scale(.93); }
.tw-fop-card__add-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--tw-fop-text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.tw-fop-card__add-count.is-visible { display: flex; }

/* ── Sidebar ── */
.tw-fop-sidebar {
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow: hidden;
  border-left: 1px solid var(--tw-fop-border);
  background: var(--tw-fop-surface);
}
.tw-fop-sidebar__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Mode toggle */
.tw-fop-mode-toggle {
  position: relative;
  display: flex;
  background: var(--tw-fop-bg);
  border-radius: var(--tw-fop-radius-sm);
  padding: 3px;
  margin: 16px 16px 0;
}
.tw-fop-mode-toggle__slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: var(--tw-fop-surface);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.tw-fop-mode-toggle[data-mode="pickup"] .tw-fop-mode-toggle__slider { transform: translateX(100%); }
.tw-fop-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--tw-fop-text-muted);
  position: relative;
  z-index: 1;
  transition: color .2s;
  border-radius: 8px;
}
.tw-fop-mode-btn.is-active { color: var(--tw-fop-text); font-weight: 600; }

/* Sidebar header */
.tw-fop-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.tw-fop-sidebar__title { font-size: 18px; font-weight: 700; }
.tw-fop-sidebar__clear { color: var(--tw-fop-text-muted); padding: 4px; border-radius: 6px; transition: color .2s; }
.tw-fop-sidebar__clear:hover { color: #ff3b30; }

/* Cart items */
.tw-fop-cart-items { flex: 1; overflow-y: auto; padding: 0 16px; scrollbar-width: thin; }
.tw-fop-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 160px;
  color: var(--tw-fop-text-muted);
  font-size: 14px;
}

/* Cart item */
.tw-fop-cart-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--tw-fop-border);
}
.tw-fop-cart-item:last-child { border-bottom: none; }
.tw-fop-cart-item__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tw-fop-cart-item__name { font-size: 14px; font-weight: 600; flex: 1; }
.tw-fop-cart-item__price { font-size: 14px; font-weight: 700; white-space: nowrap; }
.tw-fop-cart-item__toppings { font-size: 12px; color: var(--tw-fop-text-muted); margin-top: 2px; }
.tw-fop-cart-item__note-toggle { font-size: 12px; color: var(--tw-fop-primary); margin-top: 4px; display: inline-block; }

.tw-fop-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--tw-fop-bg);
  border-radius: 20px;
  padding: 2px;
}
.tw-fop-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  color: var(--tw-fop-text);
}
.tw-fop-qty-btn:hover { background: var(--tw-fop-border); }
.tw-fop-qty-btn--trash { color: #ff3b30; }
.tw-fop-qty-val { font-size: 14px; font-weight: 600; min-width: 20px; text-align: center; }

/* Note form */
.tw-fop-note-form { margin-top: 8px; }
.tw-fop-note-textarea {
  width: 100%;
  border: 1px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .2s;
}
.tw-fop-note-textarea:focus { border-color: var(--tw-fop-primary); }
.tw-fop-note-actions { display: flex; gap: 8px; margin-top: 6px; justify-content: flex-end; }
.tw-fop-note-btn { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.tw-fop-note-btn--save { color: var(--tw-fop-primary); }
.tw-fop-note-btn--cancel { color: var(--tw-fop-text-muted); }

/* Upsells */
.tw-fop-upsells { padding: 12px 16px; border-top: 1px solid var(--tw-fop-border); }
.tw-fop-upsells__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tw-fop-upsells__title { font-size: 13px; font-weight: 600; }
.tw-fop-upsells__nav { display: flex; gap: 4px; }
.tw-fop-upsells__nav-btn { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--tw-fop-border); color: var(--tw-fop-text-muted); }
.tw-fop-upsells__nav-btn:hover { border-color: var(--tw-fop-primary); color: var(--tw-fop-primary); }
.tw-fop-upsells__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.tw-fop-upsells__track::-webkit-scrollbar { display: none; }
.tw-fop-upsell-item {
  flex-shrink: 0;
  width: 130px;
  scroll-snap-align: start;
}
.tw-fop-upsell-item__img { width: 130px; height: 90px; object-fit: cover; border-radius: 10px; }
.tw-fop-upsell-item__name { font-size: 12px; font-weight: 600; margin-top: 6px; }
.tw-fop-upsell-item__price { font-size: 12px; color: var(--tw-fop-text-muted); }
.tw-fop-upsell-item__btn { font-size: 12px; color: var(--tw-fop-primary); font-weight: 600; margin-top: 4px; display: inline-block; }

/* Sidebar footer */
.tw-fop-sidebar__footer { padding: 12px 16px; border-top: 1px solid var(--tw-fop-border); display: flex; flex-direction: column; gap: 10px; }

.tw-fop-cart-notice {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 12px;
  border-radius: var(--tw-fop-radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
}
.tw-fop-cart-notice__icon { flex-shrink: 0; margin-top: 1px; }
.tw-fop-cart-notice--warning { color: #856404; background: #fff3cd; }
.tw-fop-cart-notice--info    { color: #0c5460; background: #d1ecf1; }
.tw-fop-cart-notice--success { color: #155724; background: #d4edda; }

.tw-fop-subtotal { display: flex; justify-content: space-between; font-size: 14px; }
.tw-fop-subtotal strong { font-weight: 700; }

.tw-fop-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--tw-fop-primary);
  color: #fff;
  border-radius: var(--tw-fop-radius);
  font-size: 16px;
  font-weight: 700;
  transition: background .2s, transform .1s;
  width: 100%;
}
.tw-fop-checkout-btn:hover:not(:disabled) { background: var(--tw-fop-primary-dark); }
.tw-fop-checkout-btn:active:not(:disabled) { transform: scale(.98); }
.tw-fop-checkout-btn:disabled { opacity: .5; cursor: not-allowed; }
.tw-fop-checkout-btn__count {
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tw-fop-checkout-btn__total { font-size: 16px; }

/* ── Modal overlay ── */
.tw-fop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fop-fade-in .2s ease;
}
.tw-fop-modal-overlay[hidden] { display: none; }

@keyframes fop-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fop-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.tw-fop-modal {
  background: var(--tw-fop-surface);
  border-radius: var(--tw-fop-radius) var(--tw-fop-radius) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fop-slide-up .3s cubic-bezier(.32,1.25,.5,1);
}

/* ── Checkout modal ── */
.tw-fop-modal__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--tw-fop-border);
  position: sticky;
  top: 0;
  background: var(--tw-fop-surface);
  z-index: 1;
}
.tw-fop-modal__title { flex: 1; font-size: 17px; font-weight: 700; text-align: center; }
.tw-fop-modal__close, .tw-fop-modal__back { color: var(--tw-fop-text-muted); padding: 4px; border-radius: 6px; }
.tw-fop-modal__close:hover, .tw-fop-modal__back:hover { color: var(--tw-fop-text); }

.tw-fop-checkout-step { padding: 20px; }

/* Form */
.tw-fop-form-group { margin-bottom: 16px; }
.tw-fop-label { font-size: 13px; font-weight: 600; color: var(--tw-fop-text); display: block; margin-bottom: 6px; }
.tw-fop-input, .tw-fop-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--tw-fop-text);
  background: var(--tw-fop-surface);
  outline: none;
  transition: border-color .2s;
}
.tw-fop-input:focus, .tw-fop-textarea:focus { border-color: var(--tw-fop-primary); }
.tw-fop-input--error, .tw-fop-textarea--error { border-color: #ff3b30 !important; }
.tw-fop-input--error:focus, .tw-fop-textarea--error:focus { border-color: #ff3b30 !important; box-shadow: 0 0 0 3px rgba(255,59,48,.15); }
.tw-fop-field-error { font-size: 12px; color: #ff3b30; margin-top: 4px; }
.tw-fop-textarea { resize: none; }

/* Payment options */
.tw-fop-payment-options { display: flex; gap: 10px; flex-wrap: wrap; }
.tw-fop-radio-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1.5px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.tw-fop-radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.tw-fop-radio-card.is-active { border-color: var(--tw-fop-primary); background: var(--tw-fop-primary-bg); color: var(--tw-fop-primary); }

/* Buttons */
.tw-fop-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--tw-fop-primary);
  color: #fff;
  border-radius: var(--tw-fop-radius);
  font-size: 16px;
  font-weight: 700;
  transition: background .2s;
  margin-top: 8px;
}
.tw-fop-btn-primary:hover { background: var(--tw-fop-primary-dark); }
.tw-fop-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  border: 1.5px solid var(--tw-fop-primary);
  color: var(--tw-fop-primary);
  border-radius: var(--tw-fop-radius);
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
}

/* Spinner */
.tw-fop-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fop-spin .7s linear infinite;
}
@keyframes fop-spin { to { transform: rotate(360deg); } }

/* Order summary */
.tw-fop-order-summary { background: var(--tw-fop-bg); border-radius: var(--tw-fop-radius); padding: 16px; margin-bottom: 16px; }
.tw-fop-summary-item { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--tw-fop-border); }
.tw-fop-summary-item:last-child { border: none; }
.tw-fop-summary-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding-top: 10px; border-top: 2px solid var(--tw-fop-border); margin-top: 4px; }

/* Confirmed */
.tw-fop-confirmed { text-align: center; padding: 24px 0; }
.tw-fop-confirmed__icon { color: #34c759; margin-bottom: 16px;     align-items: center;
    display: flex;
    justify-content: center;}
.tw-fop-confirmed__title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.tw-fop-confirmed__subtitle { font-size: 15px; color: var(--tw-fop-text-muted); }

/* ── Floating cart (mobile) ── */
.tw-fop-float-cart {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tw-fop-primary);
  color: #fff;
  padding: 14px 24px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(100,178,250,.45);
  z-index: 200;
  white-space: nowrap;
  animation: fop-fade-in .2s ease;
}
.tw-fop-float-cart[hidden] { display: none; }
.tw-fop-float-cart__count {
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* ── Layout toggle ── */
.tw-fop-layout-toggle { display: flex; gap: 4px; margin-left: auto; padding: 0 16px; }
.tw-fop-layout-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tw-fop-text-muted);
  transition: color .2s, background .2s;
}
.tw-fop-layout-toggle-btn.is-active,
.tw-fop-layout-toggle-btn:hover { background: var(--tw-fop-primary-bg); color: var(--tw-fop-primary); }

/* ── List layout ── */
.tw-fop-wrap--list .tw-fop-product-grid { grid-template-columns: 1fr; gap: 8px; }
.tw-fop-wrap--list .tw-fop-card { flex-direction: row; align-items: center; gap: 0; }
.tw-fop-wrap--list .tw-fop-card__image-wrap { width: 90px; height: 90px; flex-shrink: 0; aspect-ratio: unset; border-radius: var(--tw-fop-radius) 0 0 var(--tw-fop-radius); }
.tw-fop-wrap--list .tw-fop-card__image { border-radius: var(--tw-fop-radius) 0 0 var(--tw-fop-radius); }
.tw-fop-wrap--list .tw-fop-card__body { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.tw-fop-wrap--list .tw-fop-card__top { flex: 1; }
.tw-fop-wrap--list .tw-fop-card__desc { -webkit-line-clamp: 2; }
.tw-fop-wrap--list .tw-fop-card__footer { flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.tw-fop-wrap--list .tw-fop-card:hover { transform: none; box-shadow: var(--tw-fop-shadow-lg); }

/* ── Product detail modal ── */
.tw-fop-product-modal {
  max-width: 860px;
  width: 100%;
  border-radius: var(--tw-fop-radius);
  display: flex;
  flex-direction: row;
  max-height: 88vh;
  overflow: hidden;
}
/* On mobile, full slide-up */
@media (max-width: 700px) {
  .tw-fop-modal-overlay { align-items: flex-end; }
  .tw-fop-product-modal { flex-direction: column; border-radius: var(--tw-fop-radius) var(--tw-fop-radius) 0 0; max-height: 92vh; }
  .tw-fop-product-modal__media { height: 220px; min-height: unset; }
  .tw-fop-product-modal__media-info { padding: 12px 16px; }
}
/* Desktop: centered */
@media (min-width: 701px) {
  .tw-fop-modal-overlay { align-items: center; }
  .tw-fop-product-modal { border-radius: var(--tw-fop-radius); }
}

.tw-fop-product-modal__media {
  flex: 0 0 42%;
  position: relative;
  background: #111;
  min-height: 400px;
  overflow: hidden;
}
.tw-fop-product-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
  transition: opacity .25s ease;
}
.tw-fop-img-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
  background-size: 800px 100%;
  animation: fop-shimmer 1.4s infinite linear;
}
.tw-fop-img-skeleton[hidden] { display: none; }
.tw-fop-product-modal__media-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  color: #fff;
}
.tw-fop-product-modal__media-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.tw-fop-product-modal__media-desc { font-size: 13px; opacity: .85; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color:#fff !important; }
.tw-fop-product-modal__media-price { font-size: 16px; font-weight: 700; color: var(--tw-fop-primary); }

.tw-fop-product-modal__options {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tw-fop-product-modal__options-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tw-fop-border);
  flex-shrink: 0;
}
.tw-fop-product-modal__options-body { flex: 1; overflow-y: auto; padding: 4px 0; }
.tw-fop-product-modal__options-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--tw-fop-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Topping groups */
.tw-fop-topping-group { padding: 14px 16px; border-bottom: 1px solid var(--tw-fop-border); }
.tw-fop-topping-group:last-child { border-bottom: none; }
.tw-fop-topping-group__header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tw-fop-topping-group__name { font-size: 14px; font-weight: 700; }
.tw-fop-topping-group__hint {
  font-size: 11px;
  color: var(--tw-fop-text-muted);
  background: var(--tw-fop-bg);
  padding: 2px 8px;
  border-radius: 10px;
}
.tw-fop-topping-group__required {
  font-size: 11px;
  color: #ff3b30;
  background: #fff0ee;
  padding: 2px 8px;
  border-radius: 10px;
}
.tw-fop-topping-group__options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.tw-fop-topping-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1.5px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tw-fop-topping-option:hover { border-color: var(--tw-fop-primary); }
.tw-fop-topping-option.is-selected { border-color: var(--tw-fop-primary); background: var(--tw-fop-primary-bg); }
.tw-fop-topping-option input { position: absolute; opacity: 0; pointer-events: none; }
.tw-fop-topping-option__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--tw-fop-border);
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tw-fop-topping-option.is-selected .tw-fop-topping-option__dot {
  border-color: var(--tw-fop-primary);
  background: var(--tw-fop-primary);
}
.tw-fop-topping-option.is-selected .tw-fop-topping-option__dot::after {
  content: '';
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
}
.tw-fop-topping-option__checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--tw-fop-border);
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tw-fop-topping-option.is-selected .tw-fop-topping-option__checkbox {
  border-color: var(--tw-fop-primary);
  background: var(--tw-fop-primary);
}
.tw-fop-topping-option.is-selected .tw-fop-topping-option__checkbox::after {
  content: '';
  width: 9px; height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.tw-fop-topping-option__info { flex: 1; min-width: 0; }
.tw-fop-topping-option__name { font-size: 13px; font-weight: 500; }
.tw-fop-topping-option__price { font-size: 12px; color: var(--tw-fop-text-muted); margin-top: 2px; }

/* Product modal footer */
.tw-fop-product-modal__qty { display: flex; align-items: center; gap: 8px; }
.tw-fop-product-modal__qty-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--tw-fop-border);
  background: var(--tw-fop-surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px; line-height: 1;
  color: var(--tw-fop-text);
  transition: border-color .15s;
}
.tw-fop-product-modal__qty-btn:hover { border-color: var(--tw-fop-primary); color: var(--tw-fop-primary); }
.tw-fop-product-modal__qty-val { font-size: 16px; font-weight: 700; min-width: 24px; text-align: center; }
.tw-fop-product-modal__add-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: var(--tw-fop-primary);
  color: #fff;
  border-radius: var(--tw-fop-radius);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.tw-fop-product-modal__add-btn:hover { background: var(--tw-fop-primary-dark); }

/* ── Skeleton loading ── */
@keyframes fop-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.tw-fop-skeleton {
  background: linear-gradient(90deg, #e8e8eb 25%, #f5f5f7 50%, #e8e8eb 75%);
  background-size: 800px 100%;
  animation: fop-shimmer 1.4s infinite linear;
  border-radius: 6px;
}
.tw-fop-skeleton--line    { height: 13px; margin-bottom: 8px; }
.tw-fop-skeleton--line-lg { height: 18px; margin-bottom: 10px; }
.tw-fop-skeleton--group {
  padding: 14px 16px;
  border-bottom: 1px solid var(--tw-fop-border);
}
.tw-fop-skeleton--group:last-child { border-bottom: none; }
.tw-fop-skeleton--options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.tw-fop-skeleton--option { height: 58px; border-radius: var(--tw-fop-radius-sm); }

/* ── Product modal note ── */
.tw-fop-product-modal__note-wrap {
  padding: 10px 16px 4px;
  flex-shrink: 0;
}
.tw-fop-modal-note {
  width: 100%;
  border: 1.5px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  color: var(--tw-fop-text);
  background: var(--tw-fop-bg);
  transition: border-color .2s, background .2s;
}
.tw-fop-modal-note:focus { border-color: var(--tw-fop-primary); background: var(--tw-fop-surface); }
.tw-fop-modal-note::placeholder { color: var(--tw-fop-text-muted); }

/* ── QR Payment Panel ── */
.tw-fop-qr-panel {
  background: var(--tw-fop-bg);
  border-radius: var(--tw-fop-radius);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}
.tw-fop-qr-panel[hidden] { display: none; }
.tw-fop-qr-panel__title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.tw-fop-qr-panel__img-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.tw-fop-qr-panel__img {
  width: 200px;
  height: 200px;
  border: 2px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  background: #fff;
  display: block;
}
.tw-fop-qr-panel__info {
  text-align: left;
  background: var(--tw-fop-surface);
  border-radius: var(--tw-fop-radius-sm);
  padding: 12px 14px;
}
.tw-fop-qr-panel__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--tw-fop-border);
}
.tw-fop-qr-panel__row:last-child { border-bottom: none; }
.tw-fop-qr-panel__label { font-size: 13px; color: var(--tw-fop-text-muted); }
.tw-fop-qr-panel__value { font-size: 13px; font-weight: 600; word-break: break-all; }

/* ── Store picker (pickup) ── */
.tw-fop-store-info {
  padding: 12px 14px;
  background: var(--tw-fop-primary-bg);
  border: 1.5px solid var(--tw-fop-primary);
  border-radius: var(--tw-fop-radius-sm);
}
.tw-fop-store-info__name { font-weight: 600; font-size: 14px; color: var(--tw-fop-text); }
.tw-fop-store-info__address { font-size: 13px; color: var(--tw-fop-text-muted); margin-top: 3px; }
.tw-fop-store-picker { display: flex; flex-direction: column; gap: 8px; }
.tw-fop-store-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--tw-fop-border);
  border-radius: var(--tw-fop-radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tw-fop-store-option:hover { border-color: var(--tw-fop-primary); }
.tw-fop-store-option.is-selected { border-color: var(--tw-fop-primary); background: var(--tw-fop-primary-bg); }
.tw-fop-store-option input[type="radio"] { accent-color: var(--tw-fop-primary); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.tw-fop-store-option__info { flex: 1; }
.tw-fop-store-option__name { font-weight: 600; font-size: 14px; color: var(--tw-fop-text); }
.tw-fop-store-option__address { font-size: 12px; color: var(--tw-fop-text-muted); margin-top: 2px; }
.tw-fop-summary-item--store { color: var(--tw-fop-primary); font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .tw-fop-layout { grid-template-columns: 1fr; }
  .tw-fop-sidebar { display: none; }
  .tw-fop-layout__content { padding: 16px; }
  .tw-fop-float-cart { display: flex; }
}
@media (min-width: 901px) {
  .tw-fop-float-cart { display: none !important; }
  .tw-fop-sidebar { display: block; }
}
@media (max-width: 640px) {
  .tw-fop-product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tw-fop-search { display: none; }
}

/* ── WordPress admin bar offset ── */
.admin-bar .tw-fop-cat-nav { top: 32px; }
.admin-bar .tw-fop-sidebar { top: 89px; height: calc(100vh - 89px); }
@media screen and (max-width: 782px) {
  .admin-bar .tw-fop-cat-nav { top: 46px; }
  .admin-bar .tw-fop-sidebar { top: 103px; height: calc(100vh - 103px); }
}

/* ── MegaStoreVn Livewire POS: 3-column shell (UI mẫu) ── */
.megastorevn-pos-terminal [x-cloak] { display: none !important; }

.ms-pos-app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 360px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 48px);
  background: var(--tw-fop-bg);
  position: relative;
  transition: grid-template-columns .25s ease;
}

/* Collapsed sidebar: hide the nav column, keep a reveal arrow */
.ms-pos-app--nav-collapsed {
  grid-template-columns: 0 minmax(0, 1fr) 360px;
}
.ms-pos-app--nav-collapsed .ms-pos-nav {
  width: 0;
  min-width: 0;
  max-height: 0;
  padding: 0;
  border-right: 0;
  opacity: 0;
  pointer-events: none;
}

.ms-pos-nav__reveal {
  position: absolute;
  top: 16px;
  left: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  background: var(--tw-fop-primary);
  box-shadow: 0 4px 12px -2px rgba(51, 117, 241, .5);
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.ms-pos-nav__reveal:hover { background: var(--tw-fop-primary-dark); transform: translateX(2px); }

.ms-pos-nav__collapse {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--tw-fop-text-muted);
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.ms-pos-nav__collapse:hover { background: var(--tw-fop-bg); color: var(--tw-fop-text); }
.ms-pos-nav {
  background: var(--tw-fop-surface);
  border-right: 1px solid var(--tw-fop-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: calc(100vh - 48px);
  overflow: hidden;
}
.ms-pos-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 16px 12px 10px;
  border-bottom: 1px solid var(--tw-fop-border);
}
.ms-pos-nav__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tw-fop-text-muted);
}
.ms-pos-nav__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 16px;
  list-style: none;
}
.ms-pos-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--tw-fop-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--tw-fop-text);
  border: none;
  background: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ms-pos-nav__item:hover { background: var(--tw-fop-primary-bg); }
.ms-pos-nav__item.is-active {
  background: var(--tw-fop-primary-bg);
  color: var(--tw-fop-primary);
  font-weight: 600;
}
.ms-pos-nav__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: .7;
}
.ms-pos-main {
  overflow-y: auto;
  padding: 20px 24px 32px;
  max-height: calc(100vh - 48px);
}
.ms-pos-app .tw-fop-layout {
  display: contents;
}
.ms-pos-app .tw-fop-layout__content { padding: 0; }
.ms-pos-app .tw-fop-sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 48px);
}
.megastorevn-pos-shortcode { width: 100%; max-width: none; }
/* ── POS toast (Livewire $notice) ── */
.megastorevn-pos-notice {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 100001;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  width: max-content;
  margin: 0;
  padding: 14px 16px 14px 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-left: 4px solid var(--tw-fop-primary, #2563eb);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translate(-50%, calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
}

.megastorevn-pos-notice.is-open {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.megastorevn-pos-notice__text {
  margin: 0;
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  padding-top: 1px;
}

.megastorevn-pos-notice__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px -4px 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  cursor: pointer;
  transition: background 0.15s ease;
}

.megastorevn-pos-notice__close:hover {
  background: rgba(37, 99, 235, 0.2);
}

.megastorevn-pos-notice__close:focus-visible {
  outline: 2px solid var(--tw-fop-primary, #64b2fa);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .megastorevn-pos-notice {
    transition: opacity 0.2s ease;
  }
  .megastorevn-pos-notice.is-open {
    transform: translate(-50%, 0);
  }
}
@media (max-width: 1100px) {
  .ms-pos-app { grid-template-columns: 200px 1fr 320px; }
  .ms-pos-main .tw-fop-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .ms-pos-main .tw-fop-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ms-pos-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .ms-pos-nav { height: auto; max-height: 220px; position: relative; }
  .ms-pos-app .tw-fop-sidebar {
    position: relative;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--tw-fop-border);
  }
}

/* ── Product pagination ───────────────────────────────────────── */
.tw-fop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0 8px;
}

.tw-fop-pagination__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tw-fop-primary);
  background: var(--tw-fop-primary-bg);
  border: 1px solid var(--tw-fop-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.tw-fop-pagination__btn:hover:not(:disabled) {
  background: var(--tw-fop-primary);
  color: #fff;
}

.tw-fop-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tw-fop-pagination__info {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  min-width: 96px;
  text-align: center;
}

/* ── Variation picker (Phân loại hàng hóa) ────────────────────── */
.tw-fop-card__add-btn--variable {
  background: #ecfdf5;
  color: #16a34a;
}
.tw-fop-card__add-btn--variable:hover:not(:disabled) {
  background: #16a34a;
  color: #fff;
}

.tw-fop-variation-modal {
  max-width: 620px;
  border: 1.5px solid rgba(15, 23, 42, .1);
  border-radius: 24px;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35);
  overflow: hidden;
}

.tw-fop-variation-modal .tw-fop-modal__header {
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}
.tw-fop-variation-modal .tw-fop-modal__title { font-size: 18px; }

.tw-fop-variation-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 60%);
  max-height: calc(90vh - 64px);
  overflow-y: auto;
}

.tw-fop-variation-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 16px;
  text-align: left;
  background: #fff;
  border: 1.5px solid rgba(15, 23, 42, .14);
  border-radius: 18px;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .08);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease,
              box-shadow .18s ease, background-color .18s ease;
}

.tw-fop-variation-chip:hover:not(:disabled),
.tw-fop-variation-chip:focus-visible {
  border-color: #34d399;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 12px 22px -8px rgba(16, 185, 129, .45);
  transform: translateY(-2px);
  outline: none;
}

.tw-fop-variation-chip:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 10px -4px rgba(16, 185, 129, .4);
}

.tw-fop-variation-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tw-fop-variation-chip__img {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .06);
}

.tw-fop-variation-chip__label {
  flex: 1 1 auto;
  min-width: 110px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #1f2937;
}

.tw-fop-variation-chip__price {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tw-fop-variation-chip__price ins,
.tw-fop-variation-chip__price del { text-decoration: none; }
.tw-fop-variation-chip__price del { opacity: .55; font-weight: 500; margin-left: 4px; }

.tw-fop-variation-chip:hover .tw-fop-variation-chip__price {
  background: #16a34a;
  color: #fff;
}

@media (max-width: 640px) {
  .tw-fop-variation-modal { border-radius: 24px 24px 0 0; }
  .tw-fop-variation-body { grid-template-columns: 1fr; padding: 18px; }
}

/* ── POS grid density toggle ──────────────────────────────────── */
.ms-pos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.megastorevn-pos-terminal .ms-pos-toolbar__search {
  flex: 1;
  min-width: 0;
  max-width: 520px;
}
.megastorevn-pos-terminal .ms-pos-toolbar__search input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 16px 0 42px;
  border: 1.5px solid var(--tw-fop-border);
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--tw-fop-text);
  background-color: var(--tw-fop-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%233375f1' stroke-width='2.2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m16 16-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px 18px;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.megastorevn-pos-terminal .ms-pos-toolbar__search input[type="search"]:focus {
  outline: none;
  border-color: var(--tw-fop-primary);
  box-shadow: 0 0 0 3px rgba(51, 117, 241, .15);
}
/* Remove the native WebKit search clear/decoration so our styling sticks */
.megastorevn-pos-terminal .ms-pos-toolbar__search input[type="search"]::-webkit-search-decoration,
.megastorevn-pos-terminal .ms-pos-toolbar__search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.megastorevn-pos-terminal .ms-pos-toolbar__search input[type="search"]::placeholder {
  color: #3375f1;
  font-weight: 700 !important;
  opacity: 1;
}
/* Shift toolbar clear of the floating reveal arrow when the sidebar is hidden */
.ms-pos-app--nav-collapsed .ms-pos-toolbar { padding-left: 46px; }
.ms-pos-density {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--tw-fop-bg);
  border: 1px solid var(--tw-fop-border);
  border-radius: 10px;
}
.ms-pos-density__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 7px;
  color: var(--tw-fop-text-muted);
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.ms-pos-density__btn:hover { color: var(--tw-fop-text); }
.ms-pos-density__btn.is-active {
  background: var(--tw-fop-surface);
  color: var(--tw-fop-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* Compact mode: 5 columns + 16/9 images */
.ms-pos-main--compact .tw-fop-product-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.ms-pos-main--compact .tw-fop-card__image-wrap {
  aspect-ratio: 16 / 9;
}
.ms-pos-main--compact .tw-fop-card__body {
  padding: 8px 10px 10px;
  gap: 4px;
}
.ms-pos-main--compact .tw-fop-card__name {
  font-size: 13px;
}

@media (max-width: 1280px) {
  .ms-pos-main--compact .tw-fop-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .ms-pos-main--compact .tw-fop-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── POS print settings (QZ Tray) ─────────────────────────────── */
.ms-pos-print { position: relative; }
.ms-pos-print__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--tw-fop-border);
  border-radius: 10px;
  color: var(--tw-fop-text-muted);
  background: var(--tw-fop-surface);
  cursor: pointer;
  transition: color .15s, border-color .15s, background-color .15s;
}
.ms-pos-print__btn:hover { color: var(--tw-fop-text); }
.ms-pos-print__btn.is-on {
  color: #16a34a;
  border-color: #86efac;
  background: #f0fdf4;
}
.ms-pos-print__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 280px;
  padding: 14px;
  background: var(--tw-fop-surface);
  border: 1px solid var(--tw-fop-border);
  border-radius: 14px;
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, .3);
}
.ms-pos-print__title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tw-fop-text);
}
.ms-pos-print__check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 10px;
  cursor: pointer;
}
.ms-pos-print__check input { width: 16px; height: 16px; accent-color: var(--tw-fop-primary); }
.ms-pos-print__select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid var(--tw-fop-border);
  border-radius: 8px;
  background: var(--tw-fop-bg);
  margin-bottom: 10px;
}
.ms-pos-print__actions { display: flex; gap: 8px; }
.ms-pos-print__actions button {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tw-fop-primary);
  background: var(--tw-fop-primary-bg);
  border: 1px solid var(--tw-fop-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .15s;
}
.ms-pos-print__actions button:hover:not(:disabled) { background: var(--tw-fop-primary); color: #fff; }
.ms-pos-print__actions button:disabled { opacity: .5; cursor: not-allowed; }
.ms-pos-print__status {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--tw-fop-text-muted);
  min-height: 14px;
  word-break: break-word;
}
