/* Cube storefront product-detail modal. Typography remains inherited from the storefront. */

:root {
  --commerce-bg: #f6f1e9;
  --commerce-surface: #fffdf9;
  --commerce-surface-soft: #edf4f0;
  --commerce-surface-accent: #dcebe5;
  --commerce-ink: #25342e;
  --commerce-muted: #66756e;
  --commerce-faint: #87928d;
  --commerce-border: rgba(47, 69, 61, .15);
  --commerce-border-strong: rgba(47, 69, 61, .28);
  --commerce-accent: #72ae9a;
  --commerce-accent-strong: #397964;
  --commerce-danger: #d75555;
  --commerce-shadow: 0 34px 100px rgba(35, 51, 45, .22);
}

.ph-storefront-root .ph-modal-backdrop,
.ph-storefront-root .ph-modal-backdrop *,
.ph-storefront-root .ph-modal-dialog,
.ph-storefront-root .ph-modal-dialog * {
  box-sizing: border-box;
}

.ph-storefront-root .ph-modal-backdrop {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2.4vw, 30px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(28, 40, 35, .56);
  backdrop-filter: blur(14px) saturate(108%);
  -webkit-backdrop-filter: blur(14px) saturate(108%);
}

.ph-storefront-root .ph-modal-dialog {
  position: relative;
  width: min(1040px, calc(100vw - 32px));
  max-width: 1040px;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid var(--commerce-border);
  border-radius: 28px;
  background: var(--commerce-surface);
  color: var(--commerce-ink);
  box-shadow: var(--commerce-shadow);
}

.ph-storefront-root .ph-modal-close-btn {
  position: absolute !important;
  z-index: 30;
  top: 18px !important;
  right: 18px !important;
  display: grid;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px;
  min-height: 46px;
  place-items: center;
  padding: 0 !important;
  border: 1px solid var(--commerce-border) !important;
  border-radius: 50% !important;
  background: rgba(255, 253, 249, .94) !important;
  color: var(--commerce-muted) !important;
  box-shadow: 0 8px 24px rgba(44, 61, 55, .11);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ph-storefront-root .ph-modal-close-btn:hover {
  border-color: var(--commerce-border-strong) !important;
  color: var(--commerce-ink) !important;
}

.ph-storefront-root .ph-modal-dialog:not(.ph-checkout-dialog) .ph-modal-grid {
  display: grid !important;
  grid-template-columns: minmax(0, .94fr) minmax(360px, 1.06fr) !important;
  gap: clamp(24px, 3vw, 38px) !important;
  width: 100%;
  max-height: calc(100dvh - 32px);
  padding: clamp(24px, 3vw, 34px) !important;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.ph-storefront-root .ph-modal-media-wrap,
.ph-storefront-root .ph-modal-info,
.ph-storefront-root .ph-modal-section,
.ph-storefront-root .ph-modal-form {
  min-width: 0;
}

.ph-storefront-root .ph-modal-media-wrap {
  align-self: start;
  aspect-ratio: 4 / 4.35;
  height: auto !important;
  max-height: min(68dvh, 620px);
  overflow: hidden;
  border: 1px solid var(--commerce-border) !important;
  border-radius: 21px !important;
  background: var(--commerce-surface-soft);
}

.ph-storefront-root .ph-modal-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ph-storefront-root .ph-modal-info {
  align-self: start;
  padding: 8px 58px 8px 0;
}

.ph-storefront-root .ph-modal-category {
  margin-bottom: 10px;
  color: var(--commerce-accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.ph-storefront-root .ph-modal-title {
  max-width: 100%;
  margin: 0;
  color: var(--commerce-ink);
  font-size: clamp(26px, 3vw, 38px) !important;
  line-height: 1.18 !important;
  letter-spacing: -.04em;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.ph-storefront-root .ph-modal-desc {
  margin-top: 14px;
  color: var(--commerce-muted);
  font-size: 14px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.ph-storefront-root .ph-swatch-section,
.ph-storefront-root .ph-modal-specs-table,
.ph-storefront-root .ph-quantity-row {
  margin-top: 20px;
}

.ph-storefront-root .ph-swatch-label-row,
.ph-storefront-root .ph-quantity-row,
.ph-storefront-root .ph-modal-total-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ph-storefront-root .ph-swatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 11px;
}

.ph-storefront-root .ph-swatch-item {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--commerce-border);
  border-radius: 12px;
}

.ph-storefront-root .ph-modal-specs-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--commerce-border) !important;
  border-radius: 16px !important;
  background: var(--commerce-border);
}

.ph-storefront-root .ph-spec-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  background: var(--commerce-surface-soft);
}

.ph-storefront-root .ph-spec-name {
  color: var(--commerce-faint);
  font-size: 11px;
}

.ph-storefront-root .ph-spec-val {
  color: var(--commerce-ink);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ph-storefront-root .ph-quantity-counter {
  display: grid;
  grid-template-columns: 44px minmax(44px, auto) 44px;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--commerce-border);
  border-radius: 12px;
  background: var(--commerce-surface);
}

.ph-storefront-root .ph-counter-btn,
.ph-storefront-root .ph-counter-val {
  display: grid;
  min-width: 0;
  min-height: 44px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--commerce-ink);
}

.ph-storefront-root .ph-counter-btn:hover {
  background: var(--commerce-surface-soft);
}

.ph-storefront-root .ph-modal-checkout-buttons {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin-top: 22px;
}

.ph-storefront-root .ph-modal-checkout-buttons :where(a, button) {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 52px !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px !important;
  border-radius: 14px !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
}

.ph-storefront-root .ph-modal-checkout-buttons .ph-btn-naver-pay {
  grid-column: 1 / -1;
}
