#sets-shop, #catalog-shop, #cart-dialog, .sd-toast {
  --shop-cream: var(--cream, #f8efdf);
  --shop-dark: var(--ink, #1d1a16);
  --shop-red: var(--red, #bc2d17);
  --shop-font: var(--display, "Arial Narrow", sans-serif);
  --shop-line: var(--line, #d6cab8);
  box-sizing: border-box;
}
:is(#sets-shop, #catalog-shop, #cart-dialog, .sd-toast) *,
:is(#sets-shop, #catalog-shop, #cart-dialog, .sd-toast) *::before,
:is(#sets-shop, #catalog-shop, #cart-dialog, .sd-toast) *::after { box-sizing: border-box; }
:is(#sets-shop, #catalog-shop, #cart-dialog, .sd-toast) button {
  font: inherit; color: inherit; cursor: pointer;
}
:is(#sets-shop, #catalog-shop, #cart-dialog, .sd-toast) button:focus-visible,
#cart-dialog a:focus-visible, #cart-dialog input:focus-visible {
  outline: 3px solid #ae7928; outline-offset: 3px;
}
:is(#sets-shop, #catalog-shop, #cart-dialog, .sd-toast) [hidden], .sd-toast[hidden] { display: none; }
#sets-shop, #catalog-shop, #sd-products { scroll-margin-top: 86px; }
.sd-wrap { width: min(100% - 2 * clamp(18px, 4vw, 66px), var(--container, 1200px)); margin-inline: auto; }
#sets-shop { background: var(--shop-cream); color: var(--shop-dark); padding: clamp(26px, 3.8vw, 58px) 0 clamp(32px, 4vw, 62px); }
.sd-tabs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: clamp(7px, 1.2vw, 22px); margin-bottom: clamp(23px, 3.5vw, 48px); }
#sets-shop .sd-set-tab {
  min-width: 0; min-height: 64px; padding: 6px; border: 1px solid #9c8d77; border-radius: 12px;
  background: transparent; color: var(--shop-dark); display: grid; grid-template-columns: minmax(38px, 35%) 1fr;
  grid-template-rows: 1fr 1fr; gap: 0 7px; align-items: center; text-align: left; line-height: 1.1;
}
.sd-set-tab img { grid-row: 1 / 3; width: 100%; height: 100%; min-height: 48px; max-height: 72px; object-fit: cover; border-radius: 7px; }
.sd-set-tab strong { align-self: end; }
.sd-set-tab small { align-self: start; }
.sd-set-tab strong { font: 700 clamp(18px, 2.2vw, 30px)/1.18 var(--shop-font); }
.sd-set-tab small { font: 600 clamp(11px, 1.2vw, 16px)/1.3 Arial,sans-serif; white-space: nowrap; }
#sets-shop .sd-set-tab[aria-pressed="true"] { color: #fff8eb; background: var(--shop-red); border-color: var(--shop-red); }
#sets-shop .sd-set-tab[aria-pressed="false"]:hover { background: #efe1ca; }
.sd-set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.98fr);
  grid-template-rows: auto 1fr auto; grid-template-areas: "photo title" "photo ingredients" "photo add";
  column-gap: clamp(20px, 5.5vw, 80px); align-items: start; }
.sd-set-title {
  grid-area: title; color: var(--shop-dark); margin: 0 0 18px; position: relative; width: fit-content;
  padding: 0 0 10px; font: 700 clamp(36px, 4.8vw, 70px)/1.08 var(--shop-font); letter-spacing: -.035em;
}
.sd-set-title::after { content: ""; position: absolute; width: 57%; height: 5px; right: -2%; bottom: -1px; border-radius: 90% 35% 65% 30%; background: var(--shop-red); transform: rotate(-3deg); }
.sd-set-photo { position: relative; grid-area: photo; align-self: stretch; margin: 0; min-height: clamp(300px, 32vw, 445px); overflow: hidden; border-radius: 18px; }
.sd-set-photo img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; display: block; }
.sd-set-photo figcaption { position: absolute; bottom: 12px; left: 12px; border-radius: 5px; background: #241a14d9; color: #fff4df; padding: 4px 8px; font: 500 11px/1.2 Arial,sans-serif; }
.sd-ingredients { grid-area: ingredients; padding: 0; margin: 0 0 20px; list-style: none; }
.sd-ingredients li { padding: 7px 0; display: flex; align-items: center; border-bottom: 1px solid var(--shop-line); gap: 6px; }
.sd-ingredients li:last-child { border: 0; }
.sd-ingredients li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--shop-red); flex: none; margin-right: 5px; }
.sd-ingredients li span, .sd-ingredients li b { color: var(--shop-dark); font: 700 clamp(17px,1.65vw,23px)/1.2 var(--shop-font); }
.sd-ingredients li b { margin-left: auto; white-space: nowrap; }
:is(#sets-shop,#cart-dialog) .sd-red, #cart-dialog .sd-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 49px; padding: 12px 20px;
  text-align: center; text-decoration: none; border: 1px solid var(--shop-red); border-radius: 10px;
  font: 700 19px/1.2 var(--shop-font); background: var(--shop-red); color: white;
}
:is(#sets-shop,#cart-dialog) .sd-red:hover { background: #9c2012; border-color: #9c2012; }
.sd-set-add { grid-area: add; align-self: end; }
.sd-set-add svg, .sd-empty svg { width: 24px; height: 24px; flex: none; }
#sets-shop .sd-set-add { min-height: 55px; font-size: clamp(20px, 2vw, 28px); }

#catalog-shop { background: #1a1a18; color: #fff3df; padding: clamp(26px,3vw,46px) 0 clamp(30px,3.5vw,54px); }
.sd-catalog-heading { display: flex; align-items: center; gap: clamp(14px, 3.5vw, 42px); margin-bottom: clamp(16px,2.3vw,30px); }
.sd-catalog-heading h2 { margin: 0; color: #fff3df; font: 700 clamp(32px,4vw,52px)/1.1 var(--shop-font); letter-spacing: -.035em; }
.sd-catalog-heading > span { flex: 1; height: 1px; background: #6c6357; }
.sd-featured { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(9px,1.7vw,24px); }
#catalog-shop .sd-cat-card {
  display: block; min-width: 0; overflow: hidden; border: 1px solid #615747; background: #211e1a;
  border-radius: 11px; text-align: left; padding: 0; color: #fff4df;
}
#catalog-shop .sd-cat-card:is(:hover,[aria-expanded="true"]) { border-color: #ffc68a; }
.sd-cat-card img { display: block; width: 100%; aspect-ratio: 2.35/1; object-fit: cover; }
.sd-cat-card span { padding: 8px 13px 10px; display: flex; align-items: center; gap: 10px; font: 700 clamp(19px,2.3vw,30px)/1.16 var(--shop-font); }
.sd-cat-card i { font: 400 .9em/1 Arial,sans-serif; }
.sd-category-bar { margin-top: 17px; }
#catalog-shop .sd-more { padding: 5px 0; display: inline-flex; align-items: center; gap: 8px; border: 0; color: #f1dfc3; background: transparent; font-weight: 700; }
.sd-more span { font-size: 1.3em; }
.sd-other { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
#catalog-shop .sd-other button { min-height: 37px; border: 1px solid #74675a; border-radius: 6px; background: transparent; color: #f4e5cb; padding: 7px 12px; font-size: 15px; }
#catalog-shop .sd-other button:is(:hover,[aria-pressed="true"]) { background: #f4e5cb; color: #221d18; }
#sd-products { border-top: 1px solid #514a40; margin-top: 24px; padding-top: 22px; }
#sd-products h3 { margin: 0 0 15px; color: #fff3df; font: 700 clamp(25px,3vw,37px)/1.15 var(--shop-font); }
.sd-products-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; }
.sd-photo-note { margin: -6px 0 16px; color: #d2c4ae; font-size: 13px; line-height: 1.4; }
.sd-product-photo { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.sd-product { background: #292620; border: 1px solid #514a40; border-radius: 9px; padding: 15px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sd-product h4 { color: #fff3df; margin: 0; font: 700 clamp(17px,1.65vw,22px)/1.23 var(--shop-font); }
.sd-product > div { display: flex; justify-content: space-between; margin-top: auto; gap: 8px; align-items: center; flex-wrap: wrap; }
.sd-product > div > span { font-weight: bold; }
.sd-card-ingredients { margin: -5px 0 0; color: #e4d7c2; font-size: 15px; line-height: 1.4; }
.sd-variant { display: grid; gap: 5px; font-size: 14px; color: #e4d7c2; }
.sd-variant select { width: 100%; min-width: 0; min-height: 40px; box-sizing: border-box; border: 1px solid #857766; border-radius: 6px; background: #342f28; color: #fff3df; padding: 5px 8px; font: inherit; }
.sd-addons { color: #f0dfc7; font-size: 14px; }
.sd-addons summary { width: fit-content; padding: 5px 0; cursor: pointer; font-weight: 700; }
.sd-addons label { display: flex; align-items: center; gap: 7px; padding: 5px 0; cursor: pointer; }
.sd-addons input { width: 17px; height: 17px; margin: 0; accent-color: #a93625; flex: none; }
.sd-addons label span { margin-left: auto; white-space: nowrap; color: #ffdab3; }
.sd-migration { font-size: 14px; }
.sd-product small { color: #e0cdb0; font-size: .78em; white-space: nowrap; }
#catalog-shop .sd-product button { background: #fff0d9; color: #782519; border: 0; border-radius: 5px; min-height: 36px; padding: 5px 10px; font-weight: 700; font-size: 14px; }
#catalog-shop .sd-product button:hover { background: #ffdab3; }

#cart-dialog { margin: auto; padding: 0; border: 1px solid #bdb09c; border-radius: 18px; width: min(750px, calc(100vw - 28px)); max-width: 100%;
  max-height: min(90vh,900px); max-height: min(90dvh,900px); background: var(--shop-cream); color: var(--shop-dark);
  overflow: auto; overscroll-behavior: contain; box-shadow: 0 25px 85px #190c0670;
  font: 400 16px/1.43 Arial,sans-serif; }
#cart-dialog:not([open]) { display:none; }
#cart-dialog::backdrop { background: rgba(21,16,12,.64); }
.sd-dialog-inner { padding: clamp(20px,4vw,36px); }
.sd-dialog-head { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; }
.sd-dialog-head h2 { margin: 0; color: var(--shop-dark); font: 700 clamp(30px,4vw,45px)/1.16 var(--shop-font); letter-spacing: -.025em; }
.sd-dialog-head h2:focus { outline: none; }
#cart-dialog .sd-close { border: 1px solid var(--shop-line); border-radius: 50%; width: 40px; height: 40px; background: transparent; color: var(--shop-dark); font: 28px/1 Arial,sans-serif; flex: none; }
#cart-dialog .sd-close:hover { background: #ebddc5; }
#cart-dialog h3 { margin: 22px 0 10px; color: inherit; font: 700 23px/1.2 var(--shop-font); }
.sd-lines, .sd-receipt ul { list-style: none; margin: 16px 0 20px; padding: 0; }
.sd-cart-line { padding: 12px 0; border-bottom: 1px solid var(--shop-line); display: grid; grid-template-columns: minmax(90px,1fr) auto minmax(64px,auto); gap: 4px 12px; align-items: center; }
.sd-line-name { grid-column: 1; grid-row: span 2; display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 3px 9px; align-content: center; }
.sd-line-name img { grid-row: 1 / 3; width: 48px; height: 48px; object-fit: cover; border-radius: 5px; }
.sd-line-name strong { font: 700 19px/1.26 var(--shop-font); }
.sd-line-name small, .sd-note { color: #605347; font-size: 13px; }
.sd-stepper { grid-row: span 2; display: grid; grid-template-columns: auto minmax(44px,auto) auto; align-items: center; justify-content: start; text-align: center; border: 1px solid #bbac97; border-radius: 7px; overflow: hidden; }
#cart-dialog .sd-stepper button { width: 34px; height: 36px; padding: 0; border: none; color: var(--shop-dark); background: transparent; font-size: 21px; }
#cart-dialog .sd-stepper button:hover { background: #eadac3; }
.sd-stepper span { font-size: 13px; white-space: nowrap; }
.sd-line-cost { text-align: right; white-space: nowrap; }
#cart-dialog .sd-remove, #cart-dialog .sd-text-link { padding: 0; color: #8c2518; background: none; border: none; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#cart-dialog .sd-remove { justify-self: end; font-size: 12px; font-weight: 400; }
.sd-mode { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#cart-dialog .sd-mode button { min-height: 43px; padding: 8px; border: 1px solid #ac9a81; background: transparent; border-radius: 8px; color: var(--shop-dark); font-weight: 700; }
#cart-dialog .sd-mode button[aria-pressed="true"] { border-color: var(--shop-red); box-shadow: inset 0 0 0 1px var(--shop-red); color: #8d2316; }
.sd-mode-detail { margin: 9px 0 17px; font-size: 14px; color: #5b4f43; }
.sd-mode-detail .sd-text-link { display: inline-block; margin: 5px 0; }
.sd-totals { padding: 13px 0; border-top: 1px solid var(--shop-line); }
.sd-totals p { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; margin: 6px 0; }
.sd-totals p > b { text-align: right; }
.sd-totals .sd-total { border-top: 1px solid var(--shop-line); padding-top: 12px; margin-top: 14px; font: 700 clamp(20px,3vw,27px)/1.2 var(--shop-font); }
.sd-next, .sd-note, .sd-receipt .sd-red { width: 100%; }
.sd-note { display: block; margin-top: 8px; text-align: center; }
#cart-dialog button:disabled { opacity: .52; cursor: default; }
#cart-dialog button.sd-red:disabled { background: #846959; border-color: #846959; }
.sd-check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(15px,2.5vw,28px); align-items: start; margin: 14px 0 18px; }
.sd-fields { display: grid; gap: 8px; }
.sd-fields p { font-size: 13px; margin: -4px 0 4px; color: #685a4c; }
.sd-fields label { font-weight: 600; font-size: 14px; }
.sd-fields input { display: block; width: 100%; height: 43px; padding: 8px 10px; margin-top: 3px; background: #fff9ed; border: 1px solid #ad9b81; border-radius: 6px; color: #221b16; font: 400 16px/1.3 Arial,sans-serif; }
.sd-receipt { min-width: 0; background: #24221d; color: #fff0d9; border-radius: 10px; padding: 15px; margin-top: 14px; }
#cart-dialog .sd-receipt h3 { margin: 0; }
.sd-receipt li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; }
.sd-receipt li span, .sd-receipt li b { font-size: 14px; }
.sd-receipt li b { white-space: nowrap; }
.sd-receipt small { display: block; margin-top: 8px; font-size: 12px; line-height: 1.32; color: #dfcdb4; }
.sd-empty, .sd-finished { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 24px 0 10px; }
.sd-empty svg { width: 42px; height: 42px; color: var(--shop-red); }
#cart-dialog :is(.sd-empty,.sd-finished) h3 { margin: 0; }
:is(.sd-empty,.sd-finished) p { margin: 0; overflow-wrap: anywhere; }
.sd-check { font: bold 28px/1 sans-serif; color: var(--shop-red); }
#cart-dialog .sd-outline { background: transparent; border-color: #ac9a81; color: var(--shop-dark); }
.sd-toast { position: fixed; z-index: 55; right: max(14px,env(safe-area-inset-right)); bottom: max(18px,env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 13px; padding: 12px 15px; border-radius: 10px; background: #25211a; color: #fff4de;
  box-shadow: 0 5px 20px #21180e55; max-width: min(420px,calc(100% - 28px)); font: 600 14px/1.33 Arial,sans-serif; }
.sd-toast button { flex: none; border: 0; padding: 6px; background: transparent; color: #ffc98a; text-decoration: underline; }

@media (max-width: 730px) {
  .sd-set { column-gap: 20px; }
  .sd-products-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 570px) {
  #sets-shop, #catalog-shop { padding-block: 20px 26px; }
  .sd-wrap { width: calc(100% - 32px); }
  .sd-tabs { gap: 5px; margin-bottom: 21px; }
  #sets-shop .sd-set-tab { padding: 3px 3px 6px; grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto auto; gap: 2px; text-align: center; border-radius: 8px; }
  .sd-set-tab img { grid-row: auto; height: auto; min-height: 0; aspect-ratio: 1.6; border-radius: 5px; }
  .sd-set-tab strong { font-size: 17px; }
  .sd-set-tab small { font-size: 11px; }
  .sd-set { grid-template-columns: minmax(0,1fr); grid-template-rows: auto; grid-template-areas: "title" "ingredients" "photo" "add"; gap: 11px; }
  .sd-set-title { font-size: 38px; padding-bottom: 6px; margin: 0 0 4px; }
  .sd-ingredients { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 12px; margin: 0 0 2px; }
  .sd-ingredients li { position: relative; display: block; padding: 2px 0 2px 14px; border: 0; }
  .sd-ingredients li::before { position: absolute; left: 0; top: 8px; width: 7px; height: 7px; }
  .sd-ingredients li span, .sd-ingredients li b { display: block; }
  .sd-ingredients li span { font-size: 16px; }
  .sd-ingredients li b { font: 500 13px/1.35 Arial,sans-serif; }
  .sd-set-photo { min-height: 0; aspect-ratio: 1.75; border-radius: 11px; }
  #sets-shop .sd-set-add { min-height: 47px; font-size: 19px; }
  .sd-catalog-heading { margin-bottom: 13px; }
  .sd-catalog-heading h2 { font-size: 31px; }
  .sd-featured { grid-template-columns: 1fr; gap: 7px; }
  #catalog-shop .sd-cat-card { display: flex; align-items: stretch; }
  .sd-cat-card img { width: 40%; max-height: 68px; aspect-ratio: 2.35/1; }
  .sd-cat-card span { flex: 1; padding: 7px 13px; font-size: 20px; justify-content: space-between; }
  .sd-category-bar { margin-top: 10px; }
  .sd-products-grid { grid-template-columns: 1fr; }
  .sd-product { display: grid; grid-template-columns: clamp(84px,29vw,145px) minmax(0,1fr); gap: 7px 12px; padding: 9px; }
  .sd-product > :not(img) { grid-column: 2; }
  .sd-product-photo { grid-row: 1 / 3; height: auto; min-height: 80px; align-self: start; }
  .sd-card-ingredients { margin: 0; font-size: 14px; }
  .sd-product > div { align-self: end; row-gap: 5px; }
  #cart-dialog { width: min(100vw - 12px, 520px); max-height: 95dvh; border-radius: 13px; }
  .sd-dialog-inner { padding: 17px; }
  .sd-check-grid { grid-template-columns: 1fr; gap: 2px; }
  .sd-cart-line { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .sd-line-name { grid-column: 1; grid-row: 1; }
  .sd-line-cost { grid-column: 2; grid-row: 1; }
  .sd-stepper { grid-column: 1; grid-row: 2; width: fit-content; }
  .sd-remove { grid-column: 2; grid-row: 2; }
}
