/*
 * Grunnstil for kurvskuffen (HK.Plugin.Custom.FlyoutCart). Temaet tilpasser med variablene under,
 * f.eks. i sin egen SCSS: .hk-flyout { --hk-flyout-accent: #1fb5f9; --hk-flyout-heading-font: ivymode; }
 * Variablene står under :where() (null spesifisitet), så temaets regler vinner selv om denne fila
 * lastes sist.
 */
:where(.hk-flyout) {
  --hk-flyout-width: 420px;
  --hk-flyout-bg: #fff;
  --hk-flyout-text: #1a1a1a;
  --hk-flyout-muted: rgba(0, 0, 0, 0.55);
  --hk-flyout-border: rgba(0, 0, 0, 0.1);
  --hk-flyout-accent: #1a1a1a;
  --hk-flyout-accent-text: #fff;
  --hk-flyout-backdrop: rgba(0, 0, 0, 0.45);
  --hk-flyout-font: inherit;
  --hk-flyout-heading-font: inherit;
  --hk-flyout-radius: 4px;
  --hk-flyout-z: 10000;
}

.hk-flyout {
  position: fixed;
  inset: 0;
  z-index: var(--hk-flyout-z);
  visibility: hidden;
  pointer-events: none;
  font-family: var(--hk-flyout-font);
  color: var(--hk-flyout-text);
  transition: visibility 0s linear 0.3s;
}

.hk-flyout.is-open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.hk-flyout__backdrop {
  position: absolute;
  inset: 0;
  background: var(--hk-flyout-backdrop);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hk-flyout.is-open .hk-flyout__backdrop {
  opacity: 1;
}

.hk-flyout__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(var(--hk-flyout-width), 100vw);
  display: flex;
  flex-direction: column;
  background: var(--hk-flyout-bg);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.hk-flyout.is-open .hk-flyout__panel {
  transform: translateX(0);
}

.hk-flyout__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.hk-flyout.is-busy .hk-flyout__items {
  opacity: 0.5;
  pointer-events: none;
}

html.hk-flyout-open {
  overflow: hidden;
}

.hk-flyout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hk-flyout-border);
}

.hk-flyout__title {
  margin: 0;
  font-family: var(--hk-flyout-heading-font);
  font-size: 1.5rem;
  font-weight: 700;
}

.hk-flyout__close {
  display: flex;
  padding: 4px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.hk-flyout__empty {
  padding: 32px 24px;
  color: var(--hk-flyout-muted);
}

.hk-flyout__shipping {
  padding: 16px 24px;
  border-bottom: 1px solid var(--hk-flyout-border);
  font-size: 0.9rem;
}

.hk-flyout__shipping-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--hk-flyout-border);
}

.hk-flyout__shipping-fill {
  height: 100%;
  background: var(--hk-flyout-accent);
  transition: width 0.3s ease;
}

.hk-flyout__items {
  flex: 1;
  margin: 0;
  padding: 0 24px;
  overflow-y: auto;
  list-style: none;
  transition: opacity 0.2s;
}

.hk-flyout__item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hk-flyout-border);
}

.hk-flyout__image {
  flex: 0 0 72px;
  height: 72px;
}

.hk-flyout__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hk-flyout__item-body {
  flex: 1;
  min-width: 0;
}

.hk-flyout__name {
  display: block;
  color: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.hk-flyout__attributes {
  margin-top: 4px;
  color: var(--hk-flyout-muted);
  font-size: 0.85rem;
}

.hk-flyout__price {
  margin-top: 4px;
  font-weight: 700;
}

.hk-flyout__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.hk-flyout__stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--hk-flyout-border);
  border-radius: var(--hk-flyout-radius);
}

.hk-flyout__stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.hk-flyout__qty {
  min-width: 28px;
  text-align: center;
}

.hk-flyout__remove {
  padding: 0;
  border: 0;
  background: none;
  color: var(--hk-flyout-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

.hk-flyout__footer {
  padding: 20px 24px;
  border-top: 1px solid var(--hk-flyout-border);
}

.hk-flyout__total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.hk-flyout__checkout,
.hk-flyout__continue {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--hk-flyout-radius);
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
}

.hk-flyout__checkout {
  border: 0;
  background: var(--hk-flyout-accent);
  color: var(--hk-flyout-accent-text);
  font-weight: 700;
  text-decoration: none;
}

.hk-flyout__continue {
  margin-top: 8px;
  border: 1px solid var(--hk-flyout-border);
  background: none;
  color: inherit;
}
