/* =============================================
   3MART — Cart
   ============================================= */

/* ── WooCommerce notices en carrito: ajuste de ancho y margen ── */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto 0 !important;
}

.cart3-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  width: 90%;
  max-width: 1200px;
  margin: 40px auto 60px;
  align-items: start;
}

/* ── Header row ── */
.cart3-header {
  display: grid;
  grid-template-columns: 130px 1fr 140px 140px;
  gap: 16px;
  padding: 0 0 12px;
  border-bottom: 2px solid #111;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #111;
}

.cart3-header span:first-child { grid-column: 1 / 3; }
.cart3-header .cart3-header-subtotal { display: none; }

/* ── Product row ── */
.cart3-row {
  display: grid;
  grid-template-columns: 130px 1fr 140px 140px;
  gap: 16px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid #eee;
}

.cart3-col-img img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
}

.cart3-col-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart3-product-name {
  font-size: 0.925rem;
  font-weight: 700;
  color: #111 !important;
  text-decoration: none;
  line-height: 1.4;
}

.cart3-product-name:hover { color: #555 !important; }

.cart3-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #aaa;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.cart3-remove svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.cart3-remove:hover {
  background: #fde8e9;
  color: #d22a32;
}

.cart3-col-price {
  font-size: 0.925rem;
  font-weight: 600;
  color: #111;
}

/* hide subtotal column */
.cart3-col-subtotal { display: none; }

/* ── Quantity input — circle buttons ── */
.cart3-col-qty .quantity {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
}

.cart3-col-qty .qty {
  width: 32px;
  text-align: center;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 700;
  background: transparent !important;
  -moz-appearance: textfield;
  line-height: 34px;
}

.cart3-col-qty .qty:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.cart3-col-qty .qty::-webkit-outer-spin-button,
.cart3-col-qty .qty::-webkit-inner-spin-button { -webkit-appearance: none; }

/* minus — outlined red circle */
.cart3-col-qty .quantity .minus {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid #d22a32 !important;
  border-radius: 50% !important;
  background: #fff !important;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 10px !important;
  color: #d22a32 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0 !important;
}

.cart3-col-qty .quantity .minus:hover {
  background: #dad9d96a !important; 
}

/* plus — filled red circle */
.cart3-col-qty .quantity .plus {
  width: 34px !important;
  height: 34px !important;
  border: 1px solid #d22a32 !important;
  border-radius: 50% !important;
  background: #d22a32 !important;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 10px !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  padding: 0 !important;
}

.cart3-col-qty .quantity .plus:hover {
  background: #a82027 !important;
  border-color: #a82027 !important;
}

/* Quantity number — read-only appearance */
.cart3-col-qty .qty {
  pointer-events: none;
  user-select: none;
  caret-color: transparent;
  cursor: default;
}

/* ── Actions bar ── */
.cart3-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 0;
  flex-wrap: wrap;
}

.cart3-coupon {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 240px;
}

.cart3-coupon input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #ddd;
  font-size: 0.875rem;
  outline: none;
}

.cart3-coupon input:focus { border-color: #111; }

.cart3-btn-secondary {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid #111;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.5px;
}

.cart3-btn-secondary:hover {
  background: #111;
  color: #fff;
}

/* ── Sidebar / totals ── */
.cart3-sidebar {
  position: sticky;
  top: 100px;
}

.cart3-totals {
  background: #f7f7f7;
  padding: 28px 24px;
}

.cart3-totals h2 {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #111;
}

.cart3-totals-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cart3-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
  color: #555;
}

.cart3-totals-row span:last-child { color: #111; }

.cart3-totals-total {
  padding-top: 14px;
  border-top: 1px solid #ddd;
  font-weight: 700;
  font-size: 1rem;
  color: #111 !important;
}

.cart3-totals-total span { color: #111 !important; }

/* ── Shipping options ── */
.cart3-totals tr.shipping {
  display: block;
}

.cart3-totals .shipping th {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  padding: 0 0 10px;
}

.cart3-totals .shipping td {
  display: block;
  padding: 0 0 16px;
}

.cart3-totals #shipping_method {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart3-totals #shipping_method li {
  display: block;
  margin: 0;
  padding: 0;
}

/* hide native radio */
.cart3-totals #shipping_method input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* card-style label */
.cart3-totals #shipping_method label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #444;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

/* custom radio dot */
.cart3-totals #shipping_method label::before {
  content: '';
  width: 14px;
  height: 14px;
  min-width: 14px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}

.cart3-totals #shipping_method input[type="radio"]:checked + label {
  border-color: #d22a32;
  background: #fafafa;
  color: #111;
}

.cart3-totals #shipping_method input[type="radio"]:checked + label::before {
  border-color: #d22a32;
  background: #d22a32;
  box-shadow: inset 0 0 0 3px #fafafa;
}

/* aviso Trek: solo recogida en tienda */
.cart3-trek-notice {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 12px 18px;
  background: #fff3f3;
  border-left: 3px solid #d22a32;
  font-size: 0.85rem;
  color: #111;
  line-height: 1.5;
}

.cart3-trek-notice strong {
  color: #d22a32;
}

/* ── Ocultar radio button de envío cuando solo hay opción Trek ── */
.cart-has-trek .woocommerce-shipping-methods input[type="radio"],
.cart-has-trek .woocommerce-shipping-methods input[type="hidden"],
.cart-has-trek .woocommerce-shipping-methods li::before,
.cart-has-trek .woocommerce-shipping-methods label::before,
.cart-has-trek .woocommerce-shipping-methods label::after {
  display: none !important;
}

/* alerta de sucursal al seleccionar recoger en tienda */
.cart3-pickup-notice {
  margin: 0 0 16px !important;
  padding: 10px 14px !important;
  background: #6767673c !important;
  /* border-left: 3px solid #f0a500 !important; */
  border-left: 3px solid #676767 !important;
  font-size: 0.8rem !important;
  /* color: #6b4f00 !important; */
  color: #111 !important;
  line-height: 1.5 !important;
}

/* nota de tiempo estimado en opción de envío */
.cart3-shipping-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: #888;
  margin-top: 2px;
  letter-spacing: 0;
}

/* hide "Enviar a" address line */
.cart3-totals .woocommerce-shipping-destination {
  display: none !important;
}

/* Checkout button */
.cart3-totals .wc-proceed-to-checkout .checkout-button,
.cart3-totals .wc-proceed-to-checkout a.button {
  display: block;
  width: 100%;
  padding: 14px;
  background: #d22a32;
  color: #fff !important;
  text-align: center;
  font-weight: 700;
  font-size: 0.925rem;
  text-decoration: none;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.cart3-totals .wc-proceed-to-checkout .checkout-button:hover,
.cart3-totals .wc-proceed-to-checkout a.button:hover {
  background: #a82027;
  color: #fff !important;
}

/* ── Empty cart ── */
.cart3-empty {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 48px;
  padding: 80px 0;
  width: 90%;
  max-width: 700px;
  margin: 0 auto;
}

.cart3-empty-icon {
  width: 120px !important;
  height: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  background: #fdf0f0;
  border-radius: 50%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
  flex-shrink: 0 !important;
}

.cart3-empty-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  text-align: left !important;
}

.cart3-empty-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: #111;
}

.cart3-empty-content p {
  font-size: 0.925rem;
  color: #777;
  line-height: 1.6;
  margin: 0 0 28px;
}

.cart3-empty-btn {
  display: inline-block !important;
  padding: 12px 32px;
  background: #d22a32 !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none !important;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.cart3-empty-btn:hover {
  background: #a82027 !important;
  color: #fff !important;
  text-decoration: none !important;
}

@media (max-width: 600px) {
  .cart3-empty {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 24px !important;
    padding: 60px 20px !important;
  }

  .cart3-empty-content {
    align-items: center !important;
    text-align: center !important;
  }
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .cart3-wrap {
    grid-template-columns: 1fr;
  }

  .cart3-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .cart3-header { display: none; }

  .cart3-actions {
    justify-content: center;
  }

  .cart3-actions .cart3-btn-secondary[name="update_cart"] {
    width: 100%;
    text-align: center;
  }

  .cart3-row {
    grid-template-columns: 80px 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 14px;
    padding: 18px 0;
  }

  .cart3-col-img {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
  }

  .cart3-col-img img {
    width: 76px;
    height: 76px;
    border-radius: 8px;
  }

  .cart3-col-name {
    grid-column: 2 / 4;
    grid-row: 1;
    align-self: end;
  }

  .cart3-col-price {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    font-size: 0.925rem;
    font-weight: 700;
  }

  .cart3-col-qty {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    padding-top: 0;
  }

  .cart3-col-subtotal { display: none; }
}