.ccart {
  --ccart-primary: #f97316;
  --ccart-btn-text: #ffffff;
  --cmg-primary: var(--ccart-primary);
  --cmg-text: #1f2937;
  position: fixed;
  inset: auto;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  font-family: inherit;
  pointer-events: none;
}

.ccart > * {
  pointer-events: auto;
}

.ccart--inactive {
  visibility: hidden;
  opacity: 0;
  pointer-events: none !important;
}

.ccart--inactive > * {
  pointer-events: none !important;
}

.ccart-panel[hidden],
.ccart-modal[hidden],
.ccart-sticky-checkout[hidden],
.ccart-delivery-form[hidden],
.ccart-preview-table[hidden],
[data-ccart-delivery-modal][hidden] {
  display: none !important;
}

.ccart--internal-mode .ccart-delivery-form {
  display: none !important;
}

.ccart-sticky-checkout {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 100002;
  width: min(94vw, 560px);
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  background: var(--ccart-primary);
  color: var(--ccart-btn-text);
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 16px 30px color-mix(in srgb, var(--ccart-primary) 40%, transparent);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.ccart-sticky-checkout.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ccart-sticky-checkout.is-bump {
  animation: ccart-checkout-bump 520ms cubic-bezier(.2,.9,.2,1);
}

.ccart-flyer {
  position: fixed;
  z-index: 100050;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  margin-top: -28px;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  transition: transform 0.65s cubic-bezier(.2,.8,.2,1), opacity 0.65s ease;
  will-change: transform, opacity;
}

.ccart-flyer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ccart-flyer-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, #fdba74, var(--ccart-primary, #f97316));
}

@keyframes ccart-checkout-bump {
  0% {
    transform: translateX(-50%) scale(1);
  }
  35% {
    transform: translateX(-50%) scale(1.08);
  }
  70% {
    transform: translateX(-50%) scale(0.97);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

.ccart-sticky-checkout:hover {
  filter: brightness(1.03);
}

.ccart-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 100001;
  width: min(92vw, 370px);
  max-height: min(76vh, 700px);
  margin-top: 0.65rem;
  margin-left: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ccart-header,
.ccart-footer {
  padding: 0.85rem 0.95rem;
}

.ccart-header {
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ccart-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.ccart-close {
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: #4b5563;
}

.ccart-empty {
  color: #6b7280;
  padding: 0.95rem;
}

.ccart-items {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.75rem 0.8rem;
  overflow: auto;
}

.ccart-item {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 12px;
  padding: 0.6rem;
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.7rem;
  align-items: start;
}

.ccart-item-leading {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  grid-column: 1 / -1;
}

.ccart-item-thumb,
.ccart-item-thumb--empty {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex: 0 0 52px;
  object-fit: cover;
  background: #f3f4f6;
}

.ccart-item-thumb--empty {
  display: inline-block;
  border: 1px dashed rgba(17, 24, 39, 0.12);
}

.ccart-item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.ccart-item-main strong {
  display: block;
}

.ccart-item-main small {
  color: #6b7280;
}

.ccart-supp-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ccart-supp-list li {
  font-size: 0.78rem;
  background: #fff7ed;
  color: #c2410c;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.ccart-ing-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ccart-ing-list li {
  font-size: 0.76rem;
  color: #6b7280;
}

.ccart-ing-note {
  display: block;
  font-size: 0.76rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.ccart-preview-ing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin-bottom: 0.35rem;
}

.ccart-preview-ing-list label {
  font-size: 0.8rem;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ccart-preview-ing-list input[type="checkbox"] {
  accent-color: var(--ccart-primary);
}

.ccart-item-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  grid-column: 1;
}

.ccart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  grid-column: 2;
}

.ccart .cmg-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.ccart .cmg-qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  min-width: 1.1rem;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cmg-primary);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.ccart .cmg-qty-btn:hover {
  color: color-mix(in srgb, var(--cmg-primary) 82%, #000);
  background: transparent;
}

.ccart .cmg-qty-btn:active {
  transform: scale(0.94);
}

.ccart .cmg-qty-btn:focus-visible {
  outline: 2px solid var(--cmg-primary);
  outline-offset: 2px;
}

.ccart .cmg-qty-input {
  width: 1.65rem;
  height: 1.5rem;
  border: 0;
  background: transparent;
  text-align: center;
  color: var(--cmg-text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0;
  -moz-appearance: textfield;
}

.ccart .cmg-qty-input::-webkit-outer-spin-button,
.ccart .cmg-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ccart .cmg-qty-input:focus {
  outline: none;
}

.ccart-remove {
  border: 0;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.86rem;
}

.ccart-footer {
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  background: #fcfcfd;
}

.ccart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.ccart-clear {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.ccart-footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.ccart-checkout {
  border: 0;
  border-radius: 10px;
  background: var(--ccart-primary);
  color: var(--ccart-btn-text);
  font-weight: 700;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.ccart-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ccart-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: grid;
  place-items: center;
  z-index: 100002;
  padding: 1rem;
}

.ccart-modal:not([hidden]) {
  display: grid !important;
}

.ccart-modal-dialog {
  width: min(94vw, 520px);
  max-height: 85vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  box-shadow: 0 28px 56px rgba(17, 24, 39, 0.32);
  padding: 0.95rem;
}

.ccart-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.ccart-modal-head h4 {
  margin: 0;
  font-size: 1.03rem;
}

.ccart-preview-table {
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.ccart-preview-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ccart-preview-item {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 10px;
  padding: 0.55rem;
  display: block;
  position: relative;
  margin-top: 0.5rem;
}

.ccart-preview-item-main {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
}

.ccart-preview-image {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 54px;
}

.ccart-preview-item-copy {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 1.9rem;
}

.ccart-preview-supp-editor {
  margin-top: 0.35rem;
}

.ccart-preview-ing-editor {
  margin-top: 0.35rem;
}

.ccart-preview-ing-title,
.ccart-preview-supp-title {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ccart-unit-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.ccart-preview-units {
  margin-top: 0.45rem;
}

.ccart-unit-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.45) transparent;
  padding-bottom: 0.15rem;
  margin-bottom: 0.45rem;
}

.ccart-unit-tab {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 3.1rem;
  padding: 0.28rem 0.32rem 0.32rem;
  border: 1px solid rgba(249, 115, 22, 0.24);
  border-radius: 10px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.ccart-unit-tab.is-active {
  border-color: var(--ccart-primary);
  background: rgba(249, 115, 22, 0.08);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.ccart-unit-tab-image {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 7px;
  object-fit: cover;
  display: block;
}

.ccart-unit-tab-image--empty {
  background: rgba(17, 24, 39, 0.06);
}

.ccart-unit-tab-label {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ccart-primary);
}

.ccart-unit-panel {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  background: #fafafa;
}

.ccart-unit-panel-label {
  display: block;
  color: #6b7280;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.ccart-unit-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0.55rem;
  align-items: start;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 10px;
  padding: 0.45rem;
  background: #fafafa;
}

.ccart-unit-image {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
}

.ccart-unit-image--empty {
  background: rgba(17,24,39,.06);
}

.ccart-unit-label {
  display: block;
  color: #6b7280;
  margin-bottom: 0.2rem;
}

.ccart-no-supp {
  color: #9ca3af;
}

.ccart-preview-supp-title {
  display: block;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.ccart-preview-supp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
}

.ccart-preview-supp-list label {
  font-size: 0.82rem;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ccart-preview-supp-list input[type="checkbox"] {
  accent-color: var(--ccart-primary);
}

.ccart-preview-item-main strong {
  display: block;
}

.ccart-preview-item-main small {
  color: #6b7280;
}

.ccart-preview-remove {
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: transparent !important;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.12);
  text-indent: 0;
  overflow: visible;
  appearance: none;
}

.ccart-preview-remove:hover {
  background: rgba(17, 24, 39, 0.06);
}

.ccart-preview-remove::before {
  content: '×';
  color: #f97316 !important;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.ccart-preview-remove:hover::before {
  color: #ea580c !important;
}

.ccart-preview-item-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-left: 0.1rem;
}

.ccart-preview-item-right span {
  color: #6b7280;
}

.ccart-preview-qty {
  display: flex;
  align-items: center;
}

.ccart-preview-split {
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.ccart-preview-total {
  margin-top: 0.8rem;
}

.ccart-modal-actions {
  margin-top: 0.7rem;
  display: flex !important;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ccart-cancel,
.ccart-validate {
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.ccart-cancel {
  border: 1px solid rgba(17, 24, 39, 0.2);
  background: #fff;
  color: #111827;
}

.ccart-validate {
  border: 0 !important;
  background: #16a34a !important;
  color: #fff !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  min-width: 170px;
  white-space: nowrap;
  flex: 0 0 auto;
  visibility: visible !important;
  opacity: 1 !important;
}

.ccart-validate.is-loading {
  cursor: wait;
  opacity: 0.92 !important;
}

.ccart-busy {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 10015;
  opacity: 0;
  transition: opacity 180ms ease;
  padding: 1rem;
}

.ccart-busy.is-visible {
  opacity: 1;
}

.ccart-busy[hidden] {
  display: none !important;
}

.ccart-busy-card {
  width: min(92vw, 340px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
  padding: 1.2rem 1.1rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  animation: ccart-success-in 320ms cubic-bezier(.2,.8,.2,1);
}

.ccart-busy-card strong {
  color: #0f172a;
  font-size: 1rem;
}

.ccart-busy-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.4;
}

.ccart-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(249, 115, 22, 0.18);
  border-top-color: var(--ccart-primary, #f97316);
  animation: ccart-spin 0.75s linear infinite;
}

.ccart-spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes ccart-spin {
  to {
    transform: rotate(360deg);
  }
}

body.ccart-modal-open {
  overflow: hidden;
}

.ccart-success {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: auto;
  cursor: pointer;
  z-index: 100200;
  opacity: 0;
  transition: opacity 220ms ease;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.ccart-success.is-visible {
  opacity: 1;
}

.ccart-success-card {
  min-width: min(90vw, 360px);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.26);
  padding: 1.15rem 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  transform: translateY(12px) scale(0.97);
  animation: ccart-success-in 360ms cubic-bezier(.2,.8,.2,1) forwards;
  pointer-events: none;
}

.ccart-success-card--hero {
  min-width: min(92vw, 400px);
  flex-direction: column;
  text-align: center;
  padding: 1.6rem 1.4rem 1.45rem;
  border-radius: 22px;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 42%),
    radial-gradient(circle at bottom left, rgba(249, 115, 22, 0.12), transparent 40%),
    #fff;
}

.ccart-success-burst {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.16) 0%, transparent 55%);
  animation: ccart-success-burst 900ms ease-out;
  pointer-events: none;
}

.ccart-success-copy {
  display: grid;
  gap: 0.28rem;
  justify-items: center;
}

.ccart-success-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #16a34a;
}

.ccart-success-copy strong {
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.2;
}

.ccart-success-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #166534 !important;
  font-weight: 800;
  font-size: 0.9rem !important;
}

.ccart-success-hint {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.4;
  max-width: 18rem;
}

.ccart-success-check {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(145deg, #22c55e, #16a34a);
  position: relative;
  flex: 0 0 auto;
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.38);
  animation: ccart-success-pop 620ms cubic-bezier(.2,.9,.2,1);
}

.ccart-success-check::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 16px;
  width: 14px;
  height: 24px;
  border-right: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(42deg);
  animation: ccart-check-draw 420ms ease 120ms both;
}

.ccart-success-check::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 2px solid rgba(34, 197, 94, 0.35);
  animation: ccart-ring-pulse 1.1s ease-out 180ms;
}

@keyframes ccart-success-burst {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ccart-check-draw {
  from {
    opacity: 0;
    transform: rotate(42deg) scale(0.6);
  }
  to {
    opacity: 1;
    transform: rotate(42deg) scale(1);
  }
}

@keyframes ccart-ring-pulse {
  from {
    transform: scale(0.8);
    opacity: 0.9;
  }
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}

.ccart-confetti {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

.ccart-confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size, 8px);
  height: calc(var(--size, 8px) * 1.6);
  border-radius: 2px;
  background: var(--c, #f97316);
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: ccart-confetti-burst var(--dur, 1.1s) ease-out var(--delay, 0s) forwards;
}

@keyframes ccart-success-in {
  from {
    transform: translateY(18px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes ccart-success-pop {
  0% {
    transform: scale(0.55);
  }
  55% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes ccart-confetti-burst {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.6);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--x, 0px)), calc(-50% + var(--y, 160px))) rotate(var(--r, 120deg)) scale(1);
    opacity: 0;
  }
}

.ccart-preview-total {
  margin-top: 0.35rem;
}

.ccart-delivery-form:not([hidden]) {
  display: grid;
  gap: 0.8rem;
  margin: 0.25rem 0 0.9rem;
  padding: 1rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--ccart-primary) 18%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--ccart-primary) 8%, #fff) 0%, #fff9f3 100%);
  border: 1px solid color-mix(in srgb, var(--ccart-primary) 22%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.ccart-delivery-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid color-mix(in srgb, var(--ccart-primary) 16%, transparent);
}

.ccart-delivery-brand[hidden] {
  display: none !important;
}

.ccart-delivery-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ccart-primary) 14%, transparent);
  flex-shrink: 0;
}

.ccart-delivery-logo[hidden] {
  display: none !important;
}

.ccart-delivery-brand-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.ccart-delivery-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ccart-delivery-brand-tag {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ccart-primary);
  background: color-mix(in srgb, var(--ccart-primary) 14%, #fff);
}

.ccart-delivery-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ccart-primary) 78%, #0f172a);
}

.ccart-delivery-title::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ccart-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ccart-primary) 18%, transparent);
  flex-shrink: 0;
}

.ccart-delivery-field {
  display: grid;
  gap: 0.35rem;
}

.ccart-delivery-field span {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.58);
}

.ccart-delivery-field input,
.ccart-delivery-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ccart-delivery-field textarea {
  resize: vertical;
  min-height: 4.25rem;
  max-height: 9rem;
  line-height: 1.45;
}

@media (max-height: 700px) {
  .ccart-delivery-hero {
    padding: 1rem 1rem 0.9rem;
  }

  .ccart-delivery-hero .ccart-delivery-logo {
    width: 44px;
    height: 44px;
  }

  .ccart-delivery-field textarea {
    min-height: 3.5rem;
  }

  .ccart-delivery-sheet {
    padding-top: 0.85rem;
  }

  .ccart-delivery-sheet .ccart-delivery-form {
    gap: 0.65rem;
    padding: 0.7rem;
  }
}

.ccart-delivery-field input:focus,
.ccart-delivery-field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ccart-primary) 55%, transparent);
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ccart-primary) 16%, transparent);
}

.ccart-delivery-field input::placeholder,
.ccart-delivery-field textarea::placeholder {
  color: rgba(15, 23, 42, 0.38);
}

/* —— Modal livraison (après validation du panier) —— */
.ccart-modal--delivery {
  z-index: 100003;
}

.ccart-modal-dialog--delivery {
  display: flex;
  flex-direction: column;
  width: min(94vw, 440px);
  max-height: min(92vh, 100dvh - 1.25rem);
  padding: 0;
  overflow: hidden;
  border: none;
  border-radius: 20px;
  box-shadow: 0 32px 64px rgba(15, 23, 42, 0.28);
}

.ccart-delivery-hero {
  position: relative;
  flex: 0 0 auto;
  padding: 1.35rem 1.1rem 1.15rem;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.28), transparent 48%),
    linear-gradient(145deg, var(--ccart-primary) 0%, color-mix(in srgb, var(--ccart-primary) 72%, #0f172a) 100%);
  color: var(--ccart-btn-text, #fff);
}

.ccart-delivery-hero-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.ccart-delivery-hero-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 2.25rem;
}

.ccart-delivery-hero-brand[hidden] {
  display: none !important;
}

.ccart-delivery-hero .ccart-delivery-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.ccart-delivery-hero .ccart-delivery-brand-name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: inherit;
  line-height: 1.2;
  white-space: normal;
}

.ccart-delivery-hero .ccart-delivery-brand-tag {
  color: var(--ccart-primary);
  background: rgba(255, 255, 255, 0.94);
}

.ccart-delivery-sheet {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.05rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
}

.ccart-delivery-lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.68);
}

.ccart-delivery-sheet .ccart-delivery-form {
  margin: 0 0 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
}

.ccart-delivery-total {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ccart-primary) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--ccart-primary) 18%, transparent);
}

.ccart-modal-actions--delivery {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.55rem;
  margin: 0 -0.15rem;
  padding: 0.65rem 0.15rem 0.15rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
}

.ccart-delivery-submit {
  background: var(--ccart-primary);
  color: var(--ccart-btn-text, #fff);
  border: none;
  font-weight: 800;
}

.ccart-delivery-submit:hover {
  filter: brightness(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .ccart-confetti-piece,
  .ccart-success-card,
  .ccart-success-check,
  .ccart-spinner,
  .ccart-busy-card,
  .ccart-sticky-checkout.is-bump,
  .ccart-flyer {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .ccart {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: auto;
  }

  .ccart-panel {
    width: min(96vw, 370px);
    max-height: min(70vh, 620px);
  }

  .ccart-sticky-checkout {
    width: min(96vw, 560px);
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .ccart-footer-actions {
    grid-template-columns: 1fr;
  }

  .ccart-item {
    grid-template-columns: 1fr;
  }

  .ccart-item-right {
    justify-content: space-between;
  }
}

/* Caisse POS — panier dans la colonne (annule position fixed du panier flottant) */
.mmpos-cart-slot .ccart,
.mmpos-cart-slot .ccart.ccart--pos {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  pointer-events: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.mmpos-cart-slot .ccart.ccart--inactive {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mmpos-cart-slot .ccart-panel {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.mmpos-cart-slot .ccart-header,
.mmpos-cart-slot .ccart-footer {
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box;
}

.mmpos-cart-slot .ccart-header--pos,
.mmpos-cart-slot .ccart-footer.ccart-footer--pos {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.mmpos-cart-slot .ccart-items {
  padding-left: 12px !important;
  padding-right: 12px !important;
  box-sizing: border-box;
}
