/* FLAMQO CHINA — strict black & white, no shadows, no gray colors. */

:root {
  --bg: #ffffff;
  --fg: #000000;
  --line: rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --gap: 14px;
  --pad: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #ffffff;
    --line: rgba(255, 255, 255, 0.16);
  }
}

html[data-theme="light"] {
  --bg: #ffffff;
  --fg: #000000;
  --line: rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] {
  --bg: #000000;
  --fg: #ffffff;
  --line: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font-family: inherit;
  color: inherit;
  font-size: inherit;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) var(--pad) 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn[hidden] {
  display: none;
}

.admin-entry {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.main {
  display: block;
}

.view[hidden] {
  display: none;
}

.filters,
.tabs {
  display: flex;
  gap: 8px;
  padding: 12px var(--pad);
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar,
.tabs::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  padding: 0 var(--pad) 32px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
  cursor: pointer;
}

.card:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  overflow: hidden;
}

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

.media--empty {
  display: grid;
  place-items: center;
}

.media-mark {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #000000;
  opacity: 0.3;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}

.name {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.price {
  font-size: 14px;
  font-weight: 600;
}

/* ------------------------------------------------------------- product view */

.back {
  margin: 12px var(--pad) 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.gallery {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: #ffffff;
  margin-top: 4px;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  scroll-snap-align: start;
  display: block;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
}

.dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  opacity: 0.25;
  cursor: pointer;
}

.dot--active {
  opacity: 0.9;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px var(--pad) 40px;
}

.p-name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.p-price {
  font-size: 18px;
  font-weight: 600;
}

.p-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.size {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.size[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.size[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.buy {
  width: 100%;
  margin-top: 6px;
  padding: 13px 12px;
  border: 1px solid var(--fg);
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.buy[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.buy:not([disabled]):active {
  background: var(--fg);
  color: var(--bg);
}

/* ------------------------------------------------------------------- admin */

.admin-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 var(--pad);
}

.admin-title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.3;
}

.admin-body {
  padding: 0 var(--pad) 40px;
}

.admin-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.admin-row:first-child {
  border-top: 1px solid var(--line);
}

.admin-row-main {
  min-width: 0;
}

.admin-name {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-meta {
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.3;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.btn {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.btn--solid {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn--wide {
  width: 100%;
  padding: 11px;
  font-size: 13px;
  border-radius: 10px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field > span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.3;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--fg);
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row > .field {
  flex: 1;
}

.cat-input {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  outline: none;
}

.cat-input:focus {
  border-color: var(--fg);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.thumb {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.thumb-actions {
  display: flex;
  gap: 4px;
  padding: 6px;
}

.thumb-actions .btn {
  flex: 1;
  padding: 5px 4px;
  font-size: 10px;
}

.form-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.form-actions .btn {
  flex: 1;
  padding: 11px;
  font-size: 13px;
  border-radius: 10px;
}

.state {
  padding: 40px var(--pad);
  text-align: center;
  font-size: 13px;
  opacity: 0.3;
}

.footer {
  padding: 0 var(--pad) calc(28px + env(safe-area-inset-bottom));
  font-size: 11px;
  text-align: center;
  opacity: 0.3;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
