/*
 * httpdocs/public/assets/css/site.css
 * 公開サイトと管理画面のレスポンシブUIを定義します。
 */

:root {
  --bg: #050505;
  --panel: #111;
  --panel-2: #181818;
  --line: #2b2b2b;
  --text: #f4f4f4;
  --muted: #a8a8a8;
  --cyan: #4dd8ff;
  --red: #e12d2d;
  --white: #fff;
  --radius: 8px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(5, 5, 5, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--red);
  color: var(--white);
  font-size: 14px;
}

.brand-text {
  font-size: clamp(15px, 3.7vw, 21px);
  white-space: nowrap;
}

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  padding: 12px 18px 20px;
  background: #080808;
  border-bottom: 1px solid var(--line);
}

.site-nav.is-open {
  display: grid;
  gap: 10px;
}

.site-nav a {
  padding: 10px 0;
  color: var(--muted);
  border-bottom: 1px solid #202020;
}

.site-nav a:hover,
.site-nav .lang-link {
  color: var(--cyan);
}

.nav-toggle {
  display: grid;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav-toggle span {
  height: 2px;
  background: var(--white);
}

.hero {
  min-height: calc(100svh - 64px);
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 12vw, 130px) clamp(18px, 4vw, 56px) 46px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .72)), linear-gradient(90deg, rgba(0, 0, 0, .76), rgba(0, 0, 0, .2));
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 980px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 850px;
  font-size: clamp(38px, 12vw, 108px);
}

.hero p {
  max-width: 680px;
  margin: 18px 0 0;
  color: #e8e8e8;
  font-size: clamp(15px, 2.2vw, 19px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  color: var(--white);
  background: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  border-color: var(--cyan);
  color: var(--cyan);
}

.button.danger {
  background: #a91f1f;
  border-color: #a91f1f;
}

.section {
  padding: clamp(44px, 8vw, 86px) clamp(18px, 4vw, 56px);
}

.narrow {
  max-width: 960px;
  margin-inline: auto;
}

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

.section-head h2 {
  font-size: clamp(26px, 5vw, 48px);
}

.muted {
  color: var(--muted);
}

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

.category-chip {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.category-chip strong {
  display: block;
  color: var(--text);
}

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

.product-card,
.news-card,
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-body {
  padding: 15px;
}

.card-meta {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.card-title {
  margin-top: 6px;
  font-size: 17px;
}

.product-layout {
  display: grid;
  gap: 24px;
}

.gallery-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #111;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.gallery-thumbs button {
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.gallery-thumbs img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.spec-table th,
.spec-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.spec-table th {
  width: 48%;
  color: var(--muted);
  font-weight: 600;
}

.rich-content {
  display: grid;
  gap: 22px;
}

.rich-content h2 {
  margin-top: 10px;
  color: var(--cyan);
  font-size: clamp(22px, 4vw, 34px);
}

.rich-content h3 {
  color: var(--text);
  font-size: 19px;
}

.rich-content a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rich-content table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

.rich-content th,
.rich-content td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rich-content th {
  width: 34%;
  color: var(--muted);
  font-weight: 700;
}

.rich-content img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.rich-content .about-docs,
.rich-content .factory-grid,
.rich-content .brand-links {
  display: grid;
  gap: 12px;
}

.rich-content .factory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rich-content .brand-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.site-footer {
  display: grid;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer div,
.site-footer nav {
  display: grid;
  gap: 4px;
}

.site-footer a {
  color: var(--cyan);
}

.admin-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100svh;
  background:
    linear-gradient(135deg, rgba(225, 45, 45, .16), transparent 34%),
    linear-gradient(180deg, #070707 0%, #101010 100%);
  color: var(--text);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  background: rgba(10, 10, 10, .96);
  color: #fff;
  border-bottom: 1px solid #2f2f2f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

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

.admin-logo {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 10px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
}

.admin-menu-toggle {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: #151515;
  border: 1px solid #383838;
  border-radius: var(--radius);
}

.admin-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
}

.admin-menu-toggle:focus-visible {
  outline: 3px solid rgba(77, 216, 255, .45);
  outline-offset: 2px;
}

.admin-nav {
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid #2f2f2f;
}

.admin-sidebar a {
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
  color: #e8e8e8;
}

.admin-nav.show,
.admin-nav.collapsing {
  display: grid;
}

.admin-nav a:hover {
  background: #191919;
  color: var(--cyan);
}

.admin-main {
  width: 100%;
  min-width: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
}

.login-main {
  display: grid;
  place-items: center;
  min-height: 100svh;
}

.admin-login-body {
  grid-template-columns: 1fr;
}

.admin-login-body .admin-main {
  max-width: none;
  margin: 0;
}

.login-main .admin-panel {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  color: #111;
  border-color: #ddd;
}

.admin-panel {
  padding: clamp(16px, 2.2vw, 24px);
  background: rgba(17, 17, 17, .94);
  border: 1px solid #2e2e2e;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.admin-page-head h1 {
  font-size: clamp(28px, 5vw, 48px);
}

.admin-primary-action {
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 800;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  background: #121212;
  border-color: #282828;
  --bs-table-bg: #121212;
  --bs-table-color: var(--text);
  --bs-table-border-color: #282828;
  --bs-table-hover-bg: #1d1d1d;
  --bs-table-hover-color: var(--text);
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #282828;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #bcbcbc;
  font-size: 13px;
  font-weight: 800;
  background: #0b0b0b;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  padding: 10px;
  color: #f8f9fa;
  background: #0d0d0d;
  border: 1px solid #373737;
  border-radius: var(--radius);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--cyan);
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(77, 216, 255, .18);
}

.login-main .admin-form input,
.login-main .admin-form select,
.login-main .admin-form textarea {
  color: #111;
  background: #fff;
  border-color: #ccc;
}

.admin-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.admin-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form .checkbox-label input {
  width: auto;
}

.admin-help {
  margin: 0 0 14px;
  color: #b8c0c8;
  font-size: 13px;
}

.admin-form button:disabled,
.translation-helper button:disabled {
  opacity: .65;
  cursor: wait;
}

.slug-refresh-button {
  width: fit-content;
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13px;
}

.file-drop-zone {
  padding: 12px;
  background: #0d0d0d;
  border: 1px dashed #4a4a4a;
  border-radius: var(--radius);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.file-drop-zone.is-dragover {
  background: rgba(77, 216, 255, .1);
  border-color: var(--cyan);
  box-shadow: 0 0 0 .2rem rgba(77, 216, 255, .16);
}

.file-drop-status {
  display: block;
  margin-top: 6px;
  color: #b8c0c8;
  font-size: 12px;
  font-weight: 500;
}

.translation-helper {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #0d0d0d;
  border: 1px solid #343434;
  border-radius: var(--radius);
}

.translation-helper-head {
  display: grid;
  gap: 12px;
}

.translation-helper h2 {
  margin: 0;
  font-size: 18px;
}

.translation-helper p,
.translation-helper-status {
  margin: 4px 0 0;
  color: #b8c0c8;
  font-size: 13px;
  font-weight: 500;
}

.translation-helper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.translation-drafts {
  display: grid;
  gap: 8px;
}

.translation-draft {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #151515;
  border: 1px solid #303030;
  border-radius: var(--radius);
}

.translation-draft h3 {
  color: #e5e7eb;
  font-size: 14px;
}

.translation-draft-text {
  white-space: pre-wrap;
  color: #f4f4f4;
  font-weight: 500;
}

.price-list-ai-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #101010;
  border: 1px solid #303030;
  border-radius: var(--radius);
}

.price-list-ai-box .button {
  width: fit-content;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.product-image-manager {
  margin-top: 18px;
}

.product-image-manager h2 {
  margin: 0 0 8px;
}

.product-image-item {
  display: grid;
  gap: 10px;
}

.product-image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #0d0d0d;
  border-radius: 4px;
}

.product-image-item small {
  overflow-wrap: anywhere;
  color: #b8c0c8;
}

.notice {
  padding: 10px 12px;
  color: #062c19;
  background: #d9fbea;
  border: 1px solid #9be2bb;
  border-radius: var(--radius);
}

.error-box {
  padding: 10px 12px;
  color: #3b0a0a;
  background: #fff0f0;
  border: 1px solid #e6a2a2;
  border-radius: var(--radius);
}

.admin-body .form-label,
.admin-body .input-group-text {
  color: #f4f4f4;
  font-weight: 800;
}

.admin-body .input-group-text {
  background: #202020;
  border-color: #3a3a3a;
}

.admin-body .form-control {
  min-height: 44px;
  color: #f8f9fa;
  background: #0d0d0d;
  border-color: #3a3a3a;
}

.admin-body .form-control:focus {
  color: #fff;
  background: #101010;
  border-color: var(--cyan);
  box-shadow: 0 0 0 .2rem rgba(77, 216, 255, .18);
}

.admin-body .btn-link {
  color: var(--cyan);
  text-decoration: none;
}

.admin-search {
  margin-bottom: 18px;
}

.admin-search-actions {
  display: flex;
  gap: 8px;
}

.admin-category-tabs {
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.admin-status-tabs {
  gap: 8px;
  margin-bottom: 16px;
}

.admin-status-tabs .nav-link {
  color: #d8d8d8;
  background: #181818;
  border: 1px solid #303030;
  border-radius: var(--radius);
}

.admin-status-tabs .nav-link.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.admin-category-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  white-space: nowrap;
  color: #d8d8d8;
  background: #181818;
  border: 1px solid #303030;
  border-radius: var(--radius);
}

.admin-category-tabs .nav-link:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.admin-category-tabs .nav-link.active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.admin-category-tabs .badge {
  color: #111;
  background: #f4f4f4;
}

.admin-product-table {
  min-width: 900px;
  margin-bottom: 0;
}

.admin-product-id {
  color: #b8c0c8;
  font-variant-numeric: tabular-nums;
}

.admin-product-thumb {
  width: 72px;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #050505;
  border: 1px solid #2b2b2b;
  border-radius: 6px;
}

.product-image-sort-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.product-image-sort-grid.is-sorting {
  user-select: none;
}

.product-image-item {
  position: relative;
}

.product-image-item.is-dragging {
  opacity: .55;
  outline: 3px solid rgba(77, 216, 255, .7);
  outline-offset: 2px;
}

.product-image-item.is-reordered {
  outline: 3px solid rgba(77, 216, 255, .45);
  outline-offset: 2px;
}

.drag-handle {
  width: 100%;
  min-height: 36px;
  color: #fff;
  background: #202020;
  border: 1px solid #3a3a3a;
  border-radius: var(--radius);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.product-image-item img {
  object-fit: contain;
}

.image-delete-check {
  color: #ffb4b4;
}

.danger-zone {
  margin-top: 18px;
  border-color: rgba(225, 45, 45, .54);
}

.button.danger {
  background: #b91c1c;
  border-color: #ef4444;
}

.brand-logo-preview,
.admin-brand-logo-thumb {
  background: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
}

.brand-logo-preview {
  display: grid;
  gap: 8px;
  width: fit-content;
  padding: 10px;
  color: #111;
}

.brand-logo-preview img,
.admin-brand-logo-thumb {
  width: 140px;
  max-height: 72px;
  object-fit: contain;
}

.calendar-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-calendar-grid {
  margin: 12px 0 18px;
}

.business-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekday,
.calendar-day {
  min-height: 58px;
  padding: 7px;
  color: #f4f4f4;
  background: #141414;
  border: 1px solid #303030;
  border-radius: 6px;
}

.calendar-weekday {
  min-height: auto;
  color: #b8c0c8;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

button.calendar-day {
  text-align: left;
  cursor: pointer;
}

.calendar-day.is-blank {
  visibility: hidden;
}

.calendar-day.is-selected {
  outline: 3px solid var(--cyan);
  outline-offset: 1px;
}

.calendar-day-number {
  display: block;
  font-weight: 900;
}

.calendar-day-status,
.calendar-day-note {
  display: block;
  color: #b8c0c8;
  font-size: 11px;
  line-height: 1.25;
}

.calendar-day.status-closed {
  background: rgba(225, 45, 45, .22);
  border-color: rgba(225, 45, 45, .64);
}

.calendar-day.status-am_closed,
.calendar-day.status-pm_closed {
  background: rgba(77, 216, 255, .13);
  border-color: rgba(77, 216, 255, .48);
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 760px) {
  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .site-nav a {
    padding: 0;
    border: 0;
  }

  .nav-toggle {
    display: none;
  }

  .category-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .product-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    align-items: start;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .admin-body {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .admin-login-body {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    min-height: 100svh;
    align-content: start;
  }

  .admin-sidebar-head {
    display: grid;
    align-items: start;
  }

  .admin-menu-toggle {
    display: none;
  }

  .admin-sidebar .admin-nav,
  .admin-sidebar .admin-nav.collapse:not(.show) {
    display: grid;
    height: auto !important;
    visibility: visible;
    padding-top: 0;
    border-top: 0;
    overflow: visible;
  }

  .translation-helper-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
}
