/* Storefront unified cart drawer + checkout + variant picker */

.sf-cart-badge {
  position: absolute;
  top: -2px;
  left: -4px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.1rem;
  text-align: center;
  pointer-events: none;
}
.sf-cart-badge.is-empty,
.sf-cart-badge[hidden] {
  display: none !important;
}
.sf-header-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sf-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}
.sf-cart-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.sf-cart-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sf-cart-drawer.is-open .sf-cart-drawer__backdrop {
  opacity: 1;
}
.sf-cart-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(100%, 26rem);
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.sf-cart-drawer.is-open .sf-cart-drawer__panel {
  transform: translateX(0);
}
html.sf-cart-open,
html.sf-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}
html.sf-scroll-lock body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
html.sf-scroll-lock .sf-cart-drawer__body,
html.sf-scroll-lock .sf-cart-checkout__scroll,
html.sf-scroll-lock .sf-cart-picker__scroll {
  touch-action: pan-y;
}
html.sf-scroll-lock .sf-cart-drawer__panel,
html.sf-scroll-lock .sf-cart-checkout__panel,
html.sf-scroll-lock .sf-cart-picker__panel,
html.sf-scroll-lock .sf-cart-picker__main,
html.sf-scroll-lock .sf-cart-picker__actions,
html.sf-scroll-lock .sf-cart-checkout__actions {
  touch-action: manipulation;
}

.sf-cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e5e7eb;
}
.sf-cart-drawer__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}
.sf-cart-drawer__close {
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f3f4f6;
  color: #111;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.sf-cart-drawer__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}
.sf-cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}
.sf-cart-empty p {
  margin: 0 0 1rem;
}
.sf-cart-empty__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 14rem;
  margin: 0 auto;
  text-decoration: none;
  box-sizing: border-box;
}

.sf-cart-line {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.sf-cart-line__img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #f3f4f6;
}
.sf-cart-line__img--ph {
  display: block;
}
.sf-cart-line__title {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
}
.sf-cart-line__meta {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  color: #6b7280;
}
.sf-cart-line__price {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 800;
}
.sf-cart-line__qty {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sf-cart-qty-btn {
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.sf-cart-line__qty-val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}
.sf-cart-line__remove {
  margin-inline-start: auto;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: #e11d48;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sf-cart-line__remove-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.sf-cart-line__remove:hover {
  background: #fff1f2;
  color: #be123c;
}
.sf-cart-line__remove:active {
  transform: scale(0.94);
}

.sf-cart-drawer__footer {
  border-top: 1px solid #e5e7eb;
  padding: 0.9rem 1.1rem calc(0.9rem + env(safe-area-inset-bottom));
  background: #fff;
  position: sticky;
  bottom: 0;
}
.sf-cart-drawer__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  font-weight: 800;
}
.sf-cart-drawer__total-val {
  font-size: 1.15rem;
}
.sf-cart-checkout-btn {
  width: 100%;
  border: 0;
  border-radius: 0.65rem;
  background: #111;
  color: #fff;
  font-weight: 800;
  padding: 0.9rem 1rem;
  cursor: pointer;
}
.sf-cart-checkout-btn:hover {
  background: #1f2937;
}

/* Checkout modal */
.sf-cart-checkout,
.sf-cart-picker {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}
.sf-cart-checkout.is-open,
.sf-cart-picker.is-open {
  pointer-events: auto;
  visibility: visible;
  overscroll-behavior: none;
}
.sf-cart-checkout__backdrop,
.sf-cart-picker__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
  touch-action: none;
}
.sf-cart-checkout.is-open .sf-cart-checkout__backdrop,
.sf-cart-picker.is-open .sf-cart-picker__backdrop {
  opacity: 1;
}
.sf-cart-checkout__panel,
.sf-cart-picker__panel {
  position: relative;
  width: min(100%, 28rem);
  max-height: min(92dvh, 40rem);
  overflow: hidden;
  background: #fff;
  border-radius: 1rem 1rem 0 0;
  padding: 1.15rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.sf-cart-picker__panel {
  max-height: none;
  height: auto;
  overflow: hidden;
}

/*
 * Mobile (FB/IG in-app): FULLSCREEN checkout — no bottom-sheet + keyboard hacks.
 * Form scrolls inside; submit stays pinned under the fields.
 */
@media (max-width: 767px) {
  .sf-cart-checkout.is-open {
    align-items: stretch;
  }
  .sf-cart-checkout.is-open .sf-cart-checkout__backdrop {
    opacity: 1;
  }
  .sf-cart-checkout.is-open .sf-cart-checkout__panel {
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    transform: none;
    padding: max(0.85rem, env(safe-area-inset-top)) 1.1rem calc(0.85rem + env(safe-area-inset-bottom));
    box-shadow: none;
  }
}

@media (min-width: 768px) {
  .sf-cart-checkout {
    align-items: center;
  }
  /* PC picker: outer scroll if tall — panel itself never scrolls inside */
  .sf-cart-picker.is-open {
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem 1rem;
    -webkit-overflow-scrolling: touch;
  }
  .sf-cart-checkout__panel {
    width: min(100% - 2rem, 42rem);
    max-height: min(92vh, 52rem);
    border-radius: 1.1rem;
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    padding: 1.35rem 1.5rem 1.35rem;
  }
  .sf-cart-picker__panel {
    width: min(100% - 2.5rem, 44rem);
    max-height: none;
    height: auto;
    border-radius: 1.5rem;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    padding: 0;
    overflow: hidden;
    margin: auto;
  }
  .sf-cart-checkout.is-open .sf-cart-checkout__panel,
  .sf-cart-picker.is-open .sf-cart-picker__panel {
    transform: none;
    opacity: 1;
  }
}
.sf-cart-checkout.is-open .sf-cart-checkout__panel,
.sf-cart-picker.is-open .sf-cart-picker__panel {
  transform: translateY(0);
}
@media (max-width: 767px) {
  .sf-cart-checkout.is-open .sf-cart-checkout__panel {
    transform: none;
  }
}

.sf-cart-checkout__head,
.sf-cart-picker__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex: 0 0 auto;
}
.sf-cart-checkout__head-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  text-align: right;
}
.sf-cart-checkout__head-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a1a1a 0%, #333 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.sf-cart-checkout__head-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}
.sf-cart-checkout__kicker {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 700;
}
.sf-cart-checkout__title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.4;
}
.sf-cart-checkout-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.sf-cart-checkout__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 0.5rem;
}
.sf-cart-checkout__foot {
  flex: 0 0 auto;
  padding-top: 0.85rem;
  margin-top: 0.35rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}
.sf-cart-field-wrap {
  margin-bottom: 0.75rem;
  min-width: 0;
}
.sf-cart-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  padding: 0.4rem 0.85rem 0.4rem 0.5rem;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, background-color 0.2s;
}
.sf-cart-field:focus-within {
  border-color: #111;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
.sf-cart-field__icon {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.sf-cart-field__icon svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.sf-cart-field--name .sf-cart-field__icon {
  background: #fff7ed;
  color: #c2410c;
}
.sf-cart-field--phone .sf-cart-field__icon {
  background: #ecfdf5;
  color: #047857;
}
.sf-cart-field--city .sf-cart-field__icon {
  background: #eff6ff;
  color: #1d4ed8;
}
.sf-cart-field--address .sf-cart-field__icon {
  background: #fdf2f8;
  color: #be185d;
}
.sf-cart-field__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  scroll-margin: 5rem 0 6rem;
}
.sf-cart-field__input:focus,
.sf-cart-field__input:focus-visible {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
.sf-cart-field__input::placeholder {
  color: #a3a3a3;
  font-weight: 500;
}
.sf-cart-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.sf-cart-field-row .sf-cart-field-wrap {
  margin-bottom: 0.75rem;
}
.sf-cart-form-error {
  color: #be123c;
  font-size: 0.85rem;
  margin: 0.35rem 0 0.6rem;
}
.sf-cart-checkout-submit {
  width: 100%;
  border: 0;
  border-radius: 0.65rem;
  background: #111;
  color: #fff;
  font-weight: 800;
  padding: 0.95rem 1rem;
  cursor: pointer;
  margin-top: 0;
}
.sf-cart-checkout-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}
.sf-cart-checkout-total {
  display: flex;
  justify-content: space-between;
  margin: 0.5rem 0 0.85rem;
  font-weight: 800;
}

.sf-cart-checkout-products {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}
.sf-cart-checkout-products__title {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #111;
}
.sf-cart-checkout-products__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.sf-cart-checkout-products__empty {
  margin: 0;
  font-size: 0.85rem;
  color: #9ca3af;
}
.sf-co-line {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem;
  border: 1px solid #eee;
  border-radius: 0.7rem;
  background: #fafafa;
}
.sf-co-line__img {
  width: 3.4rem;
  height: 3.4rem;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
  background: #e5e7eb;
}
.sf-co-line__img--ph {
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}
.sf-co-line__body {
  min-width: 0;
  flex: 1;
}
.sf-co-line__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sf-co-line__meta {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #6b7280;
}
.sf-co-line__row {
  margin: 0.35rem 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #4b5563;
  font-weight: 600;
}
.sf-co-line__price {
  color: #111;
  font-weight: 800;
}

.sf-cart-picker__opt {
  margin-bottom: 1.25rem;
}
.sf-cart-picker__panel {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(17, 17, 17, 0.06), transparent 55%),
    #fff;
}
.sf-cart-picker__layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.sf-cart-picker__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.sf-cart-picker__grab {
  display: none;
  justify-content: center;
  padding: 0.55rem 0 0.15rem;
}
.sf-cart-picker__grab span {
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 999px;
  background: #d1d5db;
}
.sf-cart-picker__close {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 5;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease;
}
.sf-cart-picker__close svg {
  width: 1.05rem;
  height: 1.05rem;
}
.sf-cart-picker__close:hover {
  background: #fff;
  transform: scale(1.05);
}
/* Default / mobile stack: no inner scroll unless mobile override */
.sf-cart-picker__scroll {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
}
.sf-cart-picker__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 18rem;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}
.sf-cart-picker__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease, transform 0.45s ease;
}
.sf-cart-picker.is-open .sf-cart-picker__img:not([hidden]) {
  animation: sfPickerImgIn 0.45s ease both;
}
@keyframes sfPickerImgIn {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}
.sf-cart-picker__img[hidden] {
  display: none;
}
.sf-cart-picker__img-ph {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1a1a1a 0%, #3f3f46 50%, #18181b 100%);
}
.sf-cart-picker__img-ph[hidden] {
  display: none;
}
.sf-cart-picker__info {
  padding: 1.05rem 1.1rem 0.35rem;
  text-align: right;
}
.sf-cart-picker__kicker {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #6b7280;
  letter-spacing: 0.04em;
}
.sf-cart-picker__kicker::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #111;
}
.sf-cart-picker__title {
  margin: 0.45rem 0 0;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1.3;
  color: #0a0a0a;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.sf-cart-picker__price {
  margin: 0.55rem 0 0;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.sf-cart-picker__price[hidden] {
  display: none;
}
.sf-cart-picker__note {
  margin: 0.55rem 0 0;
  min-height: 2.1em;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.45;
  color: #b91c1c;
  text-align: right;
  letter-spacing: 0.01em;
}
.sf-cart-picker__note.is-typing::after {
  content: '';
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-inline-start: 0.12em;
  background: #b91c1c;
  vertical-align: -0.12em;
  animation: sfPickerNoteCaret 0.7s step-end infinite;
}
@keyframes sfPickerNoteCaret {
  50% { opacity: 0; }
}
.sf-cart-picker__body {
  padding: 0.85rem 1.1rem 0.5rem;
}
.sf-cart-picker__opt-name {
  margin: 0 0 0.65rem;
  font-weight: 800;
  font-size: 0.82rem;
  color: #52525b;
  text-align: right;
}
.sf-cart-picker__values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start; /* RTL: starts from the right */
}
.sf-cart-picker__val {
  position: relative;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid #e4e4e7;
  border-radius: 0.85rem;
  background: #fff;
  color: #111;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.sf-cart-picker__val--color {
  min-width: 4.25rem;
  border-radius: 999px;
  padding-inline: 1rem;
}
.sf-cart-picker__val:hover:not(:disabled):not(.is-unavailable) {
  border-color: #18181b;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.sf-cart-picker__val:active:not(:disabled):not(.is-unavailable) {
  transform: scale(0.96);
}
.sf-cart-picker__val.is-selected {
  border-color: #111;
  background: #111;
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}
.sf-cart-picker__val.is-unavailable,
.sf-cart-picker__val:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
  background: #fafafa;
  box-shadow: none;
}
.sf-cart-picker__hint {
  margin: 0.25rem 1.25rem 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  background: #fff1f2;
  font-size: 0.8rem;
  font-weight: 700;
  color: #be123c;
  text-align: center;
}
.sf-cart-picker__hint[hidden] {
  display: none;
}
.sf-cart-picker__actions {
  display: flex;
  flex-direction: row; /* dir=rtl: إلغاء يمين، تأكيد يوسع لليسار */
  gap: 0.6rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.95rem 1.15rem calc(0.95rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-radius: 0 0 1.5rem 1.5rem;
}
.sf-cart-picker__actions button {
  border: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease, background 0.15s ease;
}
.sf-cart-picker__cancel {
  flex: 0 0 auto;
  min-width: 5.5rem;
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  background: #f4f4f5;
  color: #18181b;
  font-weight: 800;
  font-size: 0.92rem;
}
.sf-cart-picker__cancel:hover {
  background: #e4e4e7;
}
.sf-cart-picker__confirm {
  flex: 1;
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(145deg, #111 0%, #2a2a2a 100%);
  color: #fff;
  font-weight: 900;
  font-size: 0.98rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.sf-cart-picker__confirm-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.sf-cart-picker__confirm:hover:not(:disabled) {
  transform: translateY(-1px);
}
.sf-cart-picker__confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

@media (max-width: 767px) {
  .sf-cart-picker.is-open {
    align-items: flex-end;
  }
  .sf-cart-picker.is-open .sf-cart-picker__panel {
    width: 100%;
    max-width: none;
    max-height: min(94dvh, 40rem);
    height: auto;
    overflow: hidden;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 0;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.22);
  }
  .sf-cart-picker__grab {
    display: flex;
  }
  /* Same as PC: image left, options/actions right */
  .sf-cart-picker__layout {
    display: grid;
    grid-template-columns: minmax(8.5rem, 44%) minmax(0, 1fr);
    direction: ltr;
    align-items: stretch;
    min-height: 0;
    max-height: min(88dvh, 38rem);
  }
  .sf-cart-picker__media {
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 100%;
    height: auto;
    aspect-ratio: unset;
    flex: none;
    align-self: stretch;
    border-radius: 0;
    overflow: hidden;
  }
  .sf-cart-picker__img,
  .sf-cart-picker__img-ph {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .sf-cart-picker__main {
    direction: rtl;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    min-height: 0;
    text-align: right;
    background: #fff;
  }
  .sf-cart-picker__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .sf-cart-picker__close {
    top: 0.3rem;
    left: auto;
    right: 0.3rem;
    width: 2.05rem;
    height: 2.05rem;
  }
  .sf-cart-picker__info {
    padding: 2.35rem 0.85rem 0.2rem;
  }
  .sf-cart-picker__kicker {
    font-size: 0.62rem;
  }
  .sf-cart-picker__title {
    margin-top: 0.3rem;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.3;
  }
  .sf-cart-picker__price {
    margin-top: 0.4rem;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
  }
  .sf-cart-picker__note {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1.4;
  }
  .sf-cart-picker__body {
    padding: 0.45rem 0.85rem 0.25rem;
  }
  .sf-cart-picker__opt {
    margin-bottom: 0.75rem;
  }
  .sf-cart-picker__opt-name {
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
  }
  .sf-cart-picker__hint {
    margin: 0.15rem 0.85rem 0.55rem;
  }
  .sf-cart-picker__actions {
    border-radius: 0;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
  }
  .sf-cart-picker__cancel {
    min-width: 4.25rem;
    padding: 0.7rem 0.65rem;
    font-size: 0.8rem;
  }
  .sf-cart-picker__confirm {
    padding: 0.7rem 0.65rem;
    font-size: 0.84rem;
    gap: 0.3rem;
  }
  .sf-cart-picker__confirm-icon {
    width: 1rem;
    height: 1rem;
  }
  .sf-cart-picker__val {
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    border-radius: 0.65rem;
  }
  .sf-cart-picker__val--color {
    min-width: 3.25rem;
    padding-inline: 0.65rem;
  }
}

/* PC layout MUST come after base/mobile rules (cascade) */
@media (min-width: 768px) {
  .sf-cart-picker.is-open {
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem 1rem;
  }
  .sf-cart-picker__panel {
    width: min(100% - 1.25rem, 56rem);
  }
  .sf-cart-picker__layout {
    display: grid;
    grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
    direction: ltr;
    align-items: stretch;
    min-height: 28rem;
  }
  .sf-cart-picker__media {
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 28rem;
    height: 100%;
    aspect-ratio: unset;
    flex: none;
    align-self: stretch;
    border-radius: 1.5rem 0 0 1.5rem;
    overflow: hidden;
  }
  .sf-cart-picker__img,
  .sf-cart-picker__img-ph {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .sf-cart-picker__main {
    direction: rtl;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    text-align: right;
    background: #fff;
  }
  .sf-cart-picker__scroll {
    flex: 1 1 auto;
    overflow: visible;
  }
  .sf-cart-picker__info {
    padding: 2.75rem 1.15rem 0.3rem;
  }
  .sf-cart-picker__title {
    font-size: 1.2rem;
    line-height: 1.35;
  }
  .sf-cart-picker__body {
    padding: 0.65rem 1.15rem 0.35rem;
  }
  .sf-cart-picker__hint {
    margin: 0.2rem 1.15rem 0.75rem;
  }
  .sf-cart-picker__close {
    left: auto;
    right: 0.45rem;
    top: 0.4rem;
  }
  .sf-cart-picker__actions {
    border-radius: 0 0 1.5rem 0;
    margin-top: auto;
    padding-inline: 1.15rem;
  }
}

.sf-cart-toast {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 220;
  background: #111;
  color: #fff;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
.sf-cart-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.pd-order-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.pd-order-actions .pd-order-form__submit {
  margin: 0;
}
.pd-add-cart-btn {
  width: 100%;
  margin: 0;
  border: 2px solid #111;
  border-radius: 0.65rem;
  background: #fff;
  color: #111;
  font-weight: 800;
  padding: 0.7rem 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.pd-add-cart-btn__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}
.pd-add-cart-btn:hover:not(:disabled) {
  background: #f9fafb;
}
.pd-add-cart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Focus helpers — no viewport lifting hacks (those break FB/IG) */
html.sf-kb-open .pd-sticky-order-bar,
html.sf-kb-open #whatsapp-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.sf-kb-open #order-form-container,
html.sf-kb-open .pd-order-card {
  padding-bottom: 10rem;
}

.pd-order-field__input {
  scroll-margin: 5rem 0 8rem;
}

