html, body {
  height: 100%;
  overflow: hidden;
}

.kiosk-layout {
  display: flex;
  height: 100vh;
}

/* --- Left panel: gallery or payment --- */

.kiosk-left {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
}

.category-label {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.category-label:first-child {
  margin-top: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.product-tile {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.product-tile:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.product-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--border);
  display: block;
}

.product-tile .placeholder-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
}

.product-tile-info {
  padding: 10px 12px;
}

.product-tile-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.product-tile-price {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

/* --- Right panel: cart --- */

.kiosk-right {
  width: 340px;
  min-width: 340px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.cart-header {
  padding: 20px 20px 12px;
  font-size: 22px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.cart-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 16px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

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

.cart-item-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-qty span {
  font-size: 16px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-remove {
  background: none;
  color: var(--danger);
  padding: 4px 8px;
  font-size: 20px;
}

.cart-footer {
  border-top: 2px solid var(--border);
  padding: 16px 20px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
}

.cart-footer .btn-primary {
  width: 100%;
  font-size: 20px;
  padding: 16px;
  font-weight: 700;
}

/* --- Payment screen (replaces gallery) --- */

.payment-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.payment-screen h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.payment-screen .payment-subtitle {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 40px;
}

.payment-method {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.payment-method:hover {
  border-color: var(--primary);
}

.payment-method.selected {
  border-color: var(--primary);
  background: #fdf5f0;
}

.payment-done-btn {
  width: 100%;
  max-width: 500px;
  font-size: 22px;
  padding: 20px;
  font-weight: 700;
}

.payment-done-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.payment-back {
  margin-top: 16px;
  background: none;
  color: var(--text-light);
  font-size: 16px;
  text-decoration: underline;
}

/* --- Toast notification --- */

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--success);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}
