:root {
  --bg-top: #eff4fb;
  --bg-mid: #e6edf7;
  --bg-bottom: #dfe7f3;
  --panel-dark-a: #263754;
  --panel-dark-b: #18253a;
  --panel-dark-c: #121d2f;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --card-dark: rgba(8, 18, 34, 0.42);
  --line-soft: rgba(60, 88, 130, 0.18);
  --line-strong: rgba(176, 202, 242, 0.2);
  --ink-strong: #10213e;
  --ink-mid: #30486f;
  --ink-soft: #667b9f;
  --white-soft: rgba(241, 247, 255, 0.92);
  --accent: #ff415f;
  --accent-strong: #da2749;
  --accent-soft: rgba(255, 65, 95, 0.16);
  --green: #16a34a;
  --shadow-deep: 0 28px 62px rgba(17, 32, 57, 0.16);
  --shadow-soft: 0 16px 38px rgba(17, 32, 57, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

html.kiosk-lite {
  scroll-behavior: auto;
}

html.webos-app {
  scroll-behavior: auto;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  color: var(--ink-strong);
  font-family: "Manrope", "Segoe UI", Tahoma, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.12) 30%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
  position: relative;
  overflow-x: hidden;
}

body.webos-app {
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(135deg, rgba(25, 48, 86, 0.03) 8%, transparent 8%, transparent 52%, rgba(25, 48, 86, 0.03) 52%, rgba(25, 48, 86, 0.03) 60%, transparent 60%, transparent 100%);
  background-size: 260px 240px;
}

body.modal-open {
  overflow: hidden;
}

body.kiosk-lite {
  background: linear-gradient(180deg, #eff4fb 0%, #e3ebf6 100%);
  touch-action: pan-y;
}

body.kiosk-lite::before {
  display: none;
}

body.webos-app::before,
body.webos-app .ambient {
  display: none;
}

a {
  color: inherit;
}

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

button,
.btn,
.thumb-button,
.option-button,
.clear-search,
[data-product-action] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.category-pill,
[data-category-id],
.product-card {
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(18px);
  z-index: 0;
}

body.kiosk-lite .ambient {
  display: none;
}

.ambient-one {
  width: 50vw;
  height: 50vw;
  top: -12vw;
  left: -9vw;
  background: radial-gradient(circle, rgba(77, 113, 180, 0.34) 0%, rgba(77, 113, 180, 0) 70%);
}

.ambient-two {
  width: 48vw;
  height: 48vw;
  right: -14vw;
  bottom: -14vw;
  background: radial-gradient(circle, rgba(221, 49, 91, 0.24) 0%, rgba(221, 49, 91, 0) 72%);
}

.shop-shell {
  position: relative;
  z-index: 1;
  width: min(1920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
  display: grid;
  gap: 14px;
  touch-action: pan-y;
}

body.webos-app .shop-shell,
body.webos-app .catalog-panel,
body.webos-app .product-grid,
body.webos-app .modal-card {
  touch-action: pan-y;
}

.panel-dark {
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  color: #e7f0ff;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 34%),
    linear-gradient(145deg, var(--panel-dark-a) 0%, var(--panel-dark-b) 48%, var(--panel-dark-c) 100%);
  box-shadow: var(--shadow-deep);
}

.panel-soft {
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(241, 247, 255, 0.86) 100%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.82), rgba(230, 239, 252, 0.62));
  box-shadow: var(--shadow-soft);
}

body.kiosk-lite .panel-dark {
  background: linear-gradient(180deg, #263754 0%, #162338 100%);
  box-shadow: 0 12px 28px rgba(17, 32, 57, 0.1);
}

body.kiosk-lite .panel-soft {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(17, 32, 57, 0.08);
}

body.webos-app .panel-dark {
  background: linear-gradient(180deg, #263754 0%, #162338 100%);
  box-shadow: 0 10px 22px rgba(17, 32, 57, 0.08);
}

body.webos-app .panel-soft {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(17, 32, 57, 0.06);
}

.kicker,
.panel-kicker,
.section-kicker {
  margin: 0 0 8px;
  font-family: "Rajdhani", "Manrope", sans-serif;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.kicker {
  color: rgba(218, 229, 248, 0.82);
}

.section-kicker,
.panel-kicker {
  color: #6b7d9e;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Rajdhani", "Manrope", sans-serif;
  letter-spacing: 0.01em;
}

body.webos-app h1,
body.webos-app h2,
body.webos-app h3,
body.webos-app h4,
body.webos-app .btn,
body.webos-app .badge,
body.webos-app .price-value,
body.webos-app .kicker,
body.webos-app .panel-kicker,
body.webos-app .section-kicker {
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.subtext {
  margin: 0;
  color: rgba(219, 230, 248, 0.86);
  line-height: 1.62;
}

.search-shell {
  padding: 14px 16px 12px;
  display: grid;
  gap: 8px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 16px;
  min-height: 48px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  font-family: "Rajdhani", "Manrope", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

body.kiosk-lite .btn,
body.kiosk-lite .category-pill,
body.kiosk-lite .product-card {
  transition: none;
}

body.webos-app .btn,
body.webos-app .category-pill,
body.webos-app .product-card,
body.webos-app #webPageFrame {
  transition: none;
}

body.kiosk-lite .btn:hover,
body.kiosk-lite .category-pill:hover,
body.kiosk-lite .product-card:hover {
  transform: none;
}

body.webos-app .btn:hover,
body.webos-app .category-pill:hover,
body.webos-app .product-card:hover {
  transform: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 24px rgba(218, 39, 73, 0.26);
}

body.webos-app .btn-primary {
  box-shadow: none;
}

.btn-outline {
  color: var(--white-soft);
  border-color: rgba(193, 214, 247, 0.24);
  background: rgba(8, 19, 37, 0.34);
}

.btn-ghost {
  color: #dce9ff;
  border-color: rgba(188, 211, 246, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.master-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(195, 216, 247, 0.18);
  background: rgba(8, 19, 37, 0.38);
}

.master-search input {
  flex: 1;
  border: 0;
  padding: 0;
  background: transparent;
  color: #edf3ff;
  outline: none;
  font-size: 1.02rem;
}

.master-search input::placeholder {
  color: rgba(194, 209, 236, 0.72);
}

.hero-search-icon,
.clear-search {
  color: rgba(217, 229, 248, 0.74);
  font-size: 1.1rem;
}

.clear-search {
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.status-text {
  min-height: 1.2rem;
  margin: 0;
  color: rgba(226, 235, 249, 0.84);
  font-size: 0.88rem;
}

.catalog-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
  touch-action: pan-y;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.catalog-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.catalog-heading h2 {
  font-size: clamp(1.5rem, 2.1vw, 2rem);
  color: var(--ink-strong);
}

.catalog-count {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.sort-control select {
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid rgba(93, 121, 166, 0.22);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-strong);
  padding: 10px 14px;
  font: inherit;
  outline: none;
}

.sort-control select:focus {
  border-color: rgba(255, 83, 113, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 83, 113, 0.12);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill {
  border: 1px solid rgba(93, 121, 166, 0.24);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-mid);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.category-pill:hover {
  transform: translateY(-1px);
}

.category-pill.active {
  color: #fff;
  border-color: rgba(255, 84, 112, 0.54);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 20px rgba(218, 39, 73, 0.18);
}

body.kiosk-lite .category-pill.active {
  box-shadow: none;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  touch-action: pan-y;
}

.product-card {
  display: grid;
  gap: 0;
  border: 1px solid rgba(92, 121, 166, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-strong);
  color: var(--ink-strong);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 85, 116, 0.3);
  box-shadow: 0 18px 30px rgba(21, 35, 60, 0.12);
}

body.kiosk-lite .product-card,
body.kiosk-lite .product-card:hover {
  box-shadow: 0 8px 18px rgba(17, 32, 57, 0.08);
}

body.webos-app .product-card,
body.webos-app .product-card:hover {
  box-shadow: none;
  border-color: rgba(92, 121, 166, 0.12);
}

.product-card-media {
  position: relative;
  aspect-ratio: 1.08 / 1;
  background: linear-gradient(160deg, rgba(226, 236, 250, 0.72), rgba(203, 219, 243, 0.9));
}

body.webos-app .product-card-media::after {
  display: none;
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.webos-app .deferred-card-image {
  opacity: 0;
}

body.webos-app .deferred-card-image.is-ready {
  opacity: 1;
}

.product-card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(7, 18, 35, 0) 0%, rgba(7, 18, 35, 0.16) 100%);
  pointer-events: none;
}

.product-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-category {
  color: #10213c;
  background: rgba(255, 255, 255, 0.88);
}

.badge-type {
  color: #fff;
  background: rgba(16, 33, 60, 0.76);
}

.product-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.product-card-title {
  font-size: 1.06rem;
  line-height: 1.15;
}

.product-card-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
  min-height: 3.9em;
}

.product-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
}

.price-caption {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d83a8;
}

.price-value {
  font-family: "Rajdhani", "Manrope", sans-serif;
  font-size: 1.15rem;
  color: var(--accent-strong);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-mid);
  font-weight: 700;
  font-size: 0.85rem;
}

.card-cta::after {
  content: "→";
}

.empty-state {
  min-height: 220px;
  border: 1px dashed rgba(94, 120, 163, 0.34);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state h3 {
  color: var(--ink-strong);
  margin-bottom: 8px;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid rgba(117, 143, 184, 0.24);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 13, 27, 0.68);
  backdrop-filter: blur(6px);
}

body.kiosk-lite .modal-backdrop {
  background: rgba(5, 13, 27, 0.8);
  backdrop-filter: none;
}

body.webos-app .modal-backdrop {
  background: rgba(5, 13, 27, 0.78);
  backdrop-filter: none;
}

.modal-card {
  position: relative;
  width: min(1160px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 22px;
}

body.webos-app .modal-card {
  box-shadow: 0 12px 28px rgba(17, 32, 57, 0.16);
}

.modal-product {
  width: min(1480px, calc(100vw - 24px));
}

.modal-form {
  width: min(920px, calc(100vw - 24px));
}

.modal-tall {
  width: min(980px, calc(100vw - 24px));
}

.modal-browser {
  width: min(1720px, calc(100vw - 24px));
  height: min(94vh, calc(100vh - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-header h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  color: #eef5ff;
}

.modal-product #productModalContent {
  display: grid;
  gap: 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.9fr);
  gap: 22px;
}

.detail-media-panel,
.detail-copy-panel,
.build-panel,
.summary-panel,
.qr-panel,
.field-card,
.selection-banner {
  border: 1px solid rgba(191, 212, 245, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
}

.detail-media-panel,
.detail-copy-panel {
  padding: 18px;
}

body.webos-app .detail-media-panel,
body.webos-app .detail-copy-panel,
body.webos-app .build-panel,
body.webos-app .summary-panel,
body.webos-app .qr-panel,
body.webos-app .field-card,
body.webos-app .selection-banner {
  background: rgba(255, 255, 255, 0.035);
}

.qr-panel-collapsed {
  display: grid;
  gap: 12px;
}

.gallery-stage {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.08);
}

body.webos-app .gallery-stage {
  background: rgba(255, 255, 255, 0.05);
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(218, 231, 251, 0.72);
  font-size: 1rem;
}

.gallery-nav {
  position: absolute;
  inset: 50% 14px auto 14px;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.gallery-nav button {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 18, 35, 0.58);
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
}

.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.detail-loading {
  min-height: min(72vh, 720px);
  display: grid;
  place-items: center;
  gap: 16px;
  text-align: center;
  padding: 32px;
}

.detail-loading h3,
.detail-loading p {
  margin: 0;
}

.detail-loading h3 {
  color: #eef5ff;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.detail-loading p {
  color: rgba(220, 230, 247, 0.82);
}

.thumb-button {
  width: 70px;
  height: 70px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(194, 214, 247, 0.12);
  background: rgba(8, 19, 37, 0.22);
  cursor: pointer;
}

.thumb-button.active {
  border-color: rgba(255, 92, 122, 0.66);
  box-shadow: 0 0 0 2px rgba(255, 92, 122, 0.18);
}

.thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-title {
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: #fff;
}

.detail-sku {
  margin: -8px 0 2px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(198, 212, 238, 0.76);
}

.detail-description {
  margin: 0;
  color: rgba(225, 234, 248, 0.9);
  line-height: 1.72;
}

.detail-price {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(8, 18, 35, 0.32);
}

.detail-price strong {
  font-family: "Rajdhani", "Manrope", sans-serif;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  color: #fff;
}

.detail-price .price-caption {
  color: rgba(198, 212, 238, 0.72);
}

.detail-price .price-value {
  color: #fff;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.build-panel,
.summary-panel,
.qr-panel,
.field-card {
  padding: 18px;
}

.build-panel h3,
.summary-panel h3,
.qr-panel h3,
.field-card h3 {
  font-size: 1.45rem;
  color: #fff;
  margin-bottom: 8px;
}

.panel-copy,
.field-card-header p,
.summary-empty,
.selection-copy {
  margin: 0;
  color: rgba(220, 230, 247, 0.84);
  line-height: 1.65;
}

.build-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.build-section h4 {
  font-size: 1.02rem;
  color: #eef5ff;
}

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

.option-button {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(194, 214, 247, 0.14);
  border-radius: 18px;
  padding: 14px;
  background: rgba(8, 18, 35, 0.22);
  color: #eef5ff;
  cursor: pointer;
}

.option-button.active {
  border-color: rgba(255, 95, 122, 0.7);
  background: linear-gradient(135deg, rgba(255, 65, 95, 0.2), rgba(255, 65, 95, 0.08));
}

.option-button-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.option-price {
  color: #ff9aaa;
  font-family: "Rajdhani", "Manrope", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.option-details {
  margin: 6px 0 0;
  color: rgba(220, 230, 247, 0.75);
  line-height: 1.6;
}

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

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(196, 215, 246, 0.1);
  padding-bottom: 10px;
}

.summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-row dt {
  color: rgba(193, 209, 235, 0.75);
}

.summary-row dd {
  margin: 0;
  text-align: right;
  color: #fff;
}

.summary-row.total dd {
  color: #ff9aaa;
  font-weight: 700;
  font-size: 1.12rem;
}

.qr-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.qr-canvas {
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 20px;
  padding: 12px;
}

.qr-canvas img,
.qr-canvas canvas {
  max-width: 100%;
  height: auto;
}

.qr-copy {
  display: grid;
  gap: 10px;
}

.webpage-frame-shell {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(191, 212, 245, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.webpage-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background: rgba(13, 24, 42, 0.92);
}

.webpage-loading p {
  margin: 0;
  color: rgba(220, 230, 247, 0.84);
}

.webpage-frame-shell.frame-loading #webPageFrame {
  opacity: 0;
  pointer-events: none;
}

#webPageFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
  transition: opacity 160ms ease;
}

body.webos-app #webPageFrame {
  transition: none;
}

.detail-warning {
  border: 1px solid rgba(255, 113, 138, 0.3);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 65, 95, 0.08);
  color: #fff3f6;
}

.detail-warning h3 {
  margin-bottom: 6px;
}

.selection-banner {
  width: 100%;
  margin-bottom: 18px;
  padding: 16px;
}

.selection-banner strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 1.05rem;
}

.selection-banner span,
.selection-banner p {
  margin: 0;
  color: rgba(221, 231, 248, 0.84);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: rgba(223, 234, 249, 0.92);
  font-size: 0.87rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.span-2 {
  grid-column: span 2;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
  width: 100%;
  border: 1px solid rgba(193, 214, 247, 0.16);
  border-radius: 16px;
  padding: 12px 13px;
  color: #f2f7ff;
  background: rgba(8, 18, 35, 0.34);
  outline: none;
}

.form-grid textarea {
  resize: vertical;
  min-height: 120px;
}

.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  border-color: rgba(255, 95, 122, 0.62);
  box-shadow: 0 0 0 2px rgba(255, 95, 122, 0.18);
}

.form-grid input::placeholder,
.form-grid textarea::placeholder {
  color: rgba(192, 208, 235, 0.66);
}

.form-actions {
  display: grid;
  gap: 10px;
}

.error-text {
  min-height: 1.2rem;
  margin: 0;
  color: #ff9dad;
}

.field-card-header {
  margin-bottom: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(194, 214, 247, 0.14);
  background: rgba(8, 18, 35, 0.24);
  color: #eef5ff;
}

.checkbox-tile input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.dynamic-fields {
  display: grid;
  gap: 14px;
}

.dynamic-field {
  display: grid;
  gap: 8px;
}

.dynamic-field label,
.dynamic-field legend {
  color: rgba(223, 234, 249, 0.94);
  font-size: 0.87rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dynamic-field legend {
  padding: 0;
  margin-bottom: 6px;
}

.dynamic-field fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.dynamic-field-options {
  display: grid;
  gap: 10px;
}

.dynamic-field-options.select-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dynamic-field-options .checkbox-tile {
  min-height: 48px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(190, 212, 245, 0.18);
  color: #fff;
  background: linear-gradient(145deg, rgba(38, 55, 84, 0.96), rgba(18, 29, 47, 0.96));
  box-shadow: 0 18px 34px rgba(8, 18, 35, 0.28);
}

body.kiosk-lite .toast {
  box-shadow: 0 12px 24px rgba(8, 18, 35, 0.18);
}

.toast.success {
  border-color: rgba(68, 211, 122, 0.28);
}

.toast.error {
  border-color: rgba(255, 95, 122, 0.36);
}

@media (max-width: 1180px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .qr-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .shop-shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 18px;
  }

  .search-shell,
  .catalog-panel,
  .modal-card {
    padding: 18px;
  }

  .catalog-heading,
  .catalog-toolbar,
  .modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-control {
    display: grid;
    gap: 8px;
  }

  .sort-control select {
    min-width: 0;
    width: 100%;
  }

  .form-grid,
  .dynamic-field-options.select-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

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

@media (max-width: 620px) {
  .shop-shell {
    width: min(100%, calc(100% - 14px));
  }

  .detail-actions,
  .form-actions .btn {
    width: 100%;
  }

  .detail-actions .btn,
  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .product-card-footer,
  .summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-row dd {
    text-align: left;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .modal-header-actions {
    width: 100%;
  }

  .modal-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .thumb-button {
    width: 58px;
    height: 58px;
  }
}
