:root {
  --page: #faf8f3;
  --panel: #ffffff;
  --ink: #222222;
  --muted: #666666;
  --line: #e3e7e9;
  --line-strong: #d6dde1;
  --warm-line: #e8e1d7;
  --warm-highlight: #fff8ee;
  --warm-panel: #fffdf9;
  --warm-accent: #f0b375;
  --accent: #438eb9;
  --accent-dark: #337da6;
  --order-action: #ed7d16;
  --order-action-dark: #d96c08;
  --order-action-hover: #e3740f;
  --price: #cc0000;
  --notice: #fcf8e3;
  --food: #eef7e9;
  --consumable: #eef3fb;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding-bottom: 92px;
  background: var(--panel);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 14px;
}

.service-notice {
  border-bottom: 1px solid #dfb25e;
  background: #fff5dc;
  color: #5f3e00;
}

.service-notice.is-stopped {
  border-bottom-color: #c97867;
  background: #fff0ec;
  color: #7f2416;
}

.service-notice-inner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: min(100% - 32px, 1440px);
  margin: 0 auto;
  padding: 11px 0;
  line-height: 1.55;
}

.service-notice-inner strong {
  flex: 0 0 auto;
}

.service-notice-period {
  flex: 0 0 auto;
  color: inherit;
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.web-header {
  border-bottom: 3px solid var(--accent);
  background: var(--panel);
}

.web-header-inner {
  width: min(1452px, calc(100% - 40px));
  min-height: 86px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
}

.web-brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.web-brand-mark {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.web-brand strong,
.web-brand small {
  display: block;
}

.web-brand strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .04em;
}

.web-brand small {
  margin-top: 2px;
  color: var(--muted);
}

.header-order-tools {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: start;
  justify-content: start;
  gap: 18px;
}

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

.customer-account {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.customer-name {
  max-width: 180px;
  padding: 9px 12px;
  overflow: hidden;
  background: #eef7f4;
  color: #1a6653;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-name:focus {
  overflow: visible;
  white-space: normal;
}

.logout-button {
  min-height: 36px;
  padding: 8px 0 8px 10px;
  border: 0;
  border-left: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.logout-button:hover {
  color: var(--ink);
  text-decoration: underline;
}

.web-main {
  width: min(1452px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 40px;
  background: var(--page);
  box-shadow: 0 0 0 100vmax var(--page);
  clip-path: inset(0 -100vmax);
}

.preview-login {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(420px, 1.4fr);
  gap: 36px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--warm-line);
  background: var(--panel);
}

.promotion-slot:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-height: 120px;
  margin-top: 18px;
}

.preview-login h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
}

.preview-login p,
.product-heading p {
  margin: 0;
  color: var(--muted);
}

.customer-loader label,
.customer-auth-panel label,
.product-search span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.customer-loader-row {
  display: grid;
  grid-template-columns: 1fr auto;
}

.customer-loader input,
.customer-loader button,
.product-search input,
.view-switch button,
.category-tabs button,
.quantity-control button,
.quantity-control input,
.cart-bar button,
.dialog-back,
.dialog-close {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
}

.customer-loader input,
.product-search input {
  width: 100%;
  padding: 9px 12px;
}

.customer-loader button,
.cart-bar button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 9px 20px;
}

.customer-loader button:hover,
.cart-bar button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.customer-auth-panel {
  min-width: 0;
}

.customer-auth-panel form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 6px 0;
  align-items: end;
}

.customer-auth-panel h2,
.customer-auth-panel p,
.customer-auth-message {
  grid-column: 1 / -1;
}

.customer-auth-panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.customer-auth-panel p {
  margin: 0 0 6px;
}

.customer-auth-field {
  min-width: 0;
  margin-right: 10px;
}

.customer-auth-field span {
  display: block;
  min-height: 22px;
}

.customer-auth-panel input,
.customer-auth-panel button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
}

.customer-auth-panel input {
  width: 100%;
  padding: 9px 12px;
}

.customer-auth-panel button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 9px 20px;
}

#customerLoginForm > button[type="submit"] {
  margin-bottom: 6px;
}

.customer-auth-panel button:hover {
  background: var(--accent-dark);
}

.customer-auth-message {
  min-height: 20px;
  margin-top: 7px;
  color: var(--muted);
}

.customer-auth-message.is-error {
  color: #a33024;
}

.customer-candidates {
  display: grid;
  margin-top: 6px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.customer-candidate {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  text-align: left;
}

.customer-candidate:hover {
  background: #f0f6fa;
}

.customer-candidate small {
  color: var(--muted);
}

.order-workspace {
  margin-top: 18px;
}

.delivery-date-panel {
  width: 414px;
  margin-left: 17px;
  display: grid;
  grid-template-columns: 60px 340px;
  gap: 3px 14px;
  align-items: center;
}

.delivery-date-panel h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.delivery-date-panel p {
  grid-column: 1 / -1;
  width: clamp(320px, calc(100vw - 540px), 750px);
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.delivery-date-panel label,
.delivery-date-panel label span {
  display: block;
}

.delivery-date-panel select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
}

.delivery-date-panel select:focus {
  outline: 2px solid rgba(67, 142, 185, .22);
  border-color: var(--accent);
}

.dialog-delivery-date {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--notice);
}

.web-order-nav {
  display: flex;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.web-order-nav button {
  min-width: 140px;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  background: var(--panel);
  color: var(--ink);
}

.web-order-nav button + button {
  border-left: 1px solid var(--line);
}

.web-order-nav button.is-active {
  background: var(--accent);
  color: #ffffff;
}

.header-review-order {
  margin-left: 34px;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid var(--order-action);
  border-radius: 0;
  background: var(--order-action);
  color: #ffffff;
  white-space: nowrap;
}

.header-review-order:hover:not(:disabled) {
  background: var(--order-action-hover);
}

.header-review-order:disabled {
  border-color: #b9c7d0;
  background: #b9c7d0;
  cursor: default;
}

.order-controls {
  display: grid;
  grid-template-columns: minmax(360px, 1.3fr) auto minmax(300px, .9fr);
  gap: 18px;
  align-items: end;
  padding: 18px 20px;
  border: 1px solid var(--warm-line);
  background: var(--warm-panel);
}

.order-controls .product-search > span,
.category-filter > label,
.view-switch-field > span {
  display: block;
  margin-bottom: 6px;
  color: #584b3e;
  font-weight: 600;
}

.product-search small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.view-switch-field {
  align-self: start;
}

.view-switch {
  display: flex;
}

.view-switch button {
  min-width: 78px;
  padding: 8px 14px;
}

.view-switch button + button {
  border-left: 0;
}

.view-switch button.is-active,
.category-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.category-filter {
  min-width: 0;
  align-self: start;
}

.category-filter select {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
}

.reorder-products {
  margin-top: 16px;
  border: 1px solid #e3d79c;
  background: var(--notice);
}

.reorder-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid #e3d79c;
}

.reorder-heading h2 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 500;
}

.reorder-heading p {
  margin: 0;
  color: var(--muted);
}

.reorder-heading button,
.reorder-remove {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #cdbf7c;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
}

.reorder-table-wrap {
  overflow-x: auto;
}

.reorder-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reorder-table th,
.reorder-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e3d79c;
  vertical-align: middle;
}

.reorder-table th {
  text-align: center;
  font-weight: 500;
}

.reorder-table th:nth-child(2) { width: 180px; }
.reorder-table th:nth-child(3) { width: 110px; }
.reorder-table th:nth-child(4) { width: 176px; }
.reorder-table th:nth-child(5) { width: 90px; }

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

.order-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.order-history-main {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(130px, auto) minmax(100px, auto) 1fr;
  gap: 12px;
  align-items: center;
}

.order-history-main small {
  color: var(--muted);
}

.order-history-item button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: #ffffff;
  color: #064f80;
}

.order-history-item button:hover {
  background: #f3f5f6;
}

.order-history-detail {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.order-history-detail[hidden] {
  display: none;
}

.order-history-detail-heading {
  margin-bottom: 7px;
  font-weight: 600;
}

.order-history-detail-line {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 100px 110px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid #e9ecef;
}

.order-history-detail-line small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.order-history-detail-line > :not(:first-child),
.order-history-note {
  margin: 12px 0;
  padding: 10px 12px;
  background: #f7f6f2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.order-history-detail-total {
  text-align: right;
}

.order-history-detail-total {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.order-history-detail > button {
  display: block;
  margin-left: auto;
}

.category-tabs {
  display: flex;
  overflow-x: auto;
  margin-top: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.category-tabs button {
  min-width: 118px;
  padding: 10px 16px;
  border-width: 0 1px 0 0;
  white-space: nowrap;
}

.category-tabs span {
  margin-left: 4px;
}

.product-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 0;
  padding: 0 2px 11px;
}

#productArea {
  padding-top: 14px;
  padding-bottom: 80px;
  margin-bottom: -40px;
  background: var(--panel);
  box-shadow: 0 0 0 100vmax var(--panel);
  clip-path: inset(0 -100vmax);
}

.product-heading h2 {
  position: relative;
  margin: 0;
  padding-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
}

.product-heading h2::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 52px;
  height: 3px;
  background: var(--order-action);
  content: "";
}

.product-heading > span {
  padding: 5px 10px;
  background: var(--warm-panel);
  color: var(--muted);
  font-size: 13px;
}

.product-heading p {
  margin-top: 6px;
}

.screen-message {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.screen-message:empty {
  display: none;
}

.load-more {
  display: block;
  width: min(420px, 100%);
  min-height: 44px;
  margin: 18px auto 0;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: var(--panel);
  color: #064f80;
}

.load-more:hover {
  background: #eef3f7;
}

.web-footer {
  margin-top: 28px;
  padding: 22px 12px 28px;
  border-top: 1px solid var(--warm-line);
  color: #858585;
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
}

.product-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.product-table th,
.product-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.product-table td {
  font-size: 16px;
}

.product-table tbody tr.has-quantity {
  background: var(--warm-highlight);
}

.product-table tbody tr.has-quantity .quantity-control button[data-quantity-action="minus"],
.product-table tbody tr.has-quantity .quantity-control input {
  background: var(--panel);
}

.product-table th {
  background: #f3f5f6;
  color: #064f80;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.product-table th:nth-child(1) {
  width: 70px;
}

.product-table th:nth-child(3) {
  width: 150px;
}

.product-table th:nth-child(4) {
  width: 64px;
}

.product-table th:nth-child(5) {
  width: 140px;
}

.product-table th:nth-child(6) {
  width: 110px;
}

.product-table th:nth-child(7) {
  width: 160px;
}

.frequency-cell,
.category-cell,
.tax-cell,
.spec-cell,
.price-cell {
  text-align: center;
}

.product-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.product-link:hover {
  color: #064f80;
  text-decoration: underline;
}

.product-table .product-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.product-subtext {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.category-label {
  display: inline-block;
  min-width: 56px;
  padding: 4px 8px;
  text-align: center;
}

.product-table .category-label {
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.35;
  transform: translateX(-30px);
}

.product-table .category-heading {
  display: inline-block;
  transform: translateX(-30px);
}

.product-table .price-cell .price-currency {
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
}

.product-table .price-cell .price-amount {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.category-label.food {
  background: var(--food);
  color: #3f6a2c;
}

.category-label.consumable {
  background: var(--consumable);
  color: #23578a;
}

.quantity-control {
  display: grid;
  grid-template-columns: 42px minmax(62px, 84px) 42px;
  justify-content: center;
}

.quantity-control button {
  padding: 0;
  font-size: 20px;
}

.quantity-control input {
  width: 100%;
  padding: 7px 4px;
  border-left: 0;
  border-right: 0;
  font-size: 14px;
  text-align: center;
}

.quantity-control button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.quantity-control button[data-quantity-action="plus"] {
  border-color: var(--order-action);
  background: var(--order-action);
  color: #ffffff;
}

.quantity-control button[data-quantity-action="plus"]:hover {
  border-color: var(--order-action-dark);
  background: var(--order-action-dark);
  color: #ffffff;
}

.quantity-control.has-quantity input {
  color: var(--price);
  font-size: 18px;
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 349px);
  justify-content: space-between;
  gap: 14px;
}

.product-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--warm-line);
  background: var(--panel);
  transition: border-color .15s ease;
}

.product-card:hover {
  border-color: #e7aa72;
}

.product-card.has-quantity {
  border-color: var(--order-action);
}

.product-card.has-quantity::after {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border: 1px solid #eaa05e;
  background: rgba(255, 250, 244, .94);
  color: #a84f08;
  content: "選択中";
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.product-card.has-quantity .product-card-body {
  background: var(--warm-highlight);
}

.product-image-frame,
.detail-image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--line);
  background: #f1f1f1;
}

.product-image-frame {
  width: 349px;
  height: auto;
  max-width: 100%;
  border-bottom: 0;
}

.product-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-card-image,
.detail-image img {
  display: block;
  width: 100%;
  height: 100%;
}

.product-card-picture {
  display: block;
  width: 100%;
  height: 100%;
}

.product-card-image {
  object-fit: cover;
  object-position: center;
}

.dummy-image-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 6px;
  background: rgb(255 255 255 / 86%);
  color: #555555;
  font-size: 10px;
  line-height: 1.2;
}

.product-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.product-card-name {
  display: block;
  min-height: 52px;
  margin: 0;
  color: #111111;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
}

.product-card-price {
  margin: 8px 0 3px;
  line-height: 1.25;
  white-space: nowrap;
}

.price-currency {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.price-amount {
  color: var(--price);
  font-size: 30px;
  font-weight: 700;
}

.price-spec {
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
}

.product-card-meta {
  color: #6f675f;
  font-size: 13px;
  line-height: 1.55;
}

.product-card-category {
  min-height: 28px;
  margin-top: 4px;
}

.product-card-category .category-label {
  min-width: 0;
  padding: 3px 7px;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.product-card .quantity-control {
  grid-template-columns: 42px minmax(54px, 1fr) 42px;
  margin-top: 12px;
}

.cart-bar {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 74px;
  padding: 12px max(20px, calc((100% - 1452px) / 2));
  border-top: 1px solid var(--warm-line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -5px 18px rgba(75, 57, 37, .07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.cart-bar > div {
  display: flex;
  align-items: center;
  gap: 0;
}

.cart-bar > div > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  padding: 5px 24px;
  border-right: 1px solid var(--warm-line);
}

.cart-bar > div > span:first-child {
  padding-left: 0;
}

.cart-bar > div > span:last-child {
  border-right: 0;
}

.cart-bar strong {
  font-size: 18px;
}

.cart-bar button {
  min-width: 220px;
}

.cart-bar button:disabled {
  border-color: #b9c7d0;
  background: #b9c7d0;
  cursor: default;
}

#reviewOrder {
  border-color: var(--order-action);
  background: var(--order-action);
}

#reviewOrder:hover:not(:disabled) {
  background: var(--order-action-hover);
}

#reviewOrder:disabled {
  border-color: #b9c7d0;
  background: #b9c7d0;
}

dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
}

.product-dialog {
  width: min(856px, calc(100% - 32px));
}

.product-dialog form {
  position: relative;
}

.product-dialog .dialog-heading {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 20px;
  padding: 0;
  border: 0;
}

.product-dialog .dialog-heading h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
}

dialog form {
  margin: 0;
  padding: 20px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dialog-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.dialog-close {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
}

.dialog-close::before,
.dialog-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.dialog-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.dialog-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.dialog-notice {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #eadfab;
  background: var(--notice);
}

.dialog-lines {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.dialog-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 96px;
  gap: 12px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}

.dialog-line-product {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dialog-line-quantity {
  justify-self: end;
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}

.dialog-line-amount {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.order-note-field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  font-weight: 600;
}

.order-note-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.order-note-field textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  font: inherit;
  resize: vertical;
}

.dialog-total {
  padding: 16px 4px;
  text-align: right;
}

.dialog-total strong {
  margin-left: 14px;
  font-size: 22px;
}

.dialog-back {
  width: 100%;
  padding: 9px 16px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.dialog-actions:has(.dialog-submit[hidden]) {
  grid-template-columns: 1fr;
}

.dialog-submit {
  min-height: 42px;
  padding: 12px 18px;
  appearance: none;
  border: 1px solid var(--order-action);
  border-radius: 0;
  background: var(--order-action);
  box-shadow: none;
  color: #fff;
  font-weight: 600;
}

.dialog-submit:hover:not(:disabled) {
  border-color: var(--order-action-hover);
  background: var(--order-action-hover);
}

.dialog-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.dialog-submit.is-preview:disabled {
  border-color: var(--order-action);
  background: var(--order-action);
  box-shadow: none;
  color: #fff;
  cursor: default;
  opacity: 1;
}

.dialog-submit-status {
  min-height: 24px;
  margin: 0 4px 12px;
  color: var(--muted);
}

.dialog-submit-status:empty {
  display: none;
}

.dialog-submit-status.is-error {
  color: #b3261e;
}

.dialog-submit-status.is-success {
  padding: 12px;
  border: 1px solid #9bc7aa;
  background: #eef8f1;
  color: #1e6635;
}

@media (max-width: 560px) {
  .order-dialog form {
    padding: 16px 12px;
  }

  .dialog-line {
    grid-template-columns: minmax(0, 1fr) 48px 72px;
    gap: 8px;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dialog-submit {
    grid-row: 1;
  }
}

.product-dialog-layout {
  display: grid;
  grid-template-columns: 349px minmax(0, 1fr);
  gap: 20px;
  margin: 18px 0;
}

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

.detail-content {
  display: flex;
  min-width: 0;
  padding: 0 50px 0 2px;
  flex-direction: column;
}

.detail-product-name {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
}

.detail-product-price {
  margin-bottom: 4px;
  white-space: nowrap;
}

.detail-product-price .price-amount {
  font-size: 32px;
}

.detail-product-meta {
  font-size: 13px;
  line-height: 1.55;
}

.detail-image {
  width: 349px;
  height: auto;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
}

.detail-image img {
  object-fit: contain;
  background: #f4f2ee;
}

.detail-content dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  margin: 0;
  border-top: 1px solid var(--line);
}

.detail-content dt,
.detail-content dd {
  margin: 0;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}

.detail-content dt {
  color: var(--muted);
}

.detail-preparing {
  flex: 1;
  min-height: 320px;
  margin-top: 36px;
  padding: 12px;
  background: var(--notice);
  line-height: 1.7;
}

@media (max-width: 1491px) {
  .product-grid {
    grid-template-columns: repeat(3, 349px);
    justify-content: center;
  }
}

@media (max-width: 1480px) {
  .web-header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 40px;
    row-gap: 8px;
    padding: 10px 0;
  }

  .header-order-tools {
    display: contents;
  }

  .web-order-nav {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: start;
  }

  .delivery-date-panel {
    grid-column: 1 / 3;
    grid-row: 2;
    align-self: start;
    justify-self: start;
    margin-left: 30px;
  }

  .header-review-order {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-self: start;
    margin-left: 292px;
  }

  .customer-account {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }
}

@media (min-width: 961px) and (max-width: 1480px) {
  .delivery-date-panel p {
    width: clamp(700px, calc(100vw - 380px), 750px);
    white-space: nowrap;
  }
}

@media (max-width: 1120px) {
  .web-header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px 0;
  }

  .header-order-tools {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .product-grid {
    grid-template-columns: repeat(2, 349px);
  }
}

@media (max-width: 980px) {
  .preview-login {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 349px);
  }

  .order-controls {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .category-filter {
    grid-column: 1 / -1;
  }
}

/* 一覧はタブレット・小型PC幅から、商品単位の読みやすい2段表示にする。 */
@media (max-width: 1100px) {
  .product-table th:nth-child(1),
  .product-table td:nth-child(1),
  .product-table th:nth-child(5),
  .product-table td:nth-child(5) {
    display: none;
  }

  .product-table-wrap {
    overflow-x: visible;
  }

  .product-table,
  .product-table tbody {
    display: block;
  }

  .product-table thead {
    display: none;
  }

  .product-table tr {
    display: grid;
    grid-template-columns: minmax(70px, .7fr) minmax(110px, 1fr) minmax(170px, 1.2fr);
    grid-template-rows: auto auto;
    gap: 9px 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
  }

  .product-table tbody tr:last-child {
    border-bottom: 0;
  }

  .product-table td {
    display: block;
    padding: 0;
    border-bottom: 0;
    font-size: 15px;
  }

  .product-table td:nth-child(2) {
    grid-column: 1 / 3;
    grid-row: 1;
    align-self: center;
  }

  .product-table td:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .product-table td:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
  }

  .product-table td:nth-child(6) {
    grid-column: 2;
    grid-row: 2;
  }

  .product-table td:nth-child(7) {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    width: min(100%, 220px);
  }

  .product-table td:nth-child(4),
  .product-table td:nth-child(6),
  .product-table td:nth-child(7) {
    align-self: end;
  }

  .product-table td:nth-child(4)::before,
  .product-table td:nth-child(6)::before,
  .product-table td:nth-child(7)::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
  }

  .product-table td:nth-child(4)::before {
    content: "税率";
  }

  .product-table td:nth-child(6)::before {
    content: "単価";
  }

  .product-table td:nth-child(7)::before {
    content: "数量";
  }

  .product-table .product-name {
    display: block;
    width: 100%;
    font-size: 17px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .product-table .category-label {
    max-width: none;
    transform: none;
    white-space: nowrap;
  }

  .product-table .price-cell .price-amount {
    font-size: 19px;
  }

  .product-table .quantity-control {
    grid-template-columns: 36px minmax(42px, 1fr) 36px;
    width: 100%;
  }
}

/* タブレット～小型PCでは、2段目を一定幅で左側へまとめて視線移動を抑える。 */
@media (min-width: 761px) and (max-width: 1100px) {
  .product-table tr {
    grid-template-columns: minmax(0, 1fr) 90px 140px 220px;
  }

  .product-table td:nth-child(2) {
    grid-column: 1 / 4;
  }

  .product-table td:nth-child(3) {
    grid-column: 4;
  }

  .product-table td:nth-child(4) {
    grid-column: 2;
  }

  .product-table td:nth-child(6) {
    grid-column: 3;
  }

  .product-table td:nth-child(7) {
    grid-column: 4;
    justify-self: end;
    width: 220px;
  }
}

@media (max-width: 760px) {
  .service-notice-inner {
    display: block;
    width: min(100% - 24px, 1440px);
  }

  .service-notice-inner strong,
  .service-notice-inner span {
    display: block;
  }

  .service-notice-period {
    margin-top: 3px;
  }
  .web-header-inner {
    column-gap: 18px;
    row-gap: 10px;
  }

  .header-order-tools {
    width: 100%;
    display: grid;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 10px 14px;
    justify-content: stretch;
  }

  .web-order-nav {
    grid-column: 1 / -1;
    grid-row: 1;
    width: auto;
    margin-top: 0;
    justify-self: start;
  }

  .header-review-order {
    grid-column: 2;
    grid-row: 2;
    margin-left: 0;
  }

  .delivery-date-panel {
    grid-column: 1;
    grid-row: 2;
    margin-left: 0;
  }
}

@media (min-width: 700px) and (max-width: 960px) {
  .delivery-date-panel p {
    width: min(750px, calc(100vw - 50px));
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 112px;
  }

  .web-header-inner,
  .web-main {
    width: min(100% - 24px, 1452px);
  }

  .web-header-inner {
    min-height: 64px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .header-order-tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .delivery-date-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(414px, 100%);
    justify-self: start;
  }

  .header-review-order {
    display: none;
  }

  .customer-account {
    width: 52vw;
    max-width: 205px;
    min-width: 0;
    gap: 7px;
  }

  .customer-name {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    padding: 8px 9px;
    font-size: 12px;
  }

  .logout-button {
    flex: 0 0 auto;
    padding-left: 7px;
    font-size: 12px;
  }

  .web-main {
    padding-top: 12px;
  }

  .preview-login {
    padding: 14px;
  }

  .customer-auth-panel form {
    grid-template-columns: 1fr;
  }

  #customerLoginForm > button[type="submit"] {
    margin-bottom: 0;
  }

  .customer-auth-panel h2,
  .customer-auth-panel p,
  .customer-auth-message {
    grid-column: 1;
  }

  .customer-auth-field {
    margin-right: 0;
  }

  .delivery-date-panel {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 8px;
  }

  .order-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-filter {
    grid-column: auto;
  }

  .category-filter {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .reorder-heading,
  .order-history-item {
    align-items: stretch;
    flex-direction: column;
  }

  .reorder-heading {
    display: flex;
  }

  .order-history-item {
    display: flex;
  }

  .order-history-main {
    grid-template-columns: 1fr 1fr;
  }

  .order-history-detail-line {
    grid-template-columns: 1fr auto;
  }

  .order-history-detail-line > :nth-child(3) {
    display: none;
  }

  .reorder-table th:nth-child(2),
  .reorder-table td:nth-child(2),
  .reorder-table th:nth-child(3),
  .reorder-table td:nth-child(3) {
    display: none;
  }

  .view-switch button {
    flex: 1;
  }

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

  .product-card-body {
    padding: 11px;
  }

  .product-card.has-quantity::after {
    top: 6px;
    right: 6px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .product-card-name {
    min-height: 68px;
    font-size: 14px;
  }

  .product-card-price {
    white-space: normal;
  }

  .product-card-price .price-amount {
    font-size: 22px;
  }

  .product-card-price .price-spec {
    font-size: 12px;
  }

  .product-card .quantity-control {
    grid-template-columns: 36px minmax(42px, 1fr) 36px;
  }

  .product-table tr {
    grid-template-columns: minmax(48px, .55fr) minmax(76px, .8fr) minmax(124px, 1.25fr);
    gap: 9px 6px;
    padding: 13px 12px;
  }

  .product-table td:nth-child(7) {
    width: 100%;
  }

  .cart-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }

  .cart-bar > div {
    justify-content: space-between;
  }

  .cart-bar > div > span {
    min-height: 0;
    padding: 2px 8px;
  }

  .cart-bar > div > span:first-child {
    padding-left: 0;
  }

  .cart-bar > div > span:last-child {
    padding-right: 0;
  }

  .cart-bar > div > span {
    min-height: 0;
    padding: 2px 8px;
  }

  .cart-bar > div > span:first-child {
    padding-left: 0;
  }

  .cart-bar > div > span:last-child {
    padding-right: 0;
  }

  .cart-bar button {
    min-width: 0;
    width: 100%;
  }

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

  .detail-content {
    padding-right: 0;
  }

  .detail-preparing {
    min-height: 180px;
    margin-top: 18px;
  }
}

@media (max-width: 699px) {
  .delivery-date-panel p {
    width: calc(100vw - 24px);
    white-space: normal;
  }
}

@media (max-width: 650px) {
  .delivery-date-panel {
    width: 414px;
    min-width: 414px;
  }

  .delivery-date-panel label,
  .delivery-date-panel select {
    width: 340px;
    min-width: 340px;
  }
}

@media (max-width: 460px) {
  .web-header-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .web-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .customer-account {
    grid-column: 1;
    grid-row: 2;
    width: auto;
    max-width: 100%;
    justify-self: end;
  }

  .customer-name {
    max-width: min(310px, calc(100vw - 112px));
  }

  .header-order-tools {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 430px) {
  .delivery-date-panel {
    width: min(414px, calc(100vw - 24px));
    min-width: 0;
    grid-template-columns: 60px minmax(0, 340px);
  }

  .delivery-date-panel label,
  .delivery-date-panel select {
    width: 100%;
    min-width: 0;
  }
}
