/*
 * The cart drawer (WPC Fly Cart) in the site's look — inc/fly-cart.php.
 * A panel from the right: items with a quantity stepper and a remove button,
 * then the sum before delivery and „Apmokėti“. Loaded after the plugin's CSS;
 * selectors start at #woofc-area to outrank its long class chains.
 */

.woofc-overlay {
  background: rgba(37, 52, 74, .42);
  transition: opacity .28s ease, visibility 0s linear .28s;
}

body.woofc-show .woofc-overlay {
  transition: opacity .28s ease;
}

#woofc-area {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(440px, 100vw);
  max-width: none;
  height: 100%;
  max-height: none;
  opacity: 1;
  visibility: hidden;
  transform: translate3d(104%, 0, 0);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .34s !important;
  font-family: Montserrat, Helvetica, Arial, sans-serif;
  color: #25344a;
  text-align: left;
}

body.woofc-show #woofc-area {
  visibility: visible;
  transform: none;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1) !important;
}

#woofc-area .woofc-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  background: #fff;
  box-shadow: -18px 0 48px rgba(37, 52, 74, .18);
}

#woofc-area [class*="hint--"]::before,
#woofc-area [class*="hint--"]::after {
  display: none;
}

/* ------------------------------------------------------------------ head */

#woofc-area .woofc-area-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  height: auto;
  padding: 18px 14px 18px 24px;
  border-bottom: 1px solid #e7dfd3;
  background: #fff;
  color: #25344a;
  line-height: 1.2;
  text-transform: none;
}

#woofc-area .woofc-area-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  height: auto;
  overflow: visible;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}

#woofc-area .woofc-area-count {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin: 0;
  padding: 0 8px;
  border-radius: 999px;
  background: #eae2d7;
  color: #25344a;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

#woofc-area .woofc-area-count::before,
#woofc-area .woofc-area-count::after {
  content: none;
}

#woofc-area .woofc-close {
  position: static;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #25344a;
  font-size: 15px;
  transform: none;
  cursor: pointer;
  transition: background-color .15s ease;
}

#woofc-area .woofc-close:hover {
  background: #f4efe7;
}

/* The drawer itself takes focus when a click opens it (js/fly-cart.js). */
#woofc-area:focus {
  outline: none;
}

/* ----------------------------------------------------------------- items */

#woofc-area .woofc-area-mid {
  flex: 1 1 auto;
  margin: 0;
  padding: 4px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#woofc-area .woofc-item {
  margin: 0;
  padding: 0;
}

#woofc-area .woofc-item .woofc-item-inner {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 32px;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 10px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid #efe8de;
  border-radius: 0;
  background: transparent;
  transform: none;
}

#woofc-area .woofc-item:first-child .woofc-item-inner {
  border-top: 0;
}

#woofc-area .woofc-item .woofc-item-thumb {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 64px;
  flex: none;
  margin: 0;
}

#woofc-area .woofc-item .woofc-item-thumb img {
  display: block;
  float: none;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #eae2d7;
}

#woofc-area .woofc-item .woofc-item-info {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
}

#woofc-area .woofc-item .woofc-item-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  /* Three, like the shop cards: two lines cut the year off look-alike names. */
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0 0 6px;
  color: #25344a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

#woofc-area .woofc-item .woofc-item-title a {
  color: inherit;
}

#woofc-area .woofc-item .woofc-item-title a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

#woofc-area .woofc-item .woofc-item-price,
#woofc-area .woofc-item .woofc-item-price span {
  color: #25344a;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3;
}

#woofc-area .woofc-item .woofc-item-price del,
#woofc-area .woofc-item .woofc-item-price del span {
  color: #8a93a3;
  font-weight: 500 !important;
}

/* On sale: the price now as every price (red read as a charge in the cart),
   the old one struck through after it (mkc_item_sale_price() in
   inc/cart-checkout.php); the saving shows in green under the sum. */
#woofc-area .woofc-item .woofc-item-price:has(.mkc-was) {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 7px;
}

#woofc-area .woofc-item .woofc-item-price .mkc-was,
#woofc-area .woofc-item .woofc-item-price .mkc-was span {
  color: #8b93a1;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  text-decoration: line-through;
}

#woofc-area .woofc-item .woofc-item-qty {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
}

/* A bare number where the stepper goes — the plugin prints one for an item
   whose quantity cannot change — squeezed into a sliver by the stepper's
   pill. inc/fly-cart.php gives those items a field now; this stays for one
   that has none. */
#woofc-area .woofc-item .woofc-item-qty:not(:has(input, select)) {
  display: none;
}

/* How the item arrives — the cart and checkout line (inc/cart-checkout.php),
   whose own styles apply on those two pages only. */
#woofc-area .woofc-item .mkc-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 6px 0 0;
  font: 500 13px/1.4 Montserrat, Helvetica, Arial, sans-serif;
  color: #25344a;
}

#woofc-area .woofc-item .mkc-note .mkc-ic {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  fill: none;
  stroke: #56627a;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #e0d8cb;
  border-radius: 999px;
  background: #fff;
}

#woofc-area .woofc-item .woofc-item-qty .quantity {
  margin: 0;
}

#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-minus,
#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-plus {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: transparent;
  color: #25344a;
  font-size: 16px;
  font-weight: 600;
  line-height: 32px;
  transition: background-color .15s ease;
}

/* The plugin writes a hyphen; a minus sign lines up with the plus. */
#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-minus {
  font-size: 0;
}

#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-minus::before {
  content: "−";
  font-size: 16px;
}

#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-minus:hover,
#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-plus:hover {
  background: #f4efe7;
}

/* + at the item's max — 1 for a download or a recording (js/fly-cart.js). */
#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner .woofc-item-qty-plus[aria-disabled="true"] {
  background: transparent;
  color: #c2c8d1;
  cursor: default;
}

/* Keyboard focus on the controls js/fly-cart.js makes buttons. */
#woofc-area .woofc-item :is(.woofc-item-qty-minus, .woofc-item-qty-plus, .woofc-item-remove):focus-visible {
  outline: 2px solid #324256;
  outline-offset: 2px;
  border-radius: 4px;
}

#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner input {
  width: 34px;
  height: 32px;
  /* WooCommerce's `.woocommerce .quantity input.qty` forces a border with
     !important on shop pages, boxing the number inside the pill there. */
  border: 0 !important;
  border-radius: 0;
  background: transparent;
  color: #25344a;
  font: 600 14px/32px Montserrat, sans-serif;
  -moz-appearance: textfield;
}

#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner input::-webkit-inner-spin-button,
#woofc-area .woofc-item .woofc-item-qty .woofc-item-qty-inner input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#woofc-area .woofc-item .woofc-item-remove {
  position: static;
  grid-column: 3;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #8a93a3;
  font-size: 12px;
  opacity: 1;
  visibility: visible;
  transform: none;
}

#woofc-area .woofc-item .woofc-item-remove:hover {
  background: #f4efe7;
  color: #25344a;
}

#woofc-area .woofc-item.woofc-item-removing {
  opacity: .45;
}

#woofc-area .woofc-undo {
  padding: 14px 0 2px;
}

#woofc-area .woofc-undo .woofc-undo-inner {
  padding: 11px 14px;
  border: 1px solid #e7dfd3;
  border-radius: 8px;
  background: #fbf8f3;
  color: #25344a;
  font-size: 13.5px;
  font-weight: 500;
}

#woofc-area .woofc-undo .woofc-undo-inner a,
#woofc-area .woofc-undo .mkfc-undo-btn {
  color: #25344a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The drawer's own undo (js/fly-cart.js) is a real button in the same look. */
#woofc-area .woofc-undo .mkfc-undo-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#woofc-area .woofc-undo .mkfc-undo-btn:focus-visible {
  outline: 2px solid #324256;
  outline-offset: 2px;
  border-radius: 3px;
}

#woofc-area .woofc-no-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 64px 0;
  color: #25344a;
  text-align: center;
}

#woofc-area .mkfc-empty-title {
  font-size: 16px;
  font-weight: 700;
}

#woofc-area .mkfc-empty-link {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  background: #324256;
  color: #fbf7f1;
  font-size: 14px;
  font-weight: 700;
}

/* The item just added, for a moment (js/fly-cart.js). The shadow widens the
   tint past the row without moving anything in it. */
@keyframes mkfc-added {
  0%, 35% { background-color: #f4ece0; box-shadow: 0 0 0 10px #f4ece0; }
  100% { background-color: rgba(244, 236, 224, 0); box-shadow: 0 0 0 10px rgba(244, 236, 224, 0); }
}

/* ---------------------------------------------------------------- bottom */

#woofc-area .woofc-area-bot {
  flex: none;
  padding: 18px 24px 22px;
  border-top: 1px solid #e7dfd3;
  background: #fff;
}

#woofc-area .woofc-area-bot .woofc-data {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  color: #25344a;
  font-size: 15px;
  font-weight: 600;
}

#woofc-area .woofc-area-bot .woofc-data .woofc-data-right {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* Emptying and sharing the cart; the same sum a second time. */
#woofc-area .woofc-area-bot .woofc-link,
#woofc-area .woofc-area-bot .woofc-total {
  display: none;
}

#woofc-area .mkfc-saved {
  margin: 3px 0 0;
  padding: 0;
  color: #2f7d4f;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
}

#woofc-area .mkfc-saved * {
  color: inherit;
  font-weight: 700;
}

#woofc-area .mkfc-note {
  margin: 4px 0 0;
  padding: 0;
  color: #56627a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

#woofc-area .woofc-area-bot .woofc-action {
  padding: 16px 0 0;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner > div {
  width: 100%;
  margin: 0;
  padding: 0;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner > div a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border: 1px solid #e0d8cb;
  border-radius: 8px;
  background: #fff;
  color: #25344a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  transition: background-color .15s ease, border-color .15s ease;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner > div a:hover {
  border-color: #25344a;
  background: #fff;
  color: #25344a;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner .woofc-action-right a {
  border-color: #324256;
  background: #324256;
  color: #fbf7f1;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner .woofc-action-right a:hover {
  border-color: #25344a;
  background: #25344a;
  color: #fbf7f1;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner .woofc-action-right a::after {
  content: "→";
  font-weight: 600;
  transition: transform .2s ease;
}

#woofc-area .woofc-area-bot .woofc-action .woofc-action-inner .woofc-action-right a:hover::after {
  transform: translateX(3px);
}

#woofc-area .woofc-area-bot .woofc-continue {
  margin: 0;
  padding: 14px 0 0;
  text-align: center;
}

#woofc-area .woofc-area-bot .woofc-continue .woofc-continue-url {
  color: #25344a;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #c39d63;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-transform: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  #woofc-area .woofc-area-top {
    padding: 14px 10px 14px 18px;
  }

  #woofc-area .woofc-area-mid {
    padding: 4px 18px;
  }

  #woofc-area .woofc-area-bot {
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  }
}

#woofc-area [role="button"]:focus-visible { outline: 2px solid #324256; outline-offset: 3px; }
/* The close button's ring stays inside its own circle: outside it, the panel edge cut it off. */
#woofc-area .woofc-close:focus-visible { outline-offset: -2px; }

/* ------------------------------------------------------ saving, quietly */

/* A change is on screen at once and saves in the background (js/fly-cart.js):
   a gold line runs along the heading's rule while it does. Nothing dims,
   nothing waits. */
#woofc-area .woofc-area-top {
  position: relative;
}

#woofc-area.mkfc-saving .woofc-area-top::after,
#woofc-area .woofc-inner-loading .woofc-area-top::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(195, 157, 99, 0), #c39d63 30%, #c39d63 70%, rgba(195, 157, 99, 0)) no-repeat;
  background-size: 45% 100%;
  animation: mkfc-saving 0.9s ease-in-out infinite;
}

@keyframes mkfc-saving {
  from { background-position: -80% 0; }
  to { background-position: 180% 0; }
}

/* The plugin's own waits (emptying the cart) keep the drawer as it is too:
   no white veil and no spinner, only the line above. */
#woofc-area .woofc-inner.woofc-inner-loading::before {
  display: none;
}

#woofc-area .woofc-inner.woofc-inner-loading::after {
  background: transparent !important;
}

/* A number that just changed settles into place. */
#woofc-area .mkfc-tick {
  animation: mkfc-tick 0.18s ease-out;
}

@keyframes mkfc-tick {
  from { opacity: 0.3; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* A row taken out folds away. */
#woofc-area .woofc-item.mkfc-leaving {
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  transition: height 0.2s ease, opacity 0.12s ease, margin 0.2s ease, padding 0.2s ease;
}

/* Onward to the cart or checkout, waiting for the last change to save. */
#woofc-area [aria-busy="true"] {
  opacity: 0.8;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #woofc-area,
  body.woofc-show #woofc-area,
  .woofc-overlay {
    transition: none !important;
  }

  #woofc-area .mkfc-tick {
    animation: none;
  }

  #woofc-area.mkfc-saving .woofc-area-top::after,
  #woofc-area .woofc-inner-loading .woofc-area-top::after {
    animation: none;
    background: #c39d63;
    opacity: 0.6;
  }
}
