/* ===== Replacement Parts UI (shared) ===== */

/* Dropdown (mobile-friendly, no text cut-off) */
#replacement-select {
  -webkit-appearance: menulist;
  appearance: menulist;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 16px;              /* prevents iOS zoom */
  line-height: 1.5;
  padding: 12px 48px 12px 12px; /* extra right padding for native arrow */
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  height: auto;                 /* let it size naturally */
  margin-bottom: 12px;
}

/* Focus/hover states for dropdown */
#replacement-select:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
  border-color: #000;
}
#replacement-select:hover {
  border-color: #000;
}

/* Base button box (full-width tap target) */
a#replacement-buy {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border-radius: 0;
  font-size: 16px;
  transition: all 0.2s ease;
}

/* Disabled button */
a#replacement-buy.disabled,
a#replacement-buy[aria-disabled="true"] {
  border: 1px solid #ccc !important;
  color: #999 !important;
  background: #fff !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

/* Enabled button (force black text + icon) */
a#replacement-buy:not(.disabled),
a#replacement-buy[aria-disabled="false"] {
  border: 1px solid #000 !important;
  color: #000 !important;
  background: #fff !important;
}
a#replacement-buy:not(.disabled) i,
a#replacement-buy[aria-disabled="false"] i {
  color: #000 !important;
}

/* Hover (enabled only) — invert to white text + white icon on black */
a#replacement-buy:not(.disabled):hover,
a#replacement-buy[aria-disabled="false"]:hover {
  background: #000 !important;
  color: #fff !important;
}
a#replacement-buy:not(.disabled):hover i,
a#replacement-buy[aria-disabled="false"]:hover i {
  color: #fff !important;
}

/* === Mobile: make select and button the same height === */
@media (max-width: 600px) {
  :root { --rp-control-h: 48px; } /* tweak to 52–56px if you want taller */

  /* Set equal heights */
  #replacement-select,
  a#replacement-buy {
    height: var(--rp-control-h);
  }

  /* Select: center text vertically and keep room for arrow */
  #replacement-select {
    padding: 0 48px 0 12px; /* remove vertical padding */
    line-height: calc(var(--rp-control-h) - 2px); /* minus borders */
  }

  /* Button: same vertical rhythm */
  a#replacement-buy {
    padding: 0 14px; /* remove vertical padding */
    line-height: calc(var(--rp-control-h) - 2px);
  }
}

/* Replacement Parts: Add-to-Cart Confirmation */
#replacement-confirm {
  color: green;
  font-size: 0.9em;
  margin-top: 6px;
  opacity: 1;
  transition: opacity 1s ease;
}

/* === Desktop: add 50px space below the section === */
@media (min-width: 768px) {
  .replacement-parts-section {
    margin-bottom: 50px !important;
  }
}
