/* ==========================================================================
   Mini Cart Dropdown
   File: dimaq-mini-cart.css (theme root)
   Enqueue: globally via filters.php
   ========================================================================== */

/* --- Wrapper ---
   Positioning context for .minicart lives on .header-icon-group (see
   dimaq-header-account.css), not here — on mobile the cart sits alongside
   the search/hamburger buttons inside that group, no longer flush against
   the header's right edge, so anchoring to the wrapper's own edge pushed
   the full-width dropdown off-screen to the left. */
.header-cart-wrapper {
  position: static;
}

/* --- Toggle button --- */
button.header-cart {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* --- Dropdown panel --- */
.minicart {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  overflow: hidden;
}

.minicart.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 480px) {
  .minicart {
    width: calc(100vw - 32px);
    right: -16px;
  }
}

.minicart__inner {
  display: flex;
  flex-direction: column;
  max-height: 480px;
}

/* --- Header --- */
.minicart__header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #EEEEEE;
  flex-shrink: 0;
}

.minicart__title {
  font-family: "Fira Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  color: #212121;
}

/* --- Items list --- */
.minicart__items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
  overscroll-behavior: contain;
}

.minicart__items::-webkit-scrollbar {
  width: 4px;
}

.minicart__items::-webkit-scrollbar-track {
  background: transparent;
}

.minicart__items::-webkit-scrollbar-thumb {
  background: #DDDDDD;
  border-radius: 4px;
}

/* --- Single item --- */
.minicart__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #F5F5F5;
}

.minicart__item:last-child {
  border-bottom: none;
}

.minicart__item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.minicart__item-icon svg {
  display: block;
  width: 40px;
  height: 40px;
}

.minicart__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.minicart__item-name {
  font-family: "Fira Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  color: #212121;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.minicart__item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.minicart__item-qty {
  font-family: "Fira Sans", sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #9E9E9E;
}

.minicart__item-price {
  font-family: "Fira Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  color: #212121;
  white-space: nowrap;
  margin-left: auto;
}

.minicart__item-price .woocommerce-Price-amount {
  font-weight: 600;
  font-size: 13px;
  color: #212121;
}

.minicart__item-price .woocommerce-Price-currencySymbol {
  font-size: 13px;
}

/* --- Footer CTA --- */
.minicart__footer {
  padding: 16px 24px 20px;
  flex-shrink: 0;
}

.minicart__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border-radius: 999px;
  background: #34C759;
  font-family: "Fira Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #FFFFFF;
  text-decoration: none;
  transition: all 0.25s ease;
  border: none;
  cursor: pointer;
}

.minicart__cta svg {
  flex-shrink: 0;
}

.minicart__cta:hover {
  background: #2BA94A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
}

.minicart__cta:active {
  transform: translateY(0);
}

/* --- Empty state --- */
.minicart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 8px;
}

.minicart__empty-title {
  font-family: "Fira Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  color: #212121;
}

.minicart__empty-text {
  font-family: "Fira Sans", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #757575;
  margin-bottom: 8px;
}

.minicart__empty-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 999px;
  background: transparent;
  border: 2px solid #212121;
  font-family: "Fira Sans", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: #212121;
  text-decoration: none;
  transition: all 0.25s ease;
  width: 100%;
}

.minicart__empty-cta:hover {
  background: #212121;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(33, 33, 33, 0.15);
}

.minicart__empty-cta:active {
  transform: translateY(0);
}

.minicart__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 32px 12px 0;   /* prawy padding zostawia miejsce na x */
}

.minicart__item-remove {
  position: absolute;
  top: 12px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--dimaq-gray60, #757575);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.minicart__item-remove:hover {
  background: var(--dimaq-gray05, #F5F5F5);
  color: var(--dimaq-gray100, #212121);
}

.minicart__item-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}