:root {
  --bg: #faf7f4;
  --panel: #ffffff;
  --text: #211f1f;
  --muted: #77706b;
  --border: #e8ded8;
  --accent: #9b5c64;
  --accent-dark: #75434a;
  --shadow: 0 14px 35px rgba(36, 28, 25, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(135deg, #fff, #f2e5df);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  padding: 34px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.store-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.store-logo-mark {
  display: block;
  width: auto;
  height: 78px;
  flex: 0 0 auto;
}

.store-logo-wordmark {
  display: block;
  width: min(300px, 34vw);
  height: auto;
  min-width: 0;
}

.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;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

h1, h2, h3 {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -0.04em;
}

.header-note {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 32px 0 48px;
}

.sidebar,
.product-detail {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.sidebar h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.categories {
  display: grid;
  gap: 8px;
}

.category-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fbf8f6;
  border: 1px solid transparent;
  font-size: 14px;
}

.category-item.parent {
  font-weight: 700;
  color: var(--text);
  margin-top: 8px;
}

.category-item.child {
  margin-left: 14px;
  color: var(--muted);
}

.content {
  min-width: 0;
}

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

.section-heading h2 {
  font-size: 28px;
}

.muted {
  color: var(--muted);
  margin: 6px 0 0;
}

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

.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(36, 28, 25, 0.12);
}

.product-image {
  aspect-ratio: 4 / 5;
  background: #efe6e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  padding: 16px;
}

.product-name {
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 10px;
}

.price {
  font-weight: 800;
  color: var(--accent-dark);
  font-size: 18px;
}

.product-detail {
  margin-top: 24px;
  padding: 22px;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.detail-image {
  aspect-ratio: 4 / 5;
  background: #efe6e0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.detail-description {
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
  margin: 14px 0;
}

.variant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.variant-pill {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fbf8f6;
  font-size: 14px;
}

.hidden {
  display: none;
}

.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.error {
  padding: 16px;
  background: #fff1f1;
  border: 1px solid #ffd0d0;
  color: #8a2525;
  border-radius: 14px;
}

@media (max-width: 860px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .sidebar {
    position: static;
  }

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

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

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.category-button {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid transparent;
  background: #fbf8f6;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.category-button:hover {
  border-color: var(--border);
  background: #fff;
}

.category-button.parent {
  font-weight: 700;
  margin-top: 8px;
}

.category-button.child {
  margin-left: 14px;
  width: calc(100% - 14px);
  color: var(--muted);
}

.category-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

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

.cart-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cart-button span {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 13px;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 24, 22, 0.35);
  z-index: 30;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(430px, 100%);
  height: 100vh;
  background: #fff;
  z-index: 40;
  box-shadow: -18px 0 40px rgba(20, 14, 12, 0.18);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.cart-drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.cart-items {
  padding: 16px;
  overflow: auto;
}

.empty-cart {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  background: #fbf8f6;
}

.cart-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-image {
  width: 82px;
  height: 104px;
  border-radius: 12px;
  background: #efe6e0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-name {
  font-weight: 800;
  line-height: 1.3;
}

.cart-item-variant {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.cart-item-price {
  color: var(--accent-dark);
  font-weight: 800;
  margin-top: 6px;
}

.cart-item-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-item-actions button {
  border: 1px solid var(--border);
  background: #fbf8f6;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
}

.cart-item-actions .remove-button {
  color: #8a2525;
}

.cart-summary {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--border);
  background: #fbf8f6;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 18px;
}

.checkout-button,
.add-to-cart-button {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.checkout-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.add-to-cart-button {
  margin-top: 18px;
  max-width: 280px;
}

.variant-pill.selectable {
  cursor: pointer;
}

.variant-pill input {
  margin-right: 6px;
}

@media (max-width: 860px) {
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}

.cart-drawer-body {
  overflow: auto;
}

.checkout-form {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.checkout-form h3 {
  margin-bottom: 12px;
}

.checkout-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}

.checkout-form input,
.checkout-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.checkout-message {
  margin: 12px 16px 0;
  padding: 12px;
  border-radius: 12px;
  line-height: 1.45;
  font-size: 14px;
}

.checkout-message.success {
  background: #effaf1;
  border: 1px solid #bfe8c5;
  color: #225c2b;
}

.checkout-message.error-message {
  background: #fff1f1;
  border: 1px solid #ffd0d0;
  color: #8a2525;
}

/* Cart close button safety fix */
.cart-close,
.close-cart,
#cartClose,
#cartCloseBtn,
#closeCart,
#closeCartBtn,
.cart-header button {
  position: relative;
  z-index: 10001;
  pointer-events: auto;
}

/* Exact cart close button fix */
#cart-close {
  position: relative;
  z-index: 10050;
  pointer-events: auto;
  cursor: pointer;
}

#cart-drawer {
  z-index: 10000;
}

#cart-backdrop {
  z-index: 9990;
}

/* Strong hidden override for cart drawer/backdrop */
.cart-drawer.hidden,
.cart-backdrop.hidden,
.hidden {
  display: none !important;
}

.checkout-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.checkout-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.checkout-address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkout-address-grid label {
  min-width: 0;
}

@media (max-width: 520px) {
  .checkout-address-grid {
    grid-template-columns: 1fr;
  }
}

/* Shipping methods checkout */
.checkout-subsection {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbf8f6;
}

.checkout-subsection h3 {
  margin-top: 0;
}

.shipping-method-info,
.payment-method-info {
  margin: 8px 0 14px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbf8f6;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.checkout-field-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.cart-summary-row strong {
  color: var(--text);
}

.cart-total-row {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Official InPost Geowidget */
.pickup-point-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #ffcb05;
  color: #111111;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.pickup-point-button:hover {
  filter: brightness(0.97);
}

.pickup-point-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.selected-pickup-point {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bfe8c5;
  border-radius: 12px;
  background: #effaf1;
  color: #225c2b;
  font-size: 14px;
  line-height: 1.45;
}

.inpost-geowidget-container {
  margin-top: 14px;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

inpost-geowidget {
  display: block;
  width: 100%;
  min-height: 520px;
}

.checkout-integration-error {
  margin-top: 10px;
  color: #8a2525;
  font-size: 13px;
}

@media (max-width: 520px) {
  .inpost-geowidget-container,
  inpost-geowidget {
    min-height: 460px;
  }
}

/* InPost Geowidget fullscreen modal */
body.inpost-modal-open {
  overflow: hidden;
}

.inpost-geowidget-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.inpost-geowidget-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(2px);
}

.inpost-geowidget-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1180px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.inpost-geowidget-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  font-size: 18px;
}

.inpost-geowidget-header-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.inpost-geowidget-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: #333333;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.inpost-geowidget-close:hover {
  background: #e4e7ec;
}

.inpost-geowidget-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#inpost-geowidget-mount,
#inpost-geowidget-mount inpost-geowidget {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

@media (max-width: 700px) {
  .inpost-geowidget-modal {
    padding: 0;
  }

  .inpost-geowidget-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .inpost-geowidget-header {
    padding: 12px 14px;
  }

  .inpost-geowidget-header-note {
    display: none;
  }
}

/* MVP-C2-DEF-02 mobile storefront UX remediation */

html,
body {
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

body.cart-open {
  overflow: hidden;
}

.category-toggle {
  display: none;
}

.cart-drawer {
  height: 100vh;
  height: 100dvh;
}

.cart-drawer-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cart-items {
  overflow: visible;
}

@media (max-width: 860px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .header-inner {
    min-height: 0;
    padding: 18px 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .store-logo {
    gap: 10px;
    min-width: 0;
  }

  .store-logo-mark {
    height: 58px;
  }

  .store-logo-wordmark {
    width: min(230px, 34vw);
  }

  h1 {
    margin-top: 3px;
    font-size: clamp(27px, 8vw, 38px);
    line-height: 1;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .header-actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 8px;
  }

  .header-note {
    padding: 8px 11px;
    font-size: 13px;
  }

  .cart-button {
    min-height: 44px;
    padding: 9px 13px;
    white-space: nowrap;
  }

  .page-layout {
    gap: 14px;
    padding: 16px 0 32px;
  }

  .sidebar {
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(36, 28, 25, 0.07);
  }

  .sidebar-heading {
    display: grid;
    gap: 9px;
  }

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

  .category-toggle {
    min-height: 44px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbf8f6;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .category-toggle-icon {
    flex: 0 0 auto;
    font-size: 22px;
    line-height: 1;
    transition: transform 0.16s ease;
  }

  .category-toggle[aria-expanded="true"] .category-toggle-icon {
    transform: rotate(180deg);
  }

  .sidebar.categories-collapsed .categories {
    display: none;
  }

  .categories {
    margin-top: 10px;
    gap: 6px;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .category-button {
    min-height: 42px;
    padding: 9px 11px;
  }

  .category-button.parent {
    margin-top: 5px;
  }

  .category-button.child {
    margin-left: 10px;
    width: calc(100% - 10px);
  }

  .section-heading {
    margin-bottom: 12px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .product-grid {
    gap: 12px;
  }

  .product-card {
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(36, 28, 25, 0.07);
  }

  .product-body {
    padding: 13px;
  }

  .product-name {
    margin-bottom: 7px;
    font-size: 16px;
  }

  .product-detail {
    margin-top: 16px;
    padding: 14px;
    border-radius: 16px;
  }

  .product-detail-grid {
    gap: 16px;
  }

  .detail-image {
    border-radius: 14px;
  }

  .detail-title {
    font-size: 24px;
  }

  .detail-description {
    margin: 10px 0;
  }

  .variant-list {
    gap: 7px;
    margin-top: 9px;
  }

  .variant-pill {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
  }

  .add-to-cart-button {
    min-height: 46px;
    max-width: none;
    margin-top: 14px;
  }

  .cart-drawer-header {
    min-height: 58px;
    padding: 10px 14px;
  }

  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }

  .checkout-message {
    margin: 10px 14px 0;
  }

  .cart-items {
    padding: 12px 14px;
  }

  .checkout-form {
    padding: 14px;
  }

  .cart-summary {
    padding: 12px 14px 14px;
  }

  .checkout-button {
    min-height: 48px;
  }
}

@media (max-width: 520px) {
  .container {
    width: calc(100% - 20px);
  }

  .header-inner {
    padding: 12px 0;
  }

  .store-logo {
    gap: 7px;
  }

  .store-logo-mark {
    height: 46px;
  }

  .store-logo-wordmark {
    width: min(160px, 39vw);
  }

  .header-note {
    display: none;
  }

  h1 {
    font-size: clamp(25px, 9vw, 32px);
  }

  .cart-button {
    padding: 8px 11px;
  }

  .cart-button span {
    min-width: 22px;
    height: 22px;
    margin-left: 4px;
  }

  .page-layout {
    padding-top: 10px;
  }

  .sidebar {
    padding: 10px;
  }

  .sidebar-heading {
    gap: 7px;
  }

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

  .product-card {
    min-width: 0;
  }

  .product-body {
    padding: 10px;
  }

  .product-name {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.25;
  }

  .price {
    font-size: 16px;
  }

  .product-detail {
    padding: 12px;
  }

  .detail-title {
    font-size: 22px;
  }

  .cart-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
  }

  .cart-item-image {
    width: 68px;
    height: 86px;
    border-radius: 10px;
  }

  .cart-item-actions {
    gap: 6px;
  }

  .cart-item-actions button {
    min-width: 40px;
    min-height: 40px;
    padding: 7px 9px;
  }

  .checkout-form h3 {
    font-size: 17px;
  }

  .checkout-form label {
    margin-bottom: 10px;
  }

  .checkout-subsection {
    margin: 10px 0;
    padding: 11px;
  }

  .shipping-method-info,
  .payment-method-info {
    margin-bottom: 10px;
    padding: 10px;
  }

  .footer {
    padding: 18px 0;
  }
}

/* MVP-C2-DEF-01 seller/legal storefront */
.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}

.footer-seller-legal {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-seller-summary {
  margin: 0;
  line-height: 1.45;
}

.footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.footer-legal-nav a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

body.legal-page-open {
  overflow: hidden;
}

.legal-page {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.legal-page-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.66);
}

.legal-page-panel {
  position: relative;
  z-index: 1;
  width: min(840px, 100%);
  max-height: min(88dvh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.legal-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.legal-page-header h2 {
  margin: 0;
}

.legal-page-close {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.legal-page-content {
  overflow-y: auto;
  padding: 1.25rem;
  overscroll-behavior: contain;
}

.legal-document-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.legal-contact-row {
  margin: 0 0 0.85rem;
  overflow-wrap: anywhere;
}

.legal-contact-row:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .footer-legal-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .legal-page {
    padding: 0;
    align-items: end;
  }

  .legal-page-panel {
    width: 100%;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
  }

  .legal-page-header {
    padding: 0.9rem 1rem;
  }

  .legal-page-content {
    padding: 1rem;
  }
}

/* MVP-C2-DEF-01 legal visibility hardening */
.legal-page.hidden {
  display: none;
}


/* Product detail gallery */
.product-gallery {
  min-width: 0;
}

.product-gallery-stage {
  position: relative;
}

.product-gallery-main-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.product-gallery-main-button img,
.product-gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery-arrow {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  z-index: 2;
}

.product-gallery-prev {
  left: 12px;
}

.product-gallery-next {
  right: 12px;
}

.product-gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
}

.product-gallery-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 2px 1px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.product-gallery-thumbnail {
  flex: 0 0 68px;
  width: 68px;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #efe6e0;
  cursor: pointer;
  opacity: 0.72;
}

.product-gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery-thumbnail[aria-current="true"] {
  outline: 2px solid currentColor;
  outline-offset: 1px;
  opacity: 1;
}

@media (max-width: 700px) {
  .product-gallery-arrow {
    width: 38px;
    height: 38px;
  }

  .product-gallery-thumbnail {
    flex-basis: 58px;
    width: 58px;
  }
}

/* Product detail gallery autoplay/fade refinement */
@keyframes product-gallery-image-fade {
  from {
    opacity: 0.45;
    transform: scale(0.995);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.product-gallery-main-image.product-gallery-image-changed {
  animation: product-gallery-image-fade 320ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .product-gallery-main-image.product-gallery-image-changed {
    animation: none;
  }
}

