.flexa-minicart,
.flexa-minicart * {
  box-sizing: border-box;
}

.flexa-minicart {
  position: relative;
  display: inline-flex;
  font-family: inherit;
  line-height: 1.4;
}

.flexa-minicart-toggle {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--fm-radius, 16px);
  border: 1px solid rgba(17, 24, 39, .10);
  background: var(--fm-button-bg, #fff);
  color: var(--fm-button-color, #111827);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(17, 24, 39, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.flexa-minicart--icon-only .flexa-minicart-toggle {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
}

.flexa-minicart-toggle:hover,
.flexa-minicart-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--fm-accent, #2563eb) 50%, transparent);
  box-shadow: 0 10px 26px rgba(17, 24, 39, .10);
  outline: none;
}

.flexa-minicart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--fm-accent, #2563eb);
  line-height: 1;
}

.flexa-minicart-icon i,
.flexa-minicart-icon svg,
.fm-empty-icon i,
.fm-empty-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.fm-icon-svg {
  fill: currentColor;
}

.flexa-minicart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--fm-count-bg, var(--fm-accent, #2563eb));
  color: var(--fm-count-color, #fff);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.flexa-minicart--hide-empty-count .flexa-minicart-count.is-empty {
  display: none;
}

.flexa-minicart--count-top-right .flexa-minicart-count {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(36%, -36%);
  box-shadow: 0 6px 16px rgba(17, 24, 39, .16);
}

.flexa-minicart-overlay {
  display: none;
}

.flexa-minicart-panel {
  background: #fff;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, .10);
  border-radius: var(--fm-radius, 16px);
  box-shadow: 0 18px 60px rgba(17, 24, 39, .16);
  overflow: hidden;
  z-index: 999999;
  font-family: inherit;
}

.flexa-minicart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(17, 24, 39, .08);
}

.flexa-minicart-panel-head strong {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.flexa-minicart-close {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.flexa-minicart-close:hover {
  background: #e5e7eb;
}

.flexa-minicart--dropdown .flexa-minicart-panel {
  position: absolute;
  top: calc(100% + 12px);
  width: min(var(--fm-panel-width, 390px), calc(100vw - 24px));
  max-height: min(680px, calc(100vh - 120px));
  overflow-y: auto;
  display: none;
}

.flexa-minicart--dropdown.flexa-minicart--align-right .flexa-minicart-panel {
  right: 0;
}

.flexa-minicart--dropdown.flexa-minicart--align-left .flexa-minicart-panel {
  left: 0;
}

.flexa-minicart--dropdown.is-open .flexa-minicart-panel {
  display: block;
  animation: fmDrop .18s ease both;
}

.flexa-minicart--drawer .flexa-minicart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .38);
  z-index: 999998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.flexa-minicart--drawer .flexa-minicart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(var(--fm-panel-width, 390px), 92vw);
  height: 100vh;
  border-radius: 0;
  transform: translateX(104%);
  transition: transform .24s ease;
  display: flex;
  flex-direction: column;
}

.flexa-minicart--drawer .flexa-minicart-panel-inner {
  overflow-y: auto;
  flex: 1;
}

.flexa-minicart--drawer.is-open .flexa-minicart-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.flexa-minicart--drawer.is-open .flexa-minicart-panel {
  transform: translateX(0);
}

body.flexa-minicart-lock {
  overflow: hidden;
}

.fm-loading,
.fm-empty {
  padding: 28px 18px;
  text-align: center;
  color: #6b7280;
}

.fm-empty p {
  margin: 0 0 14px;
}

.fm-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fm-accent, #2563eb) 10%, white);
  color: var(--fm-accent, #2563eb);
}

.fm-items {
  display: grid;
  gap: 0;
}

.fm-item {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(17, 24, 39, .07);
}

.fm-item-thumb {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
}

.fm-item-thumb::after {
  content: "";
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(17,24,39,.06), rgba(17,24,39,.02));
}

.fm-item-thumb.is-broken::after,
.fm-item-thumb:empty::after {
  display: block;
}

.fm-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #fff;
}


.fm-item-thumb img.fm-thumb-img--fpd {
  object-fit: contain !important;
  background: #fff;
}

.fm-thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(17,24,39,.06), rgba(17,24,39,.02));
}

.fm-item-main {
  min-width: 0;
}

.fm-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.fm-item-title,
.fm-item-title a {
  color: #111827;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
}

.fm-remove {
  appearance: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.fm-remove:hover {
  color: #111827;
  background: #e5e7eb;
}

.fm-item-meta {
  margin-top: 4px;
  color: #6b7280;
  font-size: 12px;
}

.fm-item-meta dl,
.fm-item-meta p {
  margin: 0;
}

.fm-fpd-edit {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fm-accent, #2563eb) 9%, white);
  color: var(--fm-accent, #2563eb);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.fm-fpd-edit:hover {
  color: var(--fm-accent, #2563eb);
  text-decoration: none;
  background: color-mix(in srgb, var(--fm-accent, #2563eb) 15%, white);
}

.fm-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
}

.fm-item-bottom strong {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.fm-summary {
  padding: 16px 18px 18px;
  background: #fff;
}

.flexa-minicart--drawer .fm-summary {
  position: sticky;
  bottom: 0;
  border-top: 1px solid rgba(17, 24, 39, .08);
}

.fm-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 15px;
}

.fm-summary-row strong {
  font-weight: 850;
  color: #111827;
}

.fm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: calc(var(--fm-radius, 16px) - 4px);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.fm-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.fm-btn-primary {
  background: var(--fm-accent, #2563eb);
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--fm-accent, #2563eb) 26%, transparent);
}

.fm-btn-primary:hover {
  color: #fff;
}

.fm-btn-secondary {
  margin-top: 9px;
  background: #fff;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, .12);
}

.fm-btn-secondary:hover {
  color: #111827;
  border-color: color-mix(in srgb, var(--fm-accent, #2563eb) 34%, rgba(17, 24, 39, .12));
}

.fm-empty-shop {
  max-width: 220px;
  margin: 0 auto;
}

@keyframes fmDrop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 767px) {
  .flexa-minicart--dropdown .flexa-minicart-panel {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: min(680px, calc(100vh - 24px));
    border-radius: 18px;
  }

  .flexa-minicart--drawer .flexa-minicart-panel {
    width: min(420px, 94vw);
  }

  .fm-item {
    grid-template-columns: 62px 1fr;
    padding: 13px 15px;
  }

  .fm-item-thumb {
    width: 62px;
    height: 62px;
  }
}

.flexa-minicart-icon .fm-icon-uploaded,
.fm-empty-icon .fm-icon-uploaded {
  display: block;
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  object-fit: contain;
}
