:root {
  --ink: #111827;
  --muted: #6b7280;
  --paper: #f4f5f7;
  --card: #ffffff;
  --line: #e5e7eb;
  --dark: #121826;
  --green: #0f8f7d;
  --gold: #d6a84f;
  font-family: Arial, "Noto Sans Myanmar", "Myanmar Sangam MN", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #dfe3e8;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  overscroll-behavior-x: contain;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  touch-action: pan-x pan-y pinch-zoom;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 52px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px 26px;
  color: white;
  background: var(--dark);
}

.app-header p,
.app-header h1 {
  margin: 0;
  letter-spacing: 0;
}

.app-header p {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 900;
}

.app-header h1 {
  margin-top: 3px;
  overflow: hidden;
  font-size: 21px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-weight: 900;
}

.header-spacer {
  width: 44px;
  height: 44px;
}

.cart-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-weight: 900;
}

.cart-icon::before {
  content: "✓";
  font-size: 18px;
}

.cart-icon span {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green);
  font-size: 10px;
}

.back-button {
  visibility: hidden;
  font-size: 34px;
  line-height: 1;
}

.back-button.visible {
  visibility: visible;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: center;
  margin: 12px;
  padding: 18px 14px;
  border-radius: 20px;
  color: white;
  background:
    linear-gradient(135deg, rgba(214, 168, 79, 0.22), rgba(15, 143, 125, 0.02)),
    var(--dark);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
}

.hero-card strong,
.hero-card span {
  display: block;
}

.hero-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.hero-card span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.hero-card .contact-line {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.35px;
  white-space: nowrap;
}

.home-section,
.category-summary {
  padding: 0 8px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.section-head h2,
.section-head p,
.category-summary strong,
.category-summary span {
  margin: 0;
}

.section-head h2,
.category-summary strong {
  font-size: 24px;
  line-height: 1;
}

.section-head p,
.category-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-bottom: 14px;
}

.category-card,
.product-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.category-card {
  padding: 0 0 7px;
  border-radius: 10px;
  box-shadow: none;
}

.category-card img {
  width: 100%;
  aspect-ratio: 1 / 1.06;
  object-fit: cover;
  background: #eef1f4;
}

.category-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1.06;
  background: linear-gradient(135deg, #151a24, #2b313c);
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
}

.category-card span,
.category-card small {
  display: block;
  padding: 0 6px;
}

.category-card span {
  margin-top: 6px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5px;
  padding: 2.5px;
}

.empty-products {
  grid-column: 1 / -1;
  margin: 16px 7px;
  padding: 18px;
  border-radius: 14px;
  background: white;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.product-card {
  position: relative;
  padding: 0;
}

.product-photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.select-product {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid white;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: white;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.product-card.selected {
  outline: 3px solid var(--green);
  outline-offset: -3px;
}

.product-card.selected .select-product {
  background: var(--green);
}

.product-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #eef1f4;
}

.product-card.photo-only {
  border-radius: 5px;
  box-shadow: none;
}

.product-card.return-focus {
  position: relative;
  z-index: 2;
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.product-card.photo-only img {
  height: auto;
  aspect-ratio: 3 / 4;
}

#categoryView .product-card img {
  height: auto !important;
  aspect-ratio: 3 / 4 !important;
  object-fit: cover !important;
}

#categoryView .product-card span,
#categoryView .product-card strong,
#categoryView .product-card small {
  display: none !important;
}

.photo-view {
  min-height: calc(100svh - 75px);
  padding: 0 0 12px;
  background: #0f1724;
}

.photo-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: #0f1724;
}

.original-photo {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: fill !important;
  background: #0f1724;
  touch-action: pan-y pinch-zoom;
  transition: transform 180ms ease;
  transform-origin: 50% 50%;
}

.original-photo.zoomed {
  transform: scale(2);
  cursor: zoom-out;
}

.photo-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 15px;
  background: rgba(15, 23, 36, 0.72);
  color: white;
  font-size: 38px;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.photo-arrow-prev { left: 10px; }
.photo-arrow-next { right: 10px; }

.photo-arrow.hidden-while-zoomed {
  opacity: 0;
  pointer-events: none;
}

.photo-counter {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 3;
  min-width: 58px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 36, 0.76);
  color: white;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.photo-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 3;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 36, 0.82);
  color: white;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.photo-hint.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.photo-select-button {
  position: sticky;
  bottom: calc(74px + env(safe-area-inset-bottom));
  display: block;
  width: calc(100% - 24px);
  min-height: 50px;
  margin: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 143, 125, 0.3);
}

.photo-select-button.selected {
  background: var(--gold);
  color: var(--dark);
}

.product-card span,
.product-card strong,
.product-card small {
  display: block;
  padding: 0 9px;
}

.product-card span {
  margin-top: 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.product-card strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-card {
  margin: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
}

.detail-image {
  width: 100%;
  aspect-ratio: 1 / 1.18;
  object-fit: cover;
  background: #eef1f4;
  touch-action: pan-x pan-y pinch-zoom;
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.detail-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title span,
.detail-title strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-title h2 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1;
}

.detail-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.detail-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.detail-order-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 82px;
  gap: 10px;
  align-items: end;
}

.detail-field,
.detail-sku,
.detail-qty {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.detail-field span,
.detail-sku span,
.detail-qty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-field strong,
.detail-sku strong {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-controls label,
.customer-panel label,
.order-message {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-controls select,
.detail-controls input,
.detail-qty input,
.customer-panel input,
.order-message textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  outline: none;
}

.detail-controls select,
.detail-controls input,
.detail-qty input,
.customer-panel input {
  height: 46px;
  padding: 0 8px;
}

.add-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.customer-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

.cart-panel {
  margin: 0 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--dark);
  color: white;
}

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

.cart-head span,
.cart-head strong {
  display: block;
}

.cart-head span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.cart-head strong {
  margin-top: 3px;
  font-size: 21px;
}

.cart-head button,
.cart-item [data-remove] {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.cart-head button {
  min-width: 64px;
  height: 34px;
}

.cart-items {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.empty-cart {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.cart-product {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.cart-thumb {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.cart-thumb img {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: cover;
}

.cart-product div {
  min-width: 0;
}

.cart-item strong,
.cart-item span {
  display: block;
}

.cart-item strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.cart-item [data-remove] {
  flex: 0 0 auto;
  min-width: 64px;
  height: 32px;
}

.order-message {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.62);
}

.preview-photo {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: calc(100svh - 150px);
  padding: 10px;
  border: 0;
  background: #0f1724;
}

.preview-photo img {
  display: block;
  width: 100%;
  max-height: calc(100svh - 170px);
  object-fit: contain;
}

.order-message textarea {
  resize: vertical;
  padding: 10px 11px;
}

.send-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.send-actions a,
.send-actions button,
.bottom-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.send-actions a {
  background: var(--green);
}

.send-actions #submitOrder {
  background: var(--green);
}

.send-actions #submitOrder:disabled {
  opacity: 0.68;
}

.order-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.send-actions button {
  background: rgba(255, 255, 255, 0.16);
}

.bottom-spacer {
  height: calc(82px + env(safe-area-inset-bottom));
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244, 245, 247, 0), rgba(244, 245, 247, 0.96) 30%);
}

.bottom-nav button {
  background: #111827;
}

.bottom-nav strong {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--green);
  font-size: 12px;
}

@media (min-width: 431px) {
  body {
    background: #dfe3e8;
  }
}

@media (max-width: 360px) {
  .category-grid,
  .product-list {
    gap: 8px;
  }

  .category-card span,
  .product-card strong {
    font-size: 13px;
  }
}
