/* ——— Cart (ShopPage) ———
   ShopPage already applies --app-page-gutter; cart.css pads #cart_content again. */
#cart_section {
  margin-top: 0;
}

#heading_cart {
  display: none !important;
}

#cart_main_content {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

#cart_content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  max-width: none;
}

#cart_content > .columns {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ——— Checkout 1:1 smart.md ———
   Titlu = #heading_checkout (SMARTfont 32px), fundal #F7F8FA, padding OC. */
#checkout_section {
  margin-top: 0 !important;
  margin-bottom: 0;
  width: 100%;
  min-height: calc(100vh - var(--app-header-height, 120px));
  background: #f7f8fa;
  box-sizing: border-box;
}

#checkout_main_content {
  max-width: none;
  width: 100%;
  margin: 24px 0 48px;
  padding: 0;
  box-sizing: border-box;
}

#checkout_content {
  width: 100%;
  max-width: none;
  margin: 0 !important;
  /* OC: 48px 44px — pe Next aliniem cu gutter-ul magazinului */
  padding: 32px var(--app-page-gutter, 40px) 48px !important;
  box-sizing: border-box;
}

#heading_checkout {
  display: flex !important;
}

/* Keep trust / maib block visible under summary (image 2) */
#cart_content .column_two .visa_info {
  display: block !important;
  visibility: visible !important;
  margin-top: 20px;
  padding: 32px 0 0;
}

#cart_content .column_two .visa_info .cards {
  display: block;
  margin-bottom: 12px;
}

#cart_content .column_two .visa_info .secure_data,
#cart_content .column_two .visa_info .secure_list {
  display: block;
}

#empty_content {
  padding: 48px 0 24px;
}

/* Payment radios: pe smart.md sunt ascunse (Materialize); selecția = border galben + .selected */
#payment_checkout .custom_payment_method {
  position: relative;
}

#payment_checkout .custom_payment_method > input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
}

/* Ștergere produs din checkout — X discret, recalculează coșul */
#shipping_checkout .custom_product {
  position: relative;
  padding-right: 28px;
}

#shipping_checkout .checkout_product_remove {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9e9e9e;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

#shipping_checkout .checkout_product_remove:hover,
#shipping_checkout .checkout_product_remove:focus-visible {
  color: #12100b;
  background: #f0f1f3;
  outline: none;
}

/* Panouri metode — layout; stilul select = cart.css (.shipping_block_type / _select) 1:1 smart.md */
#shipping_checkout #ship_panels,
#shipping_checkout .ship-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

#shipping_checkout .ship-panel[style*="display: none"],
#shipping_checkout .ship-panel[style*="display:none"] {
  display: none !important;
}

/* Address autocomplete (Geoapify via gateway) */
#shipping_checkout .addr-ac-wrap,
.addr-ac-wrap {
  position: relative;
  width: 100%;
}
#shipping_checkout .addr-ac-list,
.addr-ac-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}
#shipping_checkout .addr-ac-item,
.addr-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #1f2937;
}
#shipping_checkout .addr-ac-item:hover,
.addr-ac-item:hover {
  background: #f3f4f6;
}
#shipping_checkout .addr-ac-attr,
.addr-ac-attr {
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}
#shipping_checkout .addr-ac-hint,
.addr-ac-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #6b7280;
  min-height: 1em;
}

/* Quantity +/- : center icons in the 32×32 buttons (OC uses imgs, not glyphs) */
#cart_products .cart_product_info .box_quantity {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

#cart_products .cart_product_info .box_quantity span,
#cart_products .cart_product_info .box_quantity span.cart_remove,
#cart_products .cart_product_info .box_quantity span.cart_add {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 0 !important;
  box-sizing: border-box;
  flex-shrink: 0;
}

#cart_products .cart_product_info .box_quantity span img {
  display: block;
  width: 10px;
  height: auto;
  margin: 0;
  pointer-events: none;
}

#cart_products .cart_product_info .box_quantity > input {
  margin: 0 2px !important;
  height: 32px !important;
  line-height: 32px;
  align-self: center;
}

/* ——— Checkout success / MIA QR ——— */
.checkout-done-mia {
  margin-top: 24px;
  max-width: 320px;
}

.checkout-done-mia__status {
  margin: 0 0 12px;
  color: #585858;
  font-size: 14px;
}

.checkout-done-mia__qr {
  display: inline-block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7ea;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.checkout-done-mia__qr:hover {
  border-color: #d0d4d9;
  box-shadow: 0 6px 20px rgba(33, 35, 34, 0.08);
  transform: translateY(-1px);
}

.checkout-done-mia__qr img {
  display: block;
  vertical-align: top;
}

.checkout-done-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.checkout-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease;
}

.checkout-done-btn--primary {
  background: #ffcc33;
  color: #212322;
  border-color: #ffcc33;
  box-shadow: 0 1px 0 rgba(33, 35, 34, 0.06);
}

.checkout-done-btn--primary:hover {
  background: #f5c01f;
  border-color: #f5c01f;
  box-shadow: 0 4px 14px rgba(255, 204, 51, 0.35);
  transform: translateY(-1px);
}

.checkout-done-btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.checkout-done-btn--ghost {
  background: #fff;
  color: #212322;
  border-color: #d5d9de;
}

.checkout-done-btn--ghost:hover {
  background: #f7f8fa;
  border-color: #b8c0c6;
  transform: translateY(-1px);
}

.checkout-done-btn--ghost:active {
  transform: translateY(0);
}

/* Mobil: smart.md fixează min-width 375px pe #cart_content / .footer → overflow orizontal sub 375px. */
@media screen and (max-width: 420px) {
  #cart_content,
  #checkout_content,
  #cart_content .footer {
    min-width: 0 !important;
  }

  #cart_content .footer {
    width: 100%;
    box-sizing: border-box;
    padding: 24px 16px;
  }
}

/* Rând coș: touch targets + imagine lipsă nu afișează alt gigant */
#cart_products .cart_product_image {
  flex: none;
  overflow: hidden;
}

#cart_products .cart_product_info .box_wishlist,
#cart_products .cart_product_info .box_remove > span {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#cart_products .cart_product_info .box_quantity span[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

#cart_products .cart_product_info .box_wishlist:focus-visible,
#cart_products .cart_product_info .box_remove > span:focus-visible,
#cart_products .cart_product_info .box_quantity span:focus-visible {
  outline: 2px solid #12100b;
  outline-offset: 2px;
  border-radius: 8px;
}

@media screen and (max-width: 900px) {
  #cart_content {
    padding: 0 !important;
  }

  /* touch target ≥ 40px pentru acțiunile din rând */
  #cart_products .cart_product_info .box_tools .box_wishlist,
  #cart_products .cart_product_info .box_tools .box_remove > span {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #checkout_content {
    padding: 24px var(--app-page-gutter-mobile, 16px) 40px !important;
  }

  #cart_content .column_two .visa_info {
    padding: 16px 0 0;
  }

  .checkout-done-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .checkout-done-btn {
    width: 100%;
  }
}
