/*
 * DanIT Cart Sidebar Override
 * Premium card layout for #blockcart-content (PrestaShop 8 / warehouse theme).
 */

/* ── Header cart button (always show label + price on desktop) ── */
@media (min-width: 992px) {
  #blockcart .cart-toogle .info-wrapper {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-left: 10px;
    color: inherit;
  }

  #blockcart .cart-toogle .info-wrapper .title,
  #blockcart .cart-toogle .info-wrapper .cart-toggle-details {
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
  }

  #blockcart .cart-toogle .info-wrapper .cart-separator,
  #blockcart .cart-toogle .info-wrapper .cart-products-count {
    opacity: 0.75;
  }

  #blockcart .cart-toogle .info-wrapper .value {
    font-weight: 700;
  }
}


/* ── Dropdown panel shell ─────────────────────────────────── */
#_desktop_blockcart-content.dropdown-menu-custom,
#_desktop_blockcart-content.dropdown-menu {
  padding: 0 !important;
  border: none !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18) !important;
  background: #fff !important;
  max-width: 440px;
  overflow: hidden;
  font-family: 'Poppins', sans-serif !important;
}

#blockcart-content {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  max-height: 100%;
}

/* ── Header ──────────────────────────────────────────────── */
#blockcart-content .cart-title {
  padding: 20px 22px 12px !important;
}

#blockcart-content .cart-title hr {
  display: none !important;
}

#blockcart-content .cart-title .modal-title {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  letter-spacing: 0.01em;
}

#blockcart-content #js-cart-close {
  background: #f5f4ff !important;
  border: none !important;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #555 !important;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  opacity: 1;
}

#blockcart-content #js-cart-close:hover {
  background: var(--dpp-accent, #4C3CFF) !important;
  color: #fff !important;
  transform: rotate(90deg);
}

#blockcart-content #js-cart-close span {
  line-height: 1;
  margin-top: -2px;
}

/* ── Products — card grid, no bullets ────────────────────── */
#blockcart-content .cart-products {
  list-style: none !important;
  padding: 6px 18px 14px !important;
  margin: 0 !important;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#blockcart-content .cart-products::-webkit-scrollbar {
  width: 6px;
}

#blockcart-content .cart-products::-webkit-scrollbar-thumb {
  background: #dcdce6;
  border-radius: 3px;
}

#blockcart-content .cart-products > li {
  list-style: none !important;
  margin: 0 !important;
  background: #fff;
  border: 1px solid #ececf3;
  border-radius: 14px;
  padding: 12px !important;
  flex: 0 0 auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#blockcart-content .cart-products > li:hover {
  border-color: var(--dpp-accent, #4C3CFF);
  box-shadow: 0 8px 22px rgba(76, 60, 255, 0.10);
  transform: translateY(-1px);
}

#blockcart-content .cart-products > li .row {
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  gap: 12px;
}

/* ── Product image (top of card, full width) ─────────────── */
#blockcart-content .cart-products .col-3 {
  flex: 0 0 auto !important;
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

#blockcart-content .cart-products .product-image {
  display: block;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #f6f6fb;
  border: 1px solid #eee;
}

#blockcart-content .cart-products .product-image a,
#blockcart-content .cart-products .product-image picture {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

#blockcart-content .cart-products .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  display: block;
}

/* ── Info column (below image) ───────────────────────────── */
#blockcart-content .cart-products .col-info {
  flex: 1 1 auto !important;
  width: 100%;
  padding: 0 !important;
  min-width: 0;
}

#blockcart-content .cart-products .col-info .pb-1 a {
  font-family: 'Poppins', sans-serif !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  text-decoration: none !important;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#blockcart-content .cart-products .col-info .pb-1 a:hover {
  color: var(--dpp-accent, #4C3CFF) !important;
}

#blockcart-content .cart-products .product-attributes {
  margin-top: 4px;
  font-size: 0.78rem !important;
  color: #777 !important;
  line-height: 1.4;
}

#blockcart-content .cart-products .product-line-info {
  display: inline;
  margin-right: 6px;
}

#blockcart-content .cart-products .product-line-info .label {
  font-weight: 500;
  color: #888;
}

#blockcart-content .cart-products .product-line-info .value {
  color: #444;
  font-weight: 500;
}

/* ── Bottom row of card: qty + trash + price ─────────────── */
#blockcart-content .cart-products .col-info > .row {
  margin-top: 8px !important;
  gap: 8px;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

#blockcart-content .cart-products input.block-cart-product-quantity,
#blockcart-content .cart-products input.block-cart-product-quantity-gift {
  width: 64px !important;
  height: 32px !important;
  text-align: center !important;
  border: 1.5px solid #e0e0ea !important;
  border-radius: 8px !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #1a1a1a !important;
  background: #fff !important;
  padding: 0 6px !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease;
}

#blockcart-content .cart-products input.block-cart-product-quantity:focus {
  border-color: var(--dpp-accent, #4C3CFF) !important;
  outline: none !important;
}

#blockcart-content .cart-products .remove-from-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f5f4ff;
  color: #888 !important;
  transition: background 0.2s ease, color 0.2s ease;
  margin-right: 8px;
}

#blockcart-content .cart-products .remove-from-cart:hover {
  background: #ffe5e5;
  color: #e53935 !important;
}

#blockcart-content .cart-products .remove-from-cart i {
  font-size: 0.9rem;
}

#blockcart-content .cart-products .col-info > .row > .col:last-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto !important;
  padding: 0 !important;
}

#blockcart-content .cart-products .col-info > .row > .col:last-child > span {
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  white-space: nowrap;
}

/* ── Subtotals / totals ──────────────────────────────────── */
#blockcart-content .cart-subtotals {
  padding: 12px 22px 4px !important;
  border-top: 1px solid #ececf3;
  background: #fafaff;
  flex: 0 0 auto;
}

#blockcart-content .cart-subtotals .cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-family: 'Poppins', sans-serif !important;
  font-size: 0.88rem;
  color: #555;
  padding: 4px 0;
}

#blockcart-content .cart-subtotals .cart-summary-line .label {
  font-weight: 500;
}

#blockcart-content .cart-subtotals .cart-summary-line .value {
  font-weight: 600;
  color: #1a1a1a;
}

#blockcart-content .cart-totals {
  padding: 8px 22px 14px !important;
  background: #fafaff;
  border-bottom: 1px solid #ececf3;
  flex: 0 0 auto;
}

#blockcart-content .cart-totals .clearfix {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Poppins', sans-serif !important;
}

#blockcart-content .cart-totals .clearfix .label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}

#blockcart-content .cart-totals .clearfix .value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  float: none !important;
}

/* ── Buttons: keep Commander, hide Panier ────────────────── */
#blockcart-content .cart-buttons {
  padding: 16px 22px 22px !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

#blockcart-content .cart-title {
  flex: 0 0 auto;
}

#blockcart-content .cart-buttons .btn-secondary {
  display: none !important;
}

#blockcart-content .cart-buttons .btn-primary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 28px !important;
  border-radius: 999px !important;
  border: none !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  color: #fff !important;
  background-image: linear-gradient(34deg,
      var(--dpp-grad-start, #000) -10%,
      var(--dpp-grad-mid, #4C3CFF) 30%,
      var(--dpp-grad-end, #87A1FF) 70%,
      var(--dpp-grad-mid, #4C3CFF) 90%,
      var(--dpp-grad-start, #000) 120%) !important;
  background-color: transparent !important;
  background-size: 300% 100% !important;
  background-position: 0% 50% !important;
  box-shadow: 0 10px 24px rgba(76, 60, 255, 0.28) !important;
  transition: background-position 0.6s ease, box-shadow 0.25s ease, transform 0.15s ease !important;
  text-transform: none !important;
}

#blockcart-content .cart-buttons .btn-primary:hover {
  background-position: 50% 20% !important;
  box-shadow: 0 14px 32px rgba(76, 60, 255, 0.4) !important;
}

#blockcart-content .cart-buttons .btn-primary:active {
  transform: scale(0.98);
}

/* ── Empty state ─────────────────────────────────────────── */
#blockcart-content .no-items {
  display: block;
  text-align: center;
  padding: 32px 22px 36px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  color: #888;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 540px) {
  #_desktop_blockcart-content.dropdown-menu-custom,
  #_desktop_blockcart-content.dropdown-menu {
    min-width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  #blockcart-content .cart-products .product-image {
    height: 150px;
  }
}
