/* =========================================================
   Coastkey handlekurv-skuff (Shopify-stil sidepanel)
   Designtokens fra wizard/Avada-paletten:
   krem #F7F5EE, marine #21263C, oransje #F26531
========================================================= */

.ck-cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 38, 60, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100000;
}
.ck-cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.ck-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 92vw);
  background: var(--coastkey-white, #f7f5ee);
  color: var(--coastkey-blue, #21263c);
  box-shadow: -8px 0 30px rgba(33, 38, 60, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
}
.ck-cart-drawer.is-open {
  transform: translateX(0);
}

/* Header */
.ck-cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(33, 38, 60, 0.12);
  flex-shrink: 0;
}
.ck-cart-drawer__title {
  margin: 0;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--coastkey-blue, #21263c);
}
.ck-cart-drawer__close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--coastkey-blue, #21263c);
  cursor: pointer;
  padding: 0 4px;
}
.ck-cart-drawer__close:hover {
  color: var(--coastkey-orange, #f26531);
}

/* Body / mini-cart */
.ck-cart-drawer__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ck-cart-drawer__body .widget_shopping_cart_content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ck-cart-drawer ul.woocommerce-mini-cart {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 8px 24px;
}

.ck-cart-drawer li.woocommerce-mini-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 16px 28px 16px 0;
  border-bottom: 1px solid rgba(33, 38, 60, 0.1);
  margin: 0;
  list-style: none;
}
.ck-cart-drawer li.woocommerce-mini-cart-item > a:not(.remove) {
  display: contents;
  color: var(--coastkey-blue, #21263c);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.35;
}
.ck-cart-drawer li.woocommerce-mini-cart-item img {
  grid-column: 1;
  grid-row: 1 / span 2;
  /* !important: Avada/Woo cart_list-regler setter ellers width:auto */
  width: 72px !important;
  height: 72px !important;
  max-height: none !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(33, 38, 60, 0.12);
  border-radius: 0.5rem;
  background: #fff;
  float: none !important;
  margin: 0 !important;
}
.ck-cart-drawer li.woocommerce-mini-cart-item a.remove {
  position: absolute;
  top: 14px;
  right: 0;
  width: 22px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  color: rgba(33, 38, 60, 0.55) !important;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
}
.ck-cart-drawer li.woocommerce-mini-cart-item a.remove:hover {
  color: var(--coastkey-white, #f7f5ee) !important;
  background: var(--coastkey-orange, #f26531);
}

/* Antall + linjepris */
.ck-drawer-line {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.ck-drawer-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(33, 38, 60, 0.25);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.ck-drawer-qty-btn {
  background: none;
  border: none;
  width: 32px;
  height: 30px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--coastkey-blue, #21263c);
  line-height: 1;
  font-family: inherit;
}
.ck-drawer-qty-btn:hover {
  background: rgba(242, 101, 49, 0.12);
  color: var(--coastkey-orange, #f26531);
}
.ck-drawer-qty-num {
  min-width: 24px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--coastkey-blue, #21263c);
}
.ck-drawer-line-price {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--coastkey-blue, #21263c);
  white-space: nowrap;
}
.ck-drawer-line-price .amount {
  color: inherit;
}
.ck-cart-drawer .ck-drawer-qty.is-loading {
  opacity: 0.4;
  pointer-events: none;
}

/* Delsum + knapper nederst */
.ck-cart-drawer p.woocommerce-mini-cart__total {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 16px 24px 0;
  border-top: 1px solid rgba(33, 38, 60, 0.12);
  font-size: 1.05rem;
  color: var(--coastkey-blue, #21263c);
}
.ck-cart-drawer p.woocommerce-mini-cart__total .amount {
  font-weight: 600;
  color: var(--coastkey-blue, #21263c);
}
.ck-cart-drawer p.woocommerce-mini-cart__buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 14px 24px calc(20px + env(safe-area-inset-bottom));
}
.ck-cart-drawer p.woocommerce-mini-cart__buttons a.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* Avada setter fast height/line-height/text-indent på .button — nulles her */
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.3 !important;
  text-indent: 0 !important;
  text-align: center;
  padding: 1rem;
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  background: transparent;
  border: 2px solid var(--coastkey-blue, #21263c);
  color: var(--coastkey-blue, #21263c);
}
/* Avada legger handlekurv-ikon på knappene via ::before (awb-icons) */
.ck-cart-drawer p.woocommerce-mini-cart__buttons a.button::before,
.ck-cart-drawer p.woocommerce-mini-cart__buttons a.button::after {
  content: none !important;
  display: none !important;
}
.ck-cart-drawer p.woocommerce-mini-cart__buttons a.button:hover {
  background: rgba(33, 38, 60, 0.08);
}
.ck-cart-drawer p.woocommerce-mini-cart__buttons a.button.checkout {
  background: var(--coastkey-orange, #f26531);
  border-color: var(--coastkey-orange, #f26531);
  color: var(--coastkey-white, #f7f5ee);
  order: -1;
}
.ck-cart-drawer p.woocommerce-mini-cart__buttons a.button.checkout:hover {
  background: #e05a2b;
  border-color: #e05a2b;
}

/* Tom handlekurv */
.ck-cart-drawer p.woocommerce-mini-cart__empty-message {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  color: rgba(33, 38, 60, 0.6);
  font-size: 1rem;
}
