/* ==========================================================================
   MINI CART — a native <dialog> sliding in from the right.
   Not in the Figma file: the panel colour, hairlines, labels and buttons of the designed pages.
   Loaded at the end of the page; nothing here is needed before the drawer opens.
   ========================================================================== */
html:has(.ev-minicart[open]) { overflow: hidden; }

.ev-minicart {
  width: min(480px, 100vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--ev-line);
  background: var(--ev-bg-2);
  color: var(--ev-white);
  font-family: var(--ev-font);
  translate: 100% 0;
  transition: translate 0.5s var(--ev-ease), overlay 0.5s allow-discrete, display 0.5s allow-discrete;
}
.ev-minicart[open] { translate: 0 0; }
@starting-style {
  .ev-minicart[open] { translate: 100% 0; }
}
.ev-minicart::backdrop {
  background: rgba(8, 8, 8, 0);
  transition: background-color 0.5s ease-out, overlay 0.5s allow-discrete, display 0.5s allow-discrete;
}
.ev-minicart[open]::backdrop { background: rgba(8, 8, 8, 0.66); }
@starting-style {
  .ev-minicart[open]::backdrop { background: rgba(8, 8, 8, 0); }
}

.ev-minicart__panel { display: flex; flex-direction: column; height: 100%; }
.ev-minicart__head {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  min-height: 80px;
  padding: 0 20px 0 clamp(24px, 2.1vw, 40px);
  border-bottom: 1px solid var(--ev-line);
}
.ev-minicart__title { font-size: 13px; font-weight: 500; letter-spacing: 0.25em; text-transform: uppercase; }
.ev-minicart__close {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s, rotate 0.4s var(--ev-ease);
}
.ev .ev-minicart__close:focus-visible { outline-width: 1px; outline-offset: 0; opacity: 1; }
.ev-minicart__close:hover { opacity: 1; rotate: 90deg; }

.ev-minicart__content { display: flex; flex: 1; flex-direction: column; min-height: 0; transition: opacity 0.3s; }
.ev-minicart__content[aria-busy="true"] { opacity: 0.45; pointer-events: none; }
/* before the first response from the server */
.ev-minicart__content:empty::before {
  content: "";
  width: 28px; height: 28px;
  margin: 64px auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--ev-white);
  border-radius: 50%;
  animation: ev-minicart-spin 0.9s linear infinite;
}
@keyframes ev-minicart-spin { to { rotate: 360deg; } }

/* --- Items ------------------------------------------------------------------ */
.ev-minicart__items { flex: 1; min-height: 0; padding: 0 clamp(24px, 2.1vw, 40px); overflow-y: auto; overscroll-behavior: contain; }
.ev-minicart__item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 20px; padding: 28px 0; }
.ev-minicart__item + .ev-minicart__item { border-top: 1px solid var(--ev-line); }
.ev-minicart__thumb { display: block; width: 88px; height: 88px; border-radius: var(--ev-radius); background: var(--ev-bg); overflow: hidden; }
.ev-minicart__thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.ev-minicart__name { font-size: 16px; font-weight: 500; line-height: 1.4; }
.ev-minicart__name a { transition: opacity 0.3s; }
.ev-minicart__name a:hover { opacity: 0.7; }
.ev-minicart__info :is(dl, .variation) { margin: 4px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.ev-minicart__info :is(dt, dd, dd p) { display: inline; margin: 0; }
.ev-minicart__info dd::after { content: ""; display: block; }
.ev-minicart__price { margin-top: 6px; font-size: 15px; font-weight: 300; color: rgba(255, 255, 255, 0.85); }
.ev-minicart__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; }
.ev-minicart__qty-fixed { font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.ev-minicart__remove {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.3s;
}
.ev-minicart__remove:hover { color: var(--ev-white); }

/* quantity: − value + in one outlined pill */
.ev-qty { display: inline-flex; align-items: center; height: 40px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 70px; }
.ev-qty__btn {
  width: 40px; height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  font-size: 17px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.ev-qty__btn:hover { opacity: 1; }
.ev-qty__input {
  width: 36px; height: 38px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.ev-qty__input::-webkit-outer-spin-button,
.ev-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- Footer ----------------------------------------------------------------- */
.ev-minicart__footer {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 12px;
  padding: 24px clamp(24px, 2.1vw, 40px) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ev-line);
}
.ev-minicart__subtotal { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.ev-minicart__subtotal > span { font-size: 12px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
.ev-minicart__subtotal strong { font-size: clamp(20px, 1.25vw, 24px); font-weight: 300; }
.ev-minicart__note { margin-bottom: 8px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, 0.6); }
.ev-minicart__footer .ev-btn { width: 100%; min-height: 48px; }

/* --- Empty ------------------------------------------------------------------ */
.ev-minicart__empty { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; padding: clamp(40px, 4vw, 72px) clamp(24px, 2.1vw, 40px); }
.ev-minicart__empty p { font-size: var(--ev-fs-h3); font-weight: 400; line-height: 1.35; }

@media (prefers-reduced-motion: reduce) {
  .ev-minicart,
  .ev-minicart::backdrop { transition: none; }
  .ev-minicart__content:empty::before { animation-duration: 2.4s; }
}
