.kgs-dialog {
  --kgs-cherry: #670626;
  --kgs-ink: #35151d;
  --kgs-muted: #73545c;
  --kgs-line: #e8cfd3;
  --kgs-milk: #fffaf7;
  --kgs-blush: #e8b7c2;
  width: min(860px, calc(100% - 2rem));
  max-width: 860px;
  max-height: min(86dvh, 52rem);
  padding: 0;
  border: 1px solid #e6cdd1;
  border-radius: 20px;
  color: var(--kgs-ink);
  background: var(--kgs-milk);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 22px 100px #30061544;
  margin: auto;
  text-align: left;
  font-family: inherit;
}
.kgs-dialog::backdrop { background: #28111980; backdrop-filter: blur(3px); }
body:has(.kgs-dialog[open]) { overflow: hidden; }
.kgs-dialog *, .kgs-dialog *::before, .kgs-dialog *::after { box-sizing: border-box; }
.kgs-dialog .kgs-shell { position: relative; }
.kgs-dialog button, .kgs-dialog select, .kgs-dialog textarea { font: inherit; }
.kgs-dialog button, .kgs-dialog a { touch-action: manipulation; cursor: pointer; }
.kgs-dialog button:disabled { cursor: default; }
.kgs-dialog :focus-visible { outline: 3px solid #a43959; outline-offset: 3px; }
.kgs-dialog #kgs-dialog-title:focus { outline: none; }
.kgs-dialog .kgs-close {
  position: absolute; right: 16px; top: 16px; z-index: 1; width: 42px; height: 42px;
  border: 1px solid var(--kgs-line); border-radius: 50%; display: grid; place-items: center;
  background: var(--kgs-milk); color: var(--kgs-cherry); padding: 0;
}
.kgs-dialog .kgs-close:hover, .kgs-dialog .kgs-secondary:hover { background: #fae9ec; }
.kgs-dialog .kgs-pane { width: 100%; }
.kgs-detail, .kgs-cart { padding: clamp(1.35rem, 4vw, 2.6rem); }
.kgs-dialog h2, .kgs-dialog h3, .kgs-dialog p { margin: 0; color: inherit; }
.kgs-dialog .kgs-type {
  color: var(--kgs-cherry); font-size: .76rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; padding-right: 44px; margin: 0 0 1.5rem;
}
.kgs-detail-grid { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 3rem); }
.kgs-dialog .kgs-photo-box { overflow: hidden; border-radius: 10px; background: #f5e9e7; }
.kgs-dialog .kgs-photo { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; display: block; }
.kgs-dialog .kgs-no-photo { display: grid; place-items: center; color: #a56072; }
.kgs-dialog .kgs-no-photo svg { width: 28%; height: 28%; opacity: .55; }
.kgs-dialog .kgs-detail-price { font-size: 1.28rem; font-weight: 700; color: var(--kgs-cherry); margin: .8rem 0 .2rem; }
.kgs-dialog .kgs-offer { color: var(--kgs-cherry); font-size: .85rem; }
.kgs-dialog h2, .kgs-dialog h3 {
  font-family: var(--font-display, "Instrument Serif", Georgia, serif);
  font-weight: 500; letter-spacing: -.035em; color: var(--kgs-cherry); text-transform: none;
}
.kgs-dialog h2 { font-size: clamp(1.9rem, 3.1vw, 2.8rem); line-height: 1.08; overflow-wrap: anywhere; }
.kgs-dialog h3 { font-size: 1.7rem; line-height: 1.2; }
.kgs-dialog .kgs-description { margin: 1rem 0; white-space: pre-line; overflow-wrap: anywhere; font-size: .96rem; line-height: 1.6; }
.kgs-dialog .kgs-badge {
  display: inline-flex; align-items: center; gap: .42rem; padding: .33rem .6rem; background: #f5e7e9;
  color: #684252; border-radius: 2rem; font-size: .73rem; line-height: 1.4; font-weight: 600;
}
.kgs-dialog .kgs-badge i { width: .40rem; height: .40rem; background: currentColor; border-radius: 100%; }
.kgs-dialog .kgs-disponible { background: #e7eee1; color: #3e603d; }
.kgs-dialog .kgs-restock { background: #f7edd6; color: #75541c; }
.kgs-dialog .kgs-agotado { background: #eee4e5; color: #72585b; }
.kgs-dialog .kgs-field { display: block; font-size: .8rem; font-weight: 700; color: var(--kgs-cherry); margin: 1.2rem 0 .45rem; }
.kgs-dialog select, .kgs-copy-text { width: 100%; min-height: 42px; padding: .55rem; background: white; border: 1px solid #bc909c; border-radius: 6px; color: var(--kgs-ink); }
.kgs-dialog .kgs-add { margin-top: 1.45rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.kgs-dialog .kgs-primary, .kgs-dialog .kgs-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px;
  border: 1px solid var(--kgs-cherry); text-decoration: none; border-radius: 2rem;
  padding: .68rem 1.15rem; font-size: .9rem; line-height: 1.25; font-weight: 650;
}
.kgs-dialog .kgs-primary { color: #fffaf7; background: var(--kgs-cherry); }
.kgs-dialog .kgs-primary:hover:not(:disabled) { background: #4c0920; color: white; }
.kgs-dialog .kgs-secondary { color: var(--kgs-cherry); background: transparent; }
.kgs-dialog .kgs-primary:disabled { color: #795c63; border-color: #e6d9d9; background: #eee4e5; }
.kgs-dialog .kgs-qty { display: inline-flex; align-items: center; border: 1px solid var(--kgs-line); border-radius: 2rem; background: white; }
.kgs-dialog .kgs-qty button {
  display: grid; place-items: center; width: 32px; min-height: 39px; border: 0; background: none; padding: 0;
  border-radius: 2rem; color: var(--kgs-cherry);
}
.kgs-dialog .kgs-qty svg { width: 15px; height: 15px; }
.kgs-dialog .kgs-qty button:disabled { color: #cdb9be; }
.kgs-dialog .kgs-qty span { text-align: center; min-width: 1.6em; font-size: .88rem; font-variant-numeric: tabular-nums; }
.kgs-dialog .kgs-help, .kgs-dialog .kgs-feedback, .kgs-dialog .kgs-warning { font-size: .84rem; line-height: 1.5; margin: .7rem 0 0; }
.kgs-dialog .kgs-help { color: var(--kgs-muted); }
.kgs-dialog .kgs-feedback, .kgs-dialog .kgs-warning { color: var(--kgs-cherry); }
.kgs-feedback:empty { display: none; }
.kgs-cart { width: min(100%, 760px); margin: auto; }
.kgs-cart h2 { margin-right: 44px; }
.kgs-empty { text-align: center; padding: 2.1rem .5rem .9rem; }
.kgs-empty > svg { width: 34px; height: 34px; margin: 0 auto .7rem; color: var(--kgs-cherry); }
.kgs-dialog .kgs-empty p { margin: .5rem 0 1.2rem; color: var(--kgs-muted); }
.kgs-dialog .kgs-items { margin: 1.3rem 0; padding: 0; list-style: none; }
.kgs-item { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 1rem; border-bottom: 1px solid var(--kgs-line); padding: .9rem 0; }
.kgs-item:first-child { border-top: 1px solid var(--kgs-line); }
.kgs-dialog .kgs-thumb { width: 58px; height: 64px; object-fit: contain; border-radius: 6px; background: #f4e7e7; }
.kgs-dialog .kgs-item-name { font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; font-size: .96rem; }
.kgs-dialog .kgs-small { font-size: .8rem; line-height: 1.4; margin-top: .24rem; color: var(--kgs-muted); }
.kgs-item .kgs-badge { margin-top: .32rem; }
.kgs-tools { display: flex; flex-direction: column; align-items: flex-end; gap: .24rem; }
.kgs-dialog .kgs-remove { padding: .25rem .3rem; font-size: .78rem; text-decoration: underline; text-underline-offset: 3px; color: var(--kgs-cherry); border: 0; background: none; }
.kgs-total { display: flex; justify-content: space-between; gap: .65rem; margin: .7rem 0 1rem; align-items: baseline; }
.kgs-total strong { color: var(--kgs-cherry); font-size: 1.35rem; }
.kgs-fallback { display: flex; flex-wrap: wrap; gap: .65rem; margin: .85rem 0 0; }
.kgs-dialog .kgs-copy-text { min-height: 6.5rem; margin-top: .65rem; resize: vertical; }
@media(max-width: 600px) {
  .kgs-dialog { width: calc(100% - 1rem); max-height: 94dvh; border-radius: 15px; }
  .kgs-dialog .kgs-close { width: 36px; height: 36px; right: 12px; top: 12px; }
  .kgs-detail-grid { grid-template-columns: minmax(0,1fr); gap: 1rem; }
  .kgs-dialog .kgs-photo-box { max-width: 100%; }
  .kgs-dialog .kgs-photo { aspect-ratio: auto; height: min(34dvh, 285px); }
  .kgs-dialog .kgs-type { margin-bottom: 1.1rem; }
  .kgs-item { grid-template-columns: 45px minmax(0,1fr) auto; gap: .55rem; }
  .kgs-dialog .kgs-thumb { width: 45px; height: 55px; }
  .kgs-dialog .kgs-qty button { width: 27px; }
  .kgs-dialog .kgs-help { font-size: .81rem; }
}
