/* ----------------------------------------------------------
   Layout for Offers Made
---------------------------------------------------------- */

.layout__content--offers-made {
  padding: 40px 56px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Header */
.om-header__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f9fafb;
}

.om-header__subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #9ca3af;
}

/* List wrapper */
.om-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Empty state */
.or-empty-message {
  margin-top: 24px;
  font-size: 14px;
  color: #9ca3af;
}

/* ----------------------------------------------------------
   Offer card (matches structure from offers-made.js)
---------------------------------------------------------- */

.offer-card {
  background: #020617;
  border-radius: 24px;
  padding: 18px 22px 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Top row: plate + price/status */
.offer-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Allow the meta + message to sit under the plate on desktop,
   but align next to price/status on mobile (see 768px media query below). */
.offer-card__top {
  flex-wrap: wrap;
}

.offer-card__plate { order: 1; }
.offer-card__price-status { order: 2; }

/* Wrapper for the meta + message */
.offer-card__details {
  order: 3;
  flex-basis: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}



/* Plate */
.offer-card__plate {
  background: #dedE17;              /* same yellow you used elsewhere */
  border-radius: 14px;
  border: 1px solid #767171;
  min-width: 220px;
  padding: 6px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.45);
}

.offer-card__plate-text {
  /* Use your UK plate font */
  font-family: "UKNumberPlate", "UKNumberPlate Regular", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Slightly lighter than before so it doesn’t look over-bold */
  font-weight: 500;

  font-size: 44px;
  line-height: 1;          /* keeps the text vertically centred */
    /* nice DVLA-ish spacing */
  text-transform: uppercase;
  color: #111827;
}


/* Price + status */
.offer-card__price-status {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.offer-card__price {
  font-size: 20px;
  font-weight: 700;
  color: #e5e7eb;
}

/* Status pill */
.offer-card__status {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Status variants (status is lowercased in JS) */
.offer-card__status--pending {
  background: #fffbeb;
  color: #92400e;
}

.offer-card__status--accepted {
  background: #ecfdf5;
  color: #047857;
}

.offer-card__status--declined {
  background: #fef2f2;
  color: #b91c1c;
}

.offer-card__status--withdrawn {
  background: #f3f4f6;
  color: #4b5563;
}



/* ----------------------------------------------------------
   Meta row (time, direction)
---------------------------------------------------------- */

.offer-card__meta {
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-card__meta-sep {
  opacity: 0.7;
}

/* ----------------------------------------------------------
   Message preview
---------------------------------------------------------- */

.offer-card__message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #d1d5db;
}

.offer-card__message-icon {
  font-size: 14px;
  margin-top: 2px;
}

.offer-card__message-text {
  margin: 0;
  font-style: italic;
}

/* ----------------------------------------------------------
   Actions row
---------------------------------------------------------- */

.offer-card__actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap; /* lets the note drop onto its own line */
}

/* Optional note under buttons (payment status text) */
.offer-card__note {
  margin: 0 0 0 auto;
  font-size: 12px;
  color: #9ca3af;
}

/* ----------------------------------------------------------
   Buttons (if you don't already have global ones)
   If you already have .btn-primary / .btn-secondary, you can
   delete this section.
---------------------------------------------------------- */

.btn-primary {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #10b981;
  color: #ecfdf5;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.4);
  transition: transform 0.08s ease, box-shadow 0.12s ease,
    background 0.12s ease;
}

.btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-secondary {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: #e5e7eb;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
}

.btn-danger-light {
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.6);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

.btn-danger-light:hover {
  background: rgba(248, 113, 113, 0.16);
}

/* ----------------------------------------------------------
   Responsive tweaks
---------------------------------------------------------- */

@media (max-width: 900px) {
  .layout__content--offers-made {
    padding: 24px 18px;
  }

  .offer-card__top {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-card__plate {
    min-width: 0;
    width: 100%;
  }

  /* Keep meta/message directly under the plate on small screens */
  .offer-card__details {
    order: 2;
    margin-top: 10px;
  }

  .offer-card__price-status {
    order: 3;
    align-items: flex-end;
  }
}


.om-card__escrow-note {
  margin-top: 4px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65); /* or your neutral text colour */
}



/* Escrow reassurance text */
.offer-card__escrow-note {
  flex-basis: 100%;          /* force it onto a new line under the buttons */
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);  /* light text on dark card */
}


.price--old {
  text-decoration: line-through;
  color: #9ca3af; /* grey */
  margin-right: 0.5rem;
}

.price--counter {
  font-weight: 700;
  color: #000;
}

.offer-card__status--countered {
  background: #f97316; /* orange */
  color: #fff;
}


/* Old price in a counter – grey + strikethrough */
.offer-card__price--original {
  color: #9ca3af;           /* grey */
  text-decoration: line-through;
}

/* Optional: keep new price visually stronger */
.offer-card__price--counter {
  font-weight: 600;
}

/* Layout for price + status on the right-hand side */
.offer-card__price-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.offer-card__price-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

/* Stack COUNTERED pill with helper text underneath */
.offer-card__status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.offer-card__status-sub {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 2px;
}

/* Dim the original price on Offers Made cards */
.offer-card--made .offer-card__price--muted {
  color: rgba(255, 255, 255, 0.45);  /* soft grey on dark background */
}

/* Strike through the old price */
.offer-card--made .offer-card__price--struck {
  text-decoration: line-through;
}

/* Optional: add a tiny bit of spacing between old/new prices */
.offer-card--made .offer-card__price--struck {
  margin-right: 0.5rem;
}

/* Meta row (time, direction) */
.offer-card__meta {
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Make each meta item icon+text inline-centred */
.offer-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.offer-card__meta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

.offer-card__meta-icon svg {
  width: 100%;
  height: 100%;
}

/* Message preview */
.offer-card__message {
  display: flex;
  align-items: center;   /* centre icon + text vertically */
  gap: 8px;
  font-size: 13px;
  color: #d1d5db;
}

.offer-card__message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-top: 0;         /* remove previous nudge */
}

.offer-card__message-icon svg {
  width: 100%;
  height: 100%;
}


/* ---------------- Mobile-only: match Reg Marketplace behaviour ---------------- */
@media (max-width: 768px) {
  /* Hide sidebar, keep content full-width */
  #side-nav {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .layout__content--offers-made {
    padding: 18px 16px calc(120px + env(safe-area-inset-bottom));
    max-width: none;
    margin: 0;
  }

  /* Header row: title left, menu button right */
  .om-header__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  /* Keep plate looking good on smaller screens */
  .offer-card__plate {
    padding: 10px 14px;
    border-radius: 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .offer-card__plate-text {
    font-size: clamp(28px, 9vw, 44px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* Hide mobile-only UI by default (desktop/tablet) */
.reg-mobile-menu-btn,
.reg-mobile-menu,
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* anchor dropdown to the header row */
  .om-header__row {
    position: relative;
  }

  .reg-mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
  }

  .reg-mobile-menu {
    position: absolute;
    top: 52px;
    right: 0;
    width: min(280px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.55);
    display: none;
    z-index: 60;
  }

  .reg-mobile-menu.is-open {
    display: block;
  }

  .reg-mobile-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 14px;
  }

  .reg-mobile-menu__item:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .reg-mobile-menu__item.is-active {
    background: rgba(34, 211, 238, 0.16);
    border: 1px solid rgba(34, 211, 238, 0.2);
  }

  .reg-mobile-menu__icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.85);
  }

  /* bottom nav should be mobile-only */
  .bottom-nav {
    display: flex;
  }

  /* add bottom padding so content isn't hidden behind bottom nav */
  .layout__content--offers-made {
    padding-bottom: 120px;
  }
}

@media (max-width: 768px) {
  /* --- Tighten offer card layout: align meta with price/status --- */
  .offer-card__top {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "plate plate"
      "meta  price";
    gap: 10px 14px;
    align-items: start;
  }

  .offer-card__plate {
    grid-area: plate;
    margin-bottom: 0; /* removes the big empty gap */
  }

  /* left side (time/to seller + message) */
  .offer-card__details {
    grid-area: meta;
    margin-top: 0;
  }

  .offer-card__meta {
    margin-top: 0;
    margin-bottom: 6px;
  }

  .offer-card__message {
    margin-top: 0;
  }

  /* right side (£ + pending) */
  .offer-card__price-status {
    grid-area: price;
    align-self: start;
    text-align: right;
    margin-top: 0;
  }

  /* keep pill + price together */
  .offer-card__price {
    margin-bottom: 6px;
  }

  .offer-card__status {
    margin-top: 0;
  }
}



/* Mobile: align meta/message with price+status (removes the big gap under the plate) */
@media (max-width: 768px) {
  .offer-card__top {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "plate plate"
      "details price";
    gap: 10px 14px;
    align-items: start;
  }

  .offer-card__plate {
    grid-area: plate;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .offer-card__details {
    grid-area: details;
    margin-top: 0;
  }

  .offer-card__price-status {
    grid-area: price;
    margin-left: 0;
    align-items: flex-end;
  }
}

@media (max-width: 768px){
  /* Stop status text from expanding the whole grid */
  .offer-card__top{
    grid-template-columns: 1fr minmax(0, 170px) !important;
  }

  .offer-card__price-status{
    max-width: 170px;
  }

  .offer-card__status{
    max-width: 170px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.15;
    font-size: 10px;
    padding: 6px 10px;
    text-align: right;
  }
}
