/* ═══════════════════════════════════════════════════════════════════════════
   MotoMagic — My Garage Styles  (css/garage.css)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────────────────────*/
.garage-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 100px 32px 80px;
}

.garage-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.garage-title {
  font-family: var(--font-d);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.1;
}

.garage-sub {
  font-size: 15px;
  color: var(--gray);
  margin-top: 6px;
  max-width: 500px;
}

/* ── Reminders strip ─────────────────────────────────────────────────────────*/
.reminder-strip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.reminder-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  margin-bottom: 14px;
}

.reminder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card2);
  border: 1px solid;
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: transform .2s var(--ease);
}
.reminder-item:hover { transform: translateY(-2px); }

.reminder-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.reminder-name { font-size: 13px; font-weight: 600; color: var(--white); }
.reminder-detail { font-size: 12px; margin-top: 2px; font-weight: 600; }
.reminder-bike { font-size: 11px; color: var(--gray-dim); margin-top: 3px; }

/* ── Bike grid ───────────────────────────────────────────────────────────────*/
.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ── Bike card ───────────────────────────────────────────────────────────────*/
.bike-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
  overflow: hidden;
}
.bike-card:hover {
  border-color: var(--line2);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.6);
  transform: translateY(-3px);
}
.bike-card--primary {
  border-color: rgba(227,6,19,.3);
  box-shadow: 0 0 0 1px rgba(227,6,19,.15);
}
.bike-card--primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--accent));
}

.bike-primary-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--red);
  background: rgba(227,6,19,.1);
  border: 1px solid rgba(227,6,19,.2);
  border-radius: 99px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

.bike-card-header {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
}

.bike-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gray);
}

.bike-info { flex: 1; min-width: 0; }
.bike-name {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bike-subtitle { font-size: 12.5px; color: var(--gray); margin-top: 2px; }

.bike-actions-menu { display: flex; gap: 4px; flex-shrink: 0; }
.bike-action-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.bike-action-btn:hover { background: rgba(255,255,255,.1); }

.bike-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.bike-stat {
  background: var(--card2);
  border-radius: var(--r-sm);
  padding: 10px;
  text-align: center;
}
.bike-stat-v { display: block; font-family: var(--font-d); font-size: 14px; font-weight: 700; }
.bike-stat-l { display: block; font-size: 10.5px; color: var(--gray-dim); margin-top: 2px; }

.bike-alerts { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.alert-chip {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  border: 1px solid;
}
.alert-chip--red    { color: #f87171; background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.2); }
.alert-chip--yellow { color: #fbbf24; background: rgba(251,191,36,.1);  border-color: rgba(251,191,36,.2);  }

.bike-card-footer { display: flex; gap: 9px; }
.bike-card-footer .btn { flex: 1; justify-content: center; }

/* ── Empty state ──────────────────────────────────────────────────────────────*/
.garage-empty {
  text-align: center;
  padding: 80px 40px;
  border: 1px dashed var(--line2);
  border-radius: var(--r-lg);
}
.garage-empty svg { margin: 0 auto 20px; }
.garage-empty h3 { font-family: var(--font-d); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.garage-empty p  { color: var(--gray); font-size: 14px; }

/* ── Bike detail ──────────────────────────────────────────────────────────────*/
.bike-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.bike-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 36px;
}
.bike-meta-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.bike-meta-label { font-size: 10.5px; color: var(--gray-dim); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 5px; }
.bike-meta-value { font-size: 14px; font-weight: 600; }

/* ── Section heading ──────────────────────────────────────────────────────────*/
.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.section-heading h2 {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 700;
}
.section-heading-sub { font-size: 13px; color: var(--gray); }

/* ── Service grid ─────────────────────────────────────────────────────────────*/
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.service-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  cursor: pointer;
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -10px rgba(0,0,0,.5);
}
.service-card--overdue  { border-color: rgba(248,113,113,.25); }
.service-card--due_soon { border-color: rgba(251,191,36,.25); }

.service-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.service-icon { font-size: 22px; }

.status-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid;
}

.service-name { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }

.service-details { display: flex; flex-direction: column; gap: 4px; }
.service-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--gray);
}
.service-detail-row span:last-child { color: var(--white); font-weight: 500; }
.service-notes { font-size: 11px; color: var(--gray-dim); margin-top: 6px; font-style: italic; }
.service-empty { font-size: 12px; color: var(--gray-dim); font-style: italic; }

/* ── Timeline ─────────────────────────────────────────────────────────────────*/
.timeline { padding-left: 16px; }
.timeline-month { margin-bottom: 28px; }
.timeline-month-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  margin-bottom: 12px;
}
.timeline-entries { display: flex; flex-direction: column; gap: 10px; }
.timeline-entry {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 8px rgba(227,6,19,.4);
}
.timeline-content { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; flex: 1; }
.timeline-label { font-size: 13.5px; font-weight: 600; }
.timeline-meta  { font-size: 11.5px; color: var(--gray); margin-top: 3px; }
.timeline-notes { font-size: 11.5px; color: var(--gray-dim); margin-top: 5px; font-style: italic; }
.timeline-empty { padding: 28px; text-align: center; color: var(--gray); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--r-md); }

/* ── Garage form ──────────────────────────────────────────────────────────────*/
.garage-form { display: flex; flex-direction: column; gap: 14px; }
.gf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gf-group { display: flex; flex-direction: column; gap: 5px; }
.gf-label { font-size: 12px; font-weight: 600; color: var(--gray); }
.gf-input {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s;
  width: 100%;
}
.gf-input:focus { outline: none; border-color: var(--red); }
.gf-select { cursor: pointer; }
.gf-select option { background: var(--card2); }
.gf-textarea { resize: vertical; min-height: 80px; }

/* ── Dashboard garage card (used in dashboard.js) ────────────────────────────*/
.garage-dash-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.garage-dash-bike {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.garage-dash-bike:last-child { border-bottom: none; }
.garage-dash-bike-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--card2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.garage-dash-bike-name { font-size: 13.5px; font-weight: 600; }
.garage-dash-bike-sub  { font-size: 11.5px; color: var(--gray); }
.garage-dash-alert { color: #f87171; font-size: 11px; font-weight: 700; }

/* ── Responsive ───────────────────────────────────────────────────────────────*/
@media (max-width: 768px) {
  .garage-wrap   { padding: 80px 16px 60px; }
  .garage-header { flex-direction: column; align-items: flex-start; }
  .garage-grid   { grid-template-columns: 1fr; }
  .gf-row        { grid-template-columns: 1fr; }
  .bike-detail-header { flex-direction: column; }
  .bike-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .service-grid  { grid-template-columns: 1fr 1fr; }
  .reminder-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .service-grid  { grid-template-columns: 1fr; }
  .bike-meta-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Progress bars ────────────────────────────────────────────────────────────*/
.svc-progress {
  height: 4px;
  background: rgba(255,255,255,.07);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 9px;
}
.svc-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s var(--ease);
}
.svc-progress-label {
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Skeleton loaders ─────────────────────────────────────────────────────────*/
@keyframes mmSkeleton {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.04) 25%,
    rgba(255,255,255,.09) 50%,
    rgba(255,255,255,.04) 75%
  );
  background-size: 800px 100%;
  animation: mmSkeleton 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.bike-card-skeleton {
  height: 280px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
}
.service-card-skeleton {
  height: 160px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* ── Animated stat counters ───────────────────────────────────────────────────*/
@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.bike-stat-v { animation: countUp .4s var(--ease) both; }
.bike-card:nth-child(1) .bike-stat-v { animation-delay: .05s; }
.bike-card:nth-child(2) .bike-stat-v { animation-delay: .10s; }
.bike-card:nth-child(3) .bike-stat-v { animation-delay: .15s; }

/* ── Staggered card entrance ──────────────────────────────────────────────────*/
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.garage-grid .bike-card { animation: cardIn .45s var(--ease) both; }
.garage-grid .bike-card:nth-child(1) { animation-delay: .00s; }
.garage-grid .bike-card:nth-child(2) { animation-delay: .07s; }
.garage-grid .bike-card:nth-child(3) { animation-delay: .14s; }
.garage-grid .bike-card:nth-child(4) { animation-delay: .21s; }
.garage-grid .bike-card:nth-child(5) { animation-delay: .28s; }
.garage-grid .bike-card:nth-child(n+6) { animation-delay: .35s; }

/* ═══════════════════════════════════════════════════════════════════════════
   My Garage — Phase 1 additions (page shell actions, wizard, quick actions,
   compatible parts, service modal). Appended; nothing above is modified.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Header actions + back link ─────────────────────────────────────────────*/
.garage-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.garage-header-actions .btn svg,
.qa-tile svg, .bike-card-footer .btn svg { width: 15px; height: 15px; }

.garage-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--gray);
  margin-bottom: 22px; transition: color .18s;
}
.garage-back:hover { color: var(--white); }
.garage-back svg { width: 16px; height: 16px; }

.detail-head-btns { display: flex; gap: 9px; flex-wrap: wrap; }

/* ── Add-motorcycle card (dashed tile in the grid) ──────────────────────────*/
.bike-card--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 240px; text-align: center; cursor: pointer;
  border: 1px dashed var(--line2); background: transparent;
  color: var(--gray); font: inherit;
  transition: border-color .2s, color .2s, background .2s, transform .25s var(--ease);
}
.bike-card--add:hover { border-color: var(--red); color: var(--white); background: rgba(227,6,19,.04); transform: translateY(-3px); }
.bike-card--add .add-plus {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(227,6,19,.12); color: var(--red); margin-bottom: 4px;
}
.bike-card--add .add-plus svg { width: 22px; height: 22px; }
.bike-card--add .add-label { font-family: var(--font-d); font-size: 15px; font-weight: 700; color: var(--white); }
.bike-card--add .add-hint  { font-size: 11.5px; color: var(--gray-dim); }

.bike-avatar svg { width: 26px; height: 26px; }
.bike-primary-badge svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; }

/* ── Quick actions strip (bike detail) ──────────────────────────────────────*/
.quick-actions {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 10px; margin-bottom: 34px;
}
.qa-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--line);
  color: var(--gray); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color .18s, color .18s, transform .2s var(--ease), background .18s;
}
.qa-tile svg { width: 20px; height: 20px; color: var(--red); transition: transform .2s var(--ease); }
.qa-tile:hover { border-color: var(--line2); color: var(--white); transform: translateY(-2px); background: var(--card2); }
.qa-tile:hover svg { transform: scale(1.08); }
.qa-tile span { color: inherit; }

/* Odometer inline editor inside the meta grid */
.bike-meta-odo .odo-row { display: flex; gap: 8px; align-items: center; }
.bike-meta-odo .gf-input { padding: 8px 10px; font-size: 13px; }
.bike-meta-odo .btn { flex-shrink: 0; }

/* ── Compatible parts ───────────────────────────────────────────────────────*/
.compat-group { margin-bottom: 26px; }
.compat-group-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.compat-group-head span { font-family: var(--font-d); font-size: 15px; font-weight: 700; }
.compat-more { font-size: 12.5px; font-weight: 600; color: var(--red); }
.compat-more:hover { color: var(--accent); }

.compat-scroll {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.compat-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.compat-card:hover { border-color: var(--line2); transform: translateY(-3px); box-shadow: 0 14px 34px -16px rgba(0,0,0,.6); }
.compat-img { aspect-ratio: 1 / 1; background: var(--card2); overflow: hidden; }
.compat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.compat-card:hover .compat-img img { transform: scale(1.05); }
.compat-body { padding: 11px 13px 14px; }
.compat-brand { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-dim); font-weight: 700; }
.compat-name {
  font-size: 12.5px; font-weight: 600; margin: 3px 0 7px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.compat-price { font-family: var(--font-d); font-size: 14px; font-weight: 700; color: var(--white); }
.compat-price s { color: var(--gray-dim); font-size: 12px; font-weight: 500; margin-left: 4px; }

/* ── Add / edit wizard ──────────────────────────────────────────────────────*/
.garage-wizard { display: flex; flex-direction: column; gap: 20px; }
.wiz-steps { display: flex; gap: 8px; }
.wiz-step {
  flex: 1; display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--card2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--gray-dim);
  transition: border-color .2s, color .2s;
}
.wiz-step .wiz-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); font-size: 11.5px; font-weight: 700;
  flex-shrink: 0; transition: background .2s, color .2s;
}
.wiz-step.active { border-color: rgba(227,6,19,.4); color: var(--white); }
.wiz-step.active .wiz-dot { background: var(--red); color: #fff; }
.wiz-step.done { color: var(--white); }
.wiz-step.done .wiz-dot { background: rgba(0,200,80,.18); color: #34d399; }

.wiz-panel { display: flex; flex-direction: column; gap: 14px; }
.wiz-nav { display: flex; align-items: center; gap: 10px; padding-top: 6px; }

/* ── Log-service modal head ─────────────────────────────────────────────────*/
.svc-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 6px;
}
.svc-modal-head .service-icon { font-size: 26px; }
.svc-modal-head b { display: block; font-family: var(--font-d); font-size: 15px; font-weight: 700; }
.svc-modal-head i { display: block; font-style: normal; font-size: 12px; color: var(--gray); margin-top: 1px; }

/* ── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 760px) {
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .garage-header-actions { width: 100%; }
  .garage-header-actions .btn { flex: 1; justify-content: center; }
  .wiz-steps { gap: 6px; }
  .wiz-step span:not(.wiz-dot) { display: none; }
  .wiz-step { justify-content: center; }
}
@media (max-width: 460px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .compat-scroll { grid-template-columns: 1fr 1fr; }
}
