/* Checkout / Cart page styles */

.checkout-page {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  min-height: calc(100vh - 200px);
  background: #1e1e1f;
  padding: 1.5rem 1rem 2rem;
}

@media (min-width: 768px) {
  .checkout-page {
    padding: 2rem 2rem 3rem;
  }
}

.checkout-page__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.checkout-page__header {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .checkout-page__header {
    margin-bottom: 2rem;
  }
}

.checkout-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-family: Inter, system-ui, sans-serif;
  transition: color 0.2s;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .checkout-back-link {
    margin-bottom: 1.5rem;
  }
}

.checkout-back-link:hover {
  color: #fff;
}

.checkout-title-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .checkout-title-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.checkout-title {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
  margin: 0;
}

@media (min-width: 768px) {
  .checkout-title {
    font-size: 2.25rem;
  }
}

.checkout-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: Inter, system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.checkout-clear-btn:hover {
  color: #fff;
}

/* Cart grid */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .checkout-grid {
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
}

.checkout-items {
  display: flex;
  flex-direction: column;
}

#cart-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  #cart-items {
    gap: 1rem;
  }
}

/* Cart item card */
.cart-item-card {
  background: #2a2a2b;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cart-item-card {
    flex-direction: row;
    padding: 1.5rem 1.75rem;
    gap: 1.5rem;
  }
}

@media (min-width: 768px) {
  .cart-item-card {
    padding: 1.5rem 2rem;
    gap: 1.75rem;
  }
}

.cart-item-card__image {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #1e1e1f;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .cart-item-card__image {
    width: 6rem;
    height: 6rem;
    margin: 0;
  }
}

.cart-item-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-card__body {
  flex: 1;
  min-width: 0;
}

.cart-item-card__name {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: Inter, system-ui, sans-serif;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.cart-item-card__name:hover {
  color: rgba(255, 255, 255, 0.8);
}

@media (min-width: 768px) {
  .cart-item-card__name {
    font-size: 1.125rem;
  }
}

.cart-item-card__category {
  color: #777;
  font-size: 0.875rem;
  font-family: Inter, system-ui, sans-serif;
  margin-bottom: 1rem;
}

.cart-item-card__controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .cart-item-card__controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cart-item-card__qty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cart-item-card__qty-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: #1e1e1f;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cart-item-card__qty-btn:hover:not(:disabled) {
  background: #333;
}

.cart-item-card__qty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-item-card__qty-value {
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  width: 2rem;
  text-align: center;
}

.cart-item-card__price-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.cart-item-card__price {
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
  margin: 0;
}

.cart-item-card__unit-price {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
  font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 768px) {
  .cart-item-card__price {
    font-size: 1.25rem;
  }
}

.cart-item-card__remove {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.cart-item-card__remove:hover {
  color: #ef4444;
}

.cart-item-card {
  position: relative;
}

.cart-item-card__main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cart-item-card__main {
    flex-direction: row;
    flex: 1;
  }
}

.cart-item-card__remove {
  align-self: flex-start;
}

@media (min-width: 640px) {
  .cart-item-card__remove {
    align-self: center;
  }
}

/* Summary sidebar */
.checkout-summary {
  background: #2a2a2b;
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 6rem;
}

@media (min-width: 768px) {
  .checkout-summary {
    padding: 1.5rem;
  }
}

.checkout-summary__title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
  margin: 0 0 1rem;
}

@media (min-width: 768px) {
  .checkout-summary__title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

.checkout-summary__rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .checkout-summary__rows {
    margin-bottom: 1.5rem;
  }
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
}

.checkout-summary__row span:first-child {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 768px) {
  .checkout-summary__row span:first-child {
    font-size: 1rem;
  }
}

.checkout-summary__row span:last-child {
  color: #fff;
  font-size: 0.875rem;
  font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 768px) {
  .checkout-summary__row span:last-child {
    font-size: 1rem;
  }
}

.checkout-summary__total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.checkout-summary__total-label {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 768px) {
  .checkout-summary__total-label {
    font-size: 1.125rem;
  }
}

.checkout-summary__total-value {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
}

@media (min-width: 768px) {
  .checkout-summary__total-value {
    font-size: 1.75rem;
  }
}

.checkout-summary__btn {
  width: 100%;
  background: linear-gradient(to right, #4854fc, #6b5fff);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 15px -3px rgba(72, 84, 252, 0.3);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .checkout-summary__btn {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
  }
}

.checkout-summary__btn:hover {
  background: linear-gradient(to right, #5b65ff, #7c6fff);
}

.checkout-summary__disclaimer {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-family: Inter, system-ui, sans-serif;
  text-align: center;
}

/* Empty cart */
.checkout-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.checkout-empty__icon {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
}

.checkout-empty__title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: Inter, system-ui, sans-serif;
  margin: 0 0 0.5rem;
}

.checkout-empty__text {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.checkout-empty__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-family: Inter, system-ui, sans-serif;
  transition: color 0.2s;
}

.checkout-empty__btn:hover {
  color: #fff;
}

/* Checkout modal */
.checkout-modal .modal-dialog {
  max-width: 560px;
}

.checkout-modal__content {
  background: #2a2a2b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  overflow: hidden;
}

.checkout-modal__header {
  background: #2a2a2b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.5rem;
}

.checkout-modal__title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: Inter, system-ui, sans-serif;
  margin: 0;
}

.checkout-modal__close {
  filter: invert(1);
  opacity: 0.7;
}

.checkout-modal__close:hover {
  opacity: 1;
}

.checkout-modal__body {
  background: #2a2a2b;
  padding: 1.5rem;
}

.checkout-modal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.checkout-modal__field--full {
  grid-column: 1 / -1;
}

.checkout-modal__label {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-family: Inter, system-ui, sans-serif;
  margin-bottom: 0.5rem;
}

.checkout-modal__required {
  color: #f87171;
}

.checkout-modal__input,
.checkout-modal__textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #1e1e1f !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  color: #fff !important;
  font-size: 1rem;
  font-family: Inter, system-ui, sans-serif;
  transition: border-color 0.2s;
}

.checkout-modal__input:-webkit-autofill,
.checkout-modal__input:-webkit-autofill:hover,
.checkout-modal__input:-webkit-autofill:focus,
.checkout-modal__input:-webkit-autofill:active {
  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0 1000px #1e1e1f inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.checkout-modal__input::placeholder,
.checkout-modal__textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.checkout-modal__input:focus,
.checkout-modal__textarea:focus {
  outline: none;
  border-color: #6b5fff;
  box-shadow: 0 0 0 2px rgba(107, 95, 255, 0.2);
  background-color: #1e1e1f !important;
}

.checkout-modal__input.is-invalid {
  border-color: #f87171;
}

.checkout-modal__textarea {
  resize: vertical;
  min-height: 4rem;
}

.checkout-modal__error {
  color: #f87171;
  font-size: 0.8rem;
  font-family: Inter, system-ui, sans-serif;
  margin-top: 0.25rem;
}

.checkout-modal .invalid-feedback {
  display: none;
}

.checkout-modal .form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

.checkout-modal__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #1e1e1f;
  border-radius: 0.75rem;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
}

.checkout-modal__total span {
  color: rgba(255, 255, 255, 0.8);
}

.checkout-modal__total strong {
  font-size: 1.25rem;
}

.checkout-modal__footer {
  background: #2a2a2b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.5rem 1.5rem;
  flex-direction: column;
  gap: 0.75rem;
}

.checkout-modal__submit {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(to right, #4854fc, #6b5fff);
  border: none;
  border-radius: 0.75rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 4px 12px rgba(72, 84, 252, 0.3);
}

.checkout-modal__submit:hover {
  background: linear-gradient(to right, #5b65ff, #7c6fff);
}

.checkout-modal__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.checkout-modal__back {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-family: Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.checkout-modal__back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Email field with validation icon */
.co-email-wrap {
  position: relative;
}

.co-email-wrap .checkout-modal__input {
  padding-right: 2.4rem;
}

/* Suppress Bootstrap's built-in background-image checkmark/cross for email —
   we use our own icon instead */
.co-email-wrap .form-control:valid,
.co-email-wrap .form-control:invalid,
.was-validated .co-email-wrap .form-control:valid,
.was-validated .co-email-wrap .form-control:invalid {
  background-image: none !important;
  padding-right: 2.4rem !important;
}

.co-email-icon {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s;
}

.co-email-icon--ok  { color: #4ade80; }
.co-email-icon--err { color: #f87171; }

/* Summary numbers skeleton (only on numbers in right panel) */
.summary-value--loading {
  color: transparent !important;
  min-width: 2.5em;
  background: linear-gradient(90deg, #353538 25%, #404045 50%, #353538 75%);
  background-size: 200% 100%;
  animation: summary-skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 0.25rem;
}

.checkout-summary__total-value.summary-value--loading {
  min-width: 4em;
}

@keyframes summary-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


#co-callsign {
  pointer-events: none;  
}

/* ─── Title row actions ──────────────────────────────────────────── */

.checkout-title-row__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ─── Share cart button ──────────────────────────────────────────── */

.checkout-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid rgba(99, 179, 237, 0.45);
  color: #63b3ed;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.checkout-share-btn:hover {
  background: rgba(99, 179, 237, 0.12);
  border-color: #63b3ed;
  color: #90cdf4;
}

.checkout-share-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Share link modal ───────────────────────────────────────────── */

.share-link-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.share-link-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
  font-family: 'Courier New', monospace;
  outline: none;
  min-width: 0;
  cursor: text;
}

.share-link-input:focus {
  border-color: rgba(99, 179, 237, 0.5);
}

.share-link-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(99, 179, 237, 0.15);
  border: 1px solid rgba(99, 179, 237, 0.4);
  color: #63b3ed;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  font-family: Inter, system-ui, sans-serif;
}

.share-link-copy-btn:hover {
  background: rgba(99, 179, 237, 0.25);
  border-color: #63b3ed;
}

.share-link-copied {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #4ade80;
  font-size: 0.8rem;
  margin-top: 0.6rem;
}

/* ─── Import cart page ───────────────────────────────────────────── */

.import-cart-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: Inter, system-ui, sans-serif;
}

.import-cart-state__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #63b3ed;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.import-cart-state__icon--error {
  color: #f87171;
}

.import-cart-state__text {
  font-size: 1rem;
  text-align: center;
}

.import-cart-desc {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  font-family: Inter, system-ui, sans-serif;
  margin-bottom: 1rem;
}

.import-cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.import-item-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-family: Inter, system-ui, sans-serif;
}

.import-item-card__img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.import-item-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.import-item-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.import-item-card__name {
  font-size: 0.9rem;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.import-item-card__category {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.import-item-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
}

.import-item-card__qty {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.import-item-card__price {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
}

.import-cart-total {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.5rem;
}

.import-cart-total strong {
  color: #e2e8f0;
  font-weight: 700;
}

.import-cart-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.import-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.import-cart-btn:hover {
  opacity: 0.88;
}

.import-cart-btn:active {
  transform: scale(0.97);
}

.import-cart-btn--primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

/* ─── Import mode options (inside modal) ────────────────────────── */

.import-mode-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.import-mode-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e2e8f0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.import-mode-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.import-mode-btn--replace {
  border-color: rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.import-mode-btn--replace:hover {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.5);
}

.import-mode-btn--replace svg {
  color: #f87171;
  flex-shrink: 0;
}

.import-mode-btn--merge {
  border-color: rgba(74, 222, 128, 0.3);
  color: #86efac;
}

.import-mode-btn--merge:hover {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.5);
}

.import-mode-btn--merge svg {
  color: #4ade80;
  flex-shrink: 0;
}