:root {
  --lomwaan-cream: #fcf5ea;
  --lomwaan-card: #ffffff;
  --lomwaan-brown: #493126;
  --lomwaan-brown-soft: #76513e;
  --lomwaan-muted: #80675a;
  --lomwaan-border: #eadccf;
  --lomwaan-green: #496a3b;
  --lomwaan-shadow: 0 8px 26px rgba(73, 49, 38, 0.09);
}

html {
  background: var(--lomwaan-cream);
}

body.store-page {
  margin: 0;
  min-height: 100vh;
  background: var(--lomwaan-cream);
  color: var(--lomwaan-brown);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Noto Sans Thai",
    "Segoe UI",
    sans-serif;
}

.store-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100% - 28px, 620px);
  margin: 0 auto;
  padding: 16px 0 10px;
  text-align: left;
}

.store-logo {
  width: 54px;
  height: 54px;
  margin: 0;
  flex: 0 0 54px;
  object-fit: contain;
}

.store-header-copy {
  min-width: 0;
}

.store-header-copy h1 {
  margin: 0;
  color: var(--lomwaan-brown);
  font-size: clamp(20px, 5.2vw, 25px);
  line-height: 1.25;
}

.store-header-copy p {
  margin: 3px 0 0;
  color: var(--lomwaan-muted);
  font-size: 13px;
  line-height: 1.4;
}

.store-container {
  box-sizing: border-box;
  width: min(100% - 28px, 620px);
  margin: 0 auto;
  padding: 2px 0 calc(132px + env(safe-area-inset-bottom));
}

.store-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}

.store-section-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.store-section-heading span {
  color: var(--lomwaan-muted);
  font-size: 12px;
  white-space: nowrap;
}

.products-list {
  display: grid;
  gap: 10px;
}

.product-card-compact {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  min-height: 108px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--lomwaan-border);
  border-radius: 16px;
  background: var(--lomwaan-card);
  box-shadow: 0 3px 12px rgba(73, 49, 38, 0.06);
}

.product-image-wrap {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 12px;
  background: #faf6f0;
}

.product-card-compact .product-image {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
}

.product-card-compact .product-image-placeholder {
  width: 70%;
  height: 70%;
  opacity: 0.65;
}

.product-info-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.product-copy {
  min-width: 0;
}

.product-info-compact h3 {
  margin: 0;
  overflow: hidden;
  color: var(--lomwaan-brown);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info-compact .product-detail {
  margin: 3px 0 5px;
  overflow: hidden;
  color: var(--lomwaan-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info-compact .price {
  margin: 0;
  color: var(--lomwaan-brown-soft);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.product-info-compact .quantity-control {
  display: grid;
  grid-template-columns: 36px 28px 36px;
  align-items: center;
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--lomwaan-border);
  border-radius: 12px;
  background: #fff;
}

.product-info-compact .quantity-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--lomwaan-brown);
  font-size: 22px;
  line-height: 1;
}

.product-info-compact .quantity-button:disabled {
  color: #cfc2ba;
  opacity: 1;
}

.product-info-compact .quantity-number {
  min-width: 28px;
  color: var(--lomwaan-brown);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.order-summary-compact {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border: 1px solid var(--lomwaan-border);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 28px rgba(73, 49, 38, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.order-summary-compact > h2,
.order-summary-compact .summary-row,
.order-summary-compact .grand-total {
  display: none;
}

.compact-summary-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.compact-summary-quantity,
.compact-summary-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.compact-summary-top span {
  color: var(--lomwaan-muted);
  font-size: 12px;
  white-space: nowrap;
}

.compact-summary-quantity strong {
  color: var(--lomwaan-brown);
  font-size: 15px;
  white-space: nowrap;
}

.compact-summary-total strong {
  color: var(--lomwaan-green);
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.compact-summary-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--lomwaan-muted);
  font-size: 11px;
  white-space: nowrap;
}

.compact-summary-meta strong {
  color: var(--lomwaan-brown-soft);
  font-weight: 700;
}

.compact-summary-dot {
  color: #cbb9ad;
}

.order-summary-compact .minimum-message {
  margin: 0 0 0 auto;
  overflow: hidden;
  color: var(--lomwaan-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-summary-compact .minimum-complete {
  color: var(--lomwaan-green);
}

.compact-continue-button {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--lomwaan-brown-soft);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.compact-continue-button:disabled {
  background: #d9cec7;
  color: #fff;
  opacity: 1;
}

.store-loading,
.store-error {
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid var(--lomwaan-border);
  border-radius: 14px;
  background: #fff;
  color: var(--lomwaan-muted);
  font-size: 14px;
  text-align: center;
}

.store-error {
  display: grid;
  gap: 4px;
  color: #884b43;
}

@media (max-width: 380px) {
  .store-header {
    width: min(100% - 20px, 620px);
  }

  .store-container {
    width: min(100% - 20px, 620px);
  }

  .product-card-compact {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 9px;
    padding: 8px;
  }

  .product-image-wrap {
    width: 76px;
    height: 82px;
  }

  .product-info-compact {
    gap: 6px;
  }

  .product-info-compact .quantity-control {
    grid-template-columns: 32px 24px 32px;
  }

  .product-info-compact .quantity-button {
    width: 32px;
  }

  .product-info-compact .quantity-number {
    min-width: 24px;
  }
}

@media (min-width: 700px) {
  .order-summary-compact {
    bottom: 14px;
    border-bottom: 1px solid var(--lomwaan-border);
    border-radius: 18px;
  }

  .store-container {
    padding-bottom: 150px;
  }
}
