:root {
  --flowrand-fc-bg: #ffffff;
  --flowrand-fc-text: #18181b;
  --flowrand-fc-muted: #71717a;
  --flowrand-fc-border: #e4e4e7;
  --flowrand-fc-soft: #f4f4f5;
  --flowrand-fc-primary: #111827;
  --flowrand-fc-primary-text: #ffffff;
  --flowrand-fc-danger: #b91c1c;
  --flowrand-fc-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
  --flowrand-fc-radius: 16px;
}

.flowrand-fc-button,
.flowrand-fc-primary,
.flowrand-fc-secondary,
.flowrand-fc-cart-toggle,
.flowrand-fc-icon-button,
.flowrand-fc-remove,
.flowrand-fc-qty button {
  font: inherit;
}

.flowrand-fc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--flowrand-fc-primary);
  background: var(--flowrand-fc-primary);
  color: var(--flowrand-fc-primary-text) !important;
  text-decoration: none !important;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.flowrand-fc-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.flowrand-fc-button.is-loading,
.flowrand-fc-button--disabled {
  opacity: .72;
  pointer-events: none;
}

.flowrand-fc-button__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: flowrand-fc-spin .7s linear infinite;
}

.flowrand-fc-button.is-loading .flowrand-fc-button__spinner {
  display: inline-block;
}

.flowrand-fc-cart-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: unset;
  border-radius: 999px;
  padding: 9px 13px;
  background: unset!important;
  color: var(--flowrand-fc-text);
  cursor: pointer;
  /* box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); */
}

.flowrand-fc-cart-toggle--floating {
  position: fixed;
  z-index: 99997;
  right: 22px;
  bottom: 22px;
}

.flowrand-fc-cart-toggle__icon {
  display: inline-flex;
}

.flowrand-fc-cart-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-brand-1);
  color: var(--flowrand-fc-primary-text);
  font-size: 12px;
  font-weight: 800;
  position: absolute;
  top: 23px;
  left: 11px;
}

.flowrand-fc-cart-toggle__label {
  font-weight: 700;
}

.flowrand-fc-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(2px);
}

.flowrand-fc-drawer {
  position: fixed;
  inset-block: 0;
  right: 0;
  z-index: 999999;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(430px, 94vw);
  background: var(--flowrand-fc-bg);
  color: var(--flowrand-fc-text);
  box-shadow: var(--flowrand-fc-shadow);
  transform: translateX(105%);
  transition: transform .28s ease;
  direction: rtl;
}

.flowrand-fc-drawer.is-open {
  transform: translateX(0);
}

.flowrand-fc-lock {
  overflow: hidden;
}

.flowrand-fc-drawer__header,
.flowrand-fc-drawer__footer {
  padding: 18px;
  border-color: var(--flowrand-fc-border);
}

.flowrand-fc-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--flowrand-fc-border);
}

.flowrand-fc-drawer__header h2,
.flowrand-fc-variation-modal__header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.flowrand-fc-drawer__summary {
  margin: 6px 0 0;
  color: var(--flowrand-fc-muted);
  font-size: 13px;
}

.flowrand-fc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--flowrand-fc-border);
  border-radius: 999px;
  background: var(--flowrand-fc-bg);
  color: var(--flowrand-fc-text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.flowrand-fc-drawer__body {
  position: relative;
  overflow: auto;
  padding: 14px 18px;
}

.flowrand-fc-items {
  display: grid;
  gap: 14px;
}

.flowrand-fc-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--flowrand-fc-border);
  border-radius: var(--flowrand-fc-radius);
  background: #fff;
}

.flowrand-fc-item__image {
  overflow: hidden;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--flowrand-fc-soft);
}

.flowrand-fc-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flowrand-fc-item__content {
  min-width: 0;
}

.flowrand-fc-item__name {
  display: block;
  color: var(--flowrand-fc-text) !important;
  text-decoration: none !important;
  font-weight: 800;
  line-height: 1.35;
}

.flowrand-fc-item__meta {
  margin-top: 4px;
  color: var(--flowrand-fc-muted);
  font-size: 12px;
  line-height: 1.6;
}

.flowrand-fc-item__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.flowrand-fc-item__price {
  white-space: nowrap;
}

.flowrand-fc-qty {
  display: inline-grid;
  grid-template-columns: 28px 46px 28px;
  overflow: hidden;
  border: 1px solid var(--flowrand-fc-border);
  border-radius: 999px;
}

.flowrand-fc-qty button,
.flowrand-fc-qty input {
  height: 30px;
  border: 0;
  background: #fff;
  color: var(--flowrand-fc-text);
  text-align: center;
}

.flowrand-fc-qty button {
  cursor: pointer;
  background: var(--flowrand-fc-soft);
  font-weight: 800;
}

.flowrand-fc-qty input {
  width: 46px;
  padding: 0;
  appearance: textfield;
}

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

.flowrand-fc-remove {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--flowrand-fc-danger);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

.flowrand-fc-empty,
.flowrand-fc-loading,
.flowrand-fc-loading-inline,
.flowrand-fc-alert {
  padding: 18px;
  border-radius: var(--flowrand-fc-radius);
  background: var(--flowrand-fc-soft);
  color: var(--flowrand-fc-muted);
  text-align: center;
}

.flowrand-fc-drawer.is-loading .flowrand-fc-drawer__body::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.55);
  pointer-events: none;
}

.flowrand-fc-drawer__footer {
  border-top: 1px solid var(--flowrand-fc-border);
  background: #fff;
}

.flowrand-fc-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 15px;
}

.flowrand-fc-total strong {
  font-size: 18px;
}

.flowrand-fc-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.flowrand-fc-primary,
.flowrand-fc-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none !important;
  font-weight: 800;
  cursor: pointer;
}

.flowrand-fc-primary {
  border: 1px solid var(--flowrand-fc-primary);
  background: var(--flowrand-fc-primary);
  color: var(--flowrand-fc-primary-text) !important;
}

.flowrand-fc-secondary {
  border: 1px solid var(--flowrand-fc-border);
  background: var(--flowrand-fc-bg);
  color: var(--flowrand-fc-text) !important;
}

.flowrand-fc-primary--full {
  width: 100%;
}

.flowrand-fc-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.flowrand-fc-toast {
  position: fixed;
  z-index: 100001;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  padding: 12px 16px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: var(--flowrand-fc-shadow);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  direction: rtl;
  pointer-events: none;
}

.flowrand-fc-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.flowrand-fc-variation-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.44);
  direction: rtl;
}

.flowrand-fc-variation-modal.is-open {
  display: grid;
}

.flowrand-fc-variation-modal__panel {
  width: min(520px, 96vw);
  max-height: min(720px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 22px;
  background: var(--flowrand-fc-bg);
  box-shadow: var(--flowrand-fc-shadow);
}

.flowrand-fc-variation-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--flowrand-fc-border);
}

.flowrand-fc-variation-modal__body {
  overflow: auto;
  padding: 18px;
}

.flowrand-fc-product-head {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.flowrand-fc-product-head img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--flowrand-fc-soft);
}

.flowrand-fc-product-head h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.flowrand-fc-product-price {
  color: var(--flowrand-fc-muted);
  font-size: 14px;
}

.flowrand-fc-fields {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.flowrand-fc-field {
  display: grid;
  gap: 7px;
  color: var(--flowrand-fc-text);
  font-weight: 700;
}

.flowrand-fc-field select,
.flowrand-fc-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--flowrand-fc-border);
  border-radius: 12px;
  background: #fff;
  color: var(--flowrand-fc-text);
  font: inherit;
}

.flowrand-fc-field--qty {
  margin-bottom: 14px;
}

.flowrand-js-variation-message {
  margin-bottom: 14px;
  color: var(--flowrand-fc-danger);
}

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

@media (max-width: 767px) {
  .flowrand-fc-cart-toggle--floating {
    right: 14px;
    bottom: 14px;
  }

  .flowrand-fc-drawer {
    inset: auto 0 0 0;
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100vw;
    max-width: none;
    height: 70vh;
    height: 70dvh;
    max-height: 70vh;
    max-height: 70dvh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    transform: translateY(105%);
  }

  .flowrand-fc-drawer::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: var(--flowrand-fc-border);
    transform: translateX(-50%);
  }

  .flowrand-fc-drawer.is-open {
    transform: translateY(0);
  }

  .flowrand-fc-drawer__header {
    padding: 18px 16px 14px;
  }

  .flowrand-fc-drawer__body {
    padding: 12px 16px;
  }

  .flowrand-fc-drawer__footer {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .flowrand-fc-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .flowrand-fc-actions {
    grid-template-columns: 1fr;
  }
}

.flowrand-fc-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flowrand-fc-color-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid var(--flowrand-fc-border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}

.flowrand-fc-color-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flowrand-fc-color-option:has(input:checked) {
  border-color: var(--flowrand-fc-primary);
  box-shadow: inset 0 0 0 1px var(--flowrand-fc-primary);
}

.flowrand-fc-color-dot,
.flowrand-fc-color-dot img,
.flowrand-fc-color-dot__fallback {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
}

.flowrand-fc-color-dot img {
  object-fit: cover;
}

.flowrand-fc-color-label {
  font-size: 13px;
  white-space: nowrap;
}
