/* YourTrucks Wishlist & Price Alerts */

/* Header wishlist */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ytwa-header-wishlist {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 4px;
  color: var(--black, #262120);
  background: var(--white, #fff);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.ytwa-header-wishlist:hover,
.ytwa-header-wishlist:focus-visible {
  border-color: var(--blue, #006ebd);
  color: var(--blue, #006ebd);
  box-shadow: 0 0 0 3px rgba(0, 110, 189, 0.15);
  outline: none;
}

.ytwa-header-wishlist__count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.ytwa-header-wishlist__count:empty,
.ytwa-header-wishlist__count[data-count="0"] {
  display: none;
}

/* Card action buttons */
.camion-card {
  position: relative;
}

.ytwa-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ytwa-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.ytwa-card-action:hover,
.ytwa-card-action:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  outline: none;
}

.ytwa-card-action--whatsapp {
  color: #25d366;
}

.ytwa-card-action--wishlist {
  color: #e53935;
}

.ytwa-card-action--wishlist.is-active {
  color: #e53935;
}

.ytwa-card-action--alert {
  color: #0b1e36;
}

/* Single ficha button */
.ytwa-single-price-alert {
  margin-top: 8px;
}

/* Modal */
.ytwa-modal[hidden] {
  display: none !important;
}

.ytwa-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
}

.ytwa-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.ytwa-modal__dialog {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 16px auto;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.ytwa-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

.ytwa-modal__title {
  font-family: var(--font-display, inherit);
  font-size: 24px;
  margin: 0 0 8px;
}

.ytwa-modal__lead {
  margin: 0 0 12px;
  color: #555;
  line-height: 1.5;
}

.ytwa-modal__truck {
  margin: 0 0 16px;
  font-size: 16px;
}

.ytwa-modal__label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.ytwa-modal__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd0d4;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 15px;
}

.ytwa-modal__checkbox {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.4;
}

.ytwa-modal__submit {
  width: 100%;
}

.ytwa-modal__message {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.ytwa-modal__message.is-success {
  color: #1b5e20;
}

.ytwa-modal__message.is-error {
  color: #c62828;
}

.ytwa-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.ytwa-modal-open {
  overflow: hidden;
}

/* Wishlist page */
.ytwa-wishlist-page__intro {
  color: #666;
  margin-bottom: 24px;
}

.ytwa-wishlist-empty {
  text-align: center;
  padding: 40px 20px;
}

.ytwa-wishlist-loading {
  color: #666;
}

.camion-card.ytwa-card-removing {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Flash messages */
.ytwa-flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  background: #fff;
  font-size: 14px;
}

.ytwa-flash--success {
  border-left: 4px solid #2e7d32;
}

.ytwa-wishlist-live {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  background: #fff3e0;
  border-left: 4px solid #e65100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  font-size: 14px;
}

.ytwa-flash--info {
  border-left: 4px solid #1565c0;
}

@media (max-width: 768px) {
  .header-actions {
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 0;
  }

  .ytwa-header-wishlist {
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex-shrink: 0;
  }

  .ytwa-card-action {
    width: 40px;
    height: 40px;
  }
}
