:root {
  --page-bg: #121a1d;
  --pattern: #1e2527;
  --surface: #222222;
  --surface-2: #2b2b2b;
  --surface-3: #181818;
  --line: #3b3b3b;
  --text: #f3f3f3;
  --muted: #b7b7b7;
  --soft: #8f8f8f;
  --yellow: #fff25c;
  --gold: #ffd743;
  --red: #b72b22;
  --red-2: #e34936;
  --orange: #ff8b24;
  --blue: #4f9dff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 28rem),
    var(--page-bg);
  color: var(--text);
  font-family:
    Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

body::before,
.shop-frame::before,
.modal::before {
  background-image:
    linear-gradient(30deg, rgba(255, 255, 255, 0.025) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.025) 87.5%, rgba(255, 255, 255, 0.025)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.025) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.025) 87.5%, rgba(255, 255, 255, 0.025)),
    linear-gradient(30deg, rgba(255, 255, 255, 0.025) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.025) 87.5%, rgba(255, 255, 255, 0.025)),
    linear-gradient(150deg, rgba(255, 255, 255, 0.025) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, 0.025) 87.5%, rgba(255, 255, 255, 0.025));
  background-position:
    0 0,
    0 0,
    16px 28px,
    16px 28px;
  background-size: 32px 56px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
}

.shop-frame {
  position: relative;
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  border-right: 1px solid #2f4549;
  border-left: 1px solid #2f4549;
  background: #1b1b1b;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.45);
}

.shop-frame::before {
  position: absolute;
  inset: 0;
  opacity: 1;
  content: "";
  pointer-events: none;
}

.shop-frame > * {
  position: relative;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 86px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #333;
  background: rgba(31, 31, 31, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.menu-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 12px;
}

.menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #d7d7d7;
}

.site-logo {
  justify-self: center;
  color: #f6f6f6;
  font-size: 0.96rem;
  font-weight: 800;
  text-decoration: none;
}

.site-logo span {
  color: #f34b38;
}

.login-link {
  justify-self: stretch;
  color: #a5a5a5;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  padding-right: 10px;
  text-align: left;
  text-decoration: none;
}

main {
  padding: 18px 0 40px;
}

.notice-panel {
  padding: 30px 4px 22px;
}

.notice-panel h1,
.notice-panel p {
  margin: 0 0 6px;
  color: var(--yellow);
  font-size: 0.98rem;
  font-weight: 900;
}

.notice-panel h1::before,
.notice-panel p::before {
  color: #ff5f32;
  content: "✹ ";
}

.catalog-section {
  padding: 0 0 24px;
}

.category-block + .category-block {
  margin-top: 26px;
}

.section-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-heading::after {
  height: 1px;
  background: #555;
  content: "";
}

.section-heading h2 {
  order: 1;
  min-width: 0;
  margin: 0;
  border-radius: 0 999px 999px 0;
  background: var(--red);
  color: #ffffff;
  padding: 8px 14px 8px 12px;
  font-size: 0.98rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-heading h2::before {
  content: "✿ ";
}

.section-heading::after {
  order: 2;
}

.section-heading a,
.section-heading button {
  order: 3;
  border: 0;
  background: transparent;
  color: var(--red-2);
  font-size: 0.78rem;
  font-weight: 900;
  padding-right: 8px;
  text-decoration: none;
}

.catalog-toolbar {
  display: grid;
  gap: 10px;
  padding: 0 8px 12px;
}

.search-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  border: 1px solid #3b3b3b;
  border-radius: 6px;
  background: #141414;
  color: #fff;
  outline: none;
  padding: 10px 12px;
}

.search-field input:focus {
  border-color: var(--red-2);
  box-shadow: 0 0 0 3px rgba(227, 73, 54, 0.16);
}

.filter-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-tab {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid #464646;
  border-radius: 6px;
  background: #252525;
  color: #cfcfcf;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.filter-tab.is-active,
.filter-tab:hover,
.filter-tab:focus-visible {
  border-color: var(--red-2);
  background: #3a1d1a;
  color: #ffffff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
  padding: 0 2px;
}

.product-card {
  min-width: 0;
  overflow: hidden;
  background: #242424;
}

.product-card__image {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #101010;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-position, center);
}

.hot-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 2px;
  background: var(--red-2);
  color: #fff;
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 900;
}

.rating-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  border-radius: 999px;
  background: rgba(63, 63, 63, 0.86);
  color: var(--gold);
  padding: 1px 6px;
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1.2;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 8px;
}

.tag-list span {
  border-radius: 4px;
  background: #484848;
  color: #d7d7d7;
  padding: 3px 6px;
  font-size: 0.62rem;
  font-weight: 800;
}

.product-card__body {
  padding: 0 2px 4px;
}

.product-card h3 {
  margin: 0 0 5px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.42;
}

.product-card p {
  margin: 0 0 8px;
  color: #d5d5d5;
  font-size: 0.84rem;
  font-weight: 700;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 9px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.product-meta strong {
  color: var(--orange);
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.primary-button,
.secondary-button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.primary-button {
  background: var(--red);
  color: #fff;
}

.secondary-button {
  background: #3c3c3c;
  color: #ffffff;
}

.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  filter: brightness(1.1);
}

.empty-state {
  margin: 18px 8px 0;
  border: 1px dashed #555;
  border-radius: 6px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.seller-panel {
  margin: 8px 8px 0;
  border-top: 1px solid #383838;
  padding-top: 16px;
}

.seller-panel h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 1rem;
}

.contact-list {
  display: grid;
  gap: 8px;
}

.contact-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #272727;
  padding: 9px 10px;
  text-decoration: none;
}

.contact-link span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.contact-link strong {
  color: #ffffff;
  font-size: 0.86rem;
  text-align: right;
}

.contact-link:hover,
.contact-link:focus-visible {
  border-color: var(--red-2);
  background: #321f1d;
}

.modal[hidden] {
  display: none;
}

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

.modal::before {
  position: absolute;
  inset: 0;
  background-color: rgba(16, 16, 16, 0.96);
  content: "";
}

.modal-backdrop {
  position: absolute;
  inset: 0;
}

.detail-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: 100vh;
  overflow-y: auto;
  background: #1e1e1e;
  box-shadow: var(--shadow);
}

.detail-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid #333;
  background: rgba(30, 30, 30, 0.96);
}

.detail-header p,
.detail-header h2 {
  margin: 0;
  text-align: center;
}

.detail-header p {
  color: var(--orange);
  font-size: 0.7rem;
  font-weight: 900;
}

.detail-header h2 {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.25;
}

.back-button,
.close-button {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
}

.close-button.light {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 5px;
  background: #333;
}

.detail-gallery {
  background: #141414;
}

.modal-image-wrap {
  position: relative;
  display: grid;
  min-height: 300px;
  max-height: 60vh;
  place-items: center;
}

.modal-image-wrap img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 36px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 2rem;
  transform: translateY(-50%);
}

.gallery-prev {
  left: 8px;
}

.gallery-next {
  right: 8px;
}

.thumbnail-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid #2e2e2e;
  padding: 9px;
}

.thumbnail-button {
  width: 72px;
  height: 56px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #333;
  padding: 0;
}

.thumbnail-button.is-active {
  border-color: var(--gold);
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--thumb-position, center);
}

.info-section,
.review-section {
  padding: 12px 0 0;
}

.info-section h3,
.review-section h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  padding: 0 8px 10px;
}

.info-section h3::before {
  content: "🌹 ";
}

.review-section h3::before {
  content: "⭐ ";
}

.info-table {
  margin: 0;
  border-top: 1px solid #3a3a3a;
}

.info-row {
  display: grid;
  grid-template-columns: 36% 64%;
  min-height: 42px;
  border-bottom: 1px solid #3a3a3a;
  background: #272727;
}

.info-row dt,
.info-row dd {
  margin: 0;
  padding: 10px 8px;
  color: #e8e8e8;
  font-size: 0.86rem;
  font-weight: 900;
}

.info-row dt {
  color: #d1d1d1;
}

.info-row dd {
  display: grid;
  align-items: center;
  color: #ffffff;
}

.info-row dd.accent {
  color: var(--orange);
}

.inline-contact {
  justify-self: start;
  border: 0;
  background: transparent;
  color: #ff432e;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 900;
}

.review-section {
  padding-bottom: 22px;
}

.review-section p {
  margin: 0;
  color: #eeeeee;
  padding: 0 8px;
  font-size: 0.9rem;
}

.contact-dialog {
  position: relative;
  width: min(380px, calc(100% - 24px));
  border: 1px solid #424242;
  border-radius: 8px;
  background: #222;
  box-shadow: var(--shadow);
  padding: 24px 16px 16px;
}

.dialog-label {
  margin: 0 0 5px;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-dialog h2 {
  margin: 0 38px 8px 0;
  color: #ffffff;
  font-size: 1.3rem;
}

.contact-dialog p {
  color: var(--muted);
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 760px) {
  .shop-frame {
    width: min(1180px, calc(100% - 32px));
    margin-top: 18px;
    margin-bottom: 18px;
    border-radius: 8px;
  }

  .mobile-header {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    padding-right: 18px;
  }

  .site-logo {
    justify-self: start;
    font-size: 1.05rem;
  }

  .login-link {
    justify-self: end;
    padding-right: 0;
    text-align: right;
  }

  main {
    padding: 28px 22px 48px;
  }

  .notice-panel {
    padding: 24px 0 26px;
  }

  .catalog-toolbar {
    grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    padding: 0 0 18px;
  }

  .filter-tabs {
    justify-content: flex-end;
    flex-wrap: wrap;
    overflow: visible;
  }

  .section-heading h2 {
    border-radius: 8px;
    padding-left: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 24px 20px;
    padding: 0;
  }

  .product-card {
    border: 1px solid #303030;
    border-radius: 6px;
  }

  .product-card__body {
    padding: 0 8px 10px;
  }

  .seller-panel {
    margin: 28px 0 0;
  }

  .seller-panel .contact-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-dialog {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    width: min(1080px, calc(100% - 36px));
    max-height: calc(100vh - 36px);
    border-radius: 8px;
  }

  .detail-header {
    grid-column: 1 / -1;
  }

  .detail-gallery {
    grid-row: 2 / span 2;
    min-height: 0;
  }

  .modal-image-wrap {
    min-height: 560px;
    max-height: calc(100vh - 150px);
  }

  .modal-image-wrap img {
    max-height: calc(100vh - 150px);
  }

  .info-section,
  .review-section {
    min-width: 0;
  }

  .info-section {
    overflow-y: auto;
    padding-top: 16px;
  }

  .review-section {
    border-top: 1px solid #333;
  }

  .contact-dialog {
    width: min(520px, calc(100% - 36px));
  }
}

@media (min-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}
