/* ─────────────────────────────────────────────────────────────────
   Miller Piano — Main Stylesheet
   Typography:  Cormorant Garamond (display/headings) · Inter (body/UI)
   Color tokens defined here; Tailwind arbitrary values reference these.
───────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Smooth scroll ─────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

/* ── Mobile touch behaviour ────────────────────────────────────── */
a,
button,
[role="button"],
summary,
input[type="button"],
input[type="submit"],
input[type="reset"],
label[for] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button,
[role="button"],
summary {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Design Tokens ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --mp-crimson:        #8B1A1A;
  --mp-crimson-hover:  #A52424;
  --mp-crimson-dark:   #6B1212;

  /* Surfaces */
  --mp-bg:             #FFFFFF;
  --mp-ivory:          #FAF7F4;
  --mp-parchment:      #F0E9E0;
  --mp-dark:           #0F0B07;

  /* Text */
  --mp-ink:            #181614;
  --mp-slate:          #3D3835;
  --mp-muted:          #78706A;
  --mp-faint:          #ADA59C;

  /* Structure */
  --mp-border:         #E5DDD5;

  /* Legacy aliases for any remnant references */
  --background:        var(--mp-bg);
  --foreground:        var(--mp-ink);
}

/* ── Base ──────────────────────────────────────────────────────── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--mp-bg);
  color: var(--mp-slate);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

p {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
}

/*
  Keep paragraph text in Inter sitewide and restore the navbar to the body font.
*/
header nav a,
header nav button,
header nav span,
#mobile-menu a,
#mobile-menu button,
#mobile-menu summary {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
}

@media (max-width: 1023px) {
  #mobile-menu {
    box-shadow: 0 14px 32px rgba(24, 22, 20, 0.14);
  }

  /* ── All mobile nav items: uniform Inter, bold, uppercase, tracked ── */
  /* Top-level: a links + Inventory summary */
  #mobile-menu > div > a,
  #mobile-menu > div > details > summary {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
  }

  /* Second-level: All Pianos link + piano-type summaries (Grand, Upright…) */
  #mobile-menu details > div > a,
  #mobile-menu details > div > details > summary {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
  }

  /* Third-level: New Grand, Pre-Owned Grand, etc. */
  #mobile-menu details details > div a {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.10em !important;
    text-transform: uppercase !important;
  }
}

.hero-slide-mobile-bg {
  display: none;
}

/* Focal-point support for hero slides */
.mp-hero-img {
  object-position: center var(--fy, 50%);
}
@media (max-width: 640px) {
  .mp-hero-img {
    object-position: var(--fx-m, 50%) var(--fy-m, var(--fy, 50%));
  }
}

/* Focal-point support for promotion images */
.promo-focal-img {
  object-position: center var(--pfy, 50%);
}
@media (max-width: 640px) {
  .promo-focal-img {
    object-position: var(--pfx-m, 50%) var(--pfy-m, var(--pfy, 50%));
  }
}

@media (max-width: 767px) {
  #hero-carousel {
    min-height: 74vh;
    background: #120e0b;
  }

  .hero-slide-mobile-bg {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(16px) saturate(88%);
    transform: scale(1.08);
    opacity: 0.72;
  }

  #hero-carousel .hero-slide-image {
    position: relative;
    z-index: 1;
    object-fit: contain;
    object-position: center;
  }

  #hero-carousel .hero-overlay-scrim {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.24) 45%, rgba(0, 0, 0, 0.14) 100%);
  }
}

.inventory-search-form,
.inventory-search-form input,
.inventory-search-button,
.inventory-filter-group,
.inventory-filter-label,
.inventory-filter-chip,
.inventory-filter-chip a,
.inventory-filter-chip,
.inventory-filter-chip * {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
}

.inventory-search-form input::placeholder {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.5);
}

.inventory-search-button,
.inventory-filter-label,
.inventory-filter-chip {
  letter-spacing: 0.18em !important;
}

.inventory-filter-chip {
  font-weight: 700 !important;
}

.inventory-hero-layout {
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 560px);
  align-items: start;
  gap: 1.4rem;
}

.inventory-hero-copy {
  max-width: 42rem;
  align-self: center;
}

.inventory-hero-controls {
  justify-self: end;
  align-self: start;
  width: min(100%, 560px);
  display: grid;
  gap: 0.7rem;
  margin-top: 0.1rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: linear-gradient(155deg, rgba(17, 11, 8, 0.8) 0%, rgba(11, 7, 5, 0.64) 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(5px);
}

.inventory-hero-controls .inventory-search-form {
  gap: 0.65rem;
}

.inventory-hero-controls .inventory-search-button {
  min-width: 98px;
}

.inventory-filters-wrap {
  width: 100%;
  overflow: visible;
}

.inventory-filter-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.inventory-filter-group-inline {
  width: 100%;
  display: grid;
  grid-template-columns: 9.25rem minmax(0, 1fr);
  align-items: center;
  column-gap: 0.7rem;
  row-gap: 0.45rem;
}

.inventory-filter-group-inline > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.inventory-filter-label {
  text-align: left;
}

.inventory-brand-select-wrap {
  position: relative;
  min-width: 220px;
  justify-self: center;
  border-radius: 0.75rem;
  border: 1px solid rgba(139, 26, 26, 0.45);
  background: linear-gradient(145deg, rgba(26, 17, 13, 0.76) 0%, rgba(16, 10, 8, 0.84) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(139, 26, 26, 0.2);
}

.inventory-brand-select-wrap::after {
  content: '';
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid rgba(212, 91, 91, 0.94);
  border-bottom: 2px solid rgba(212, 91, 91, 0.94);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.inventory-brand-select {
  width: 100%;
  min-width: 220px;
  padding: 0.62rem 2.05rem 0.62rem 0.78rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.inventory-brand-select:focus {
  outline: none;
  border-color: rgba(212, 91, 91, 0.95);
  box-shadow: 0 0 0 3px rgba(212, 91, 91, 0.32);
}

.inventory-brand-select-wrap:hover {
  border-color: rgba(212, 91, 91, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(212, 91, 91, 0.36);
}

.inventory-brand-select option {
  color: #181614;
}

.inventory-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.9rem;
}

.inventory-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inventory-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 5.6rem;
}

.inventory-card-price {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: clamp(1.5rem, 2.3vw, 1.95rem);
  font-weight: 600;
  color: #e6d4bf;
  text-align: right;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.listing-detail-price {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  color: #e6d4bf;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.inventory-status-badge {
  position: relative;
  cursor: default;
}

.inventory-tooltip-bubble {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  min-width: 180px;
  max-width: min(320px, 80vw);
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(15, 11, 7, 0.98);
  color: #f4eee7;
  border: 1px solid rgba(139, 26, 26, 0.58);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.7rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  z-index: 40;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.inventory-tooltip-bubble::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(15, 11, 7, 0.98);
  z-index: 41;
  pointer-events: none;
}

.inventory-status-badge:hover .inventory-tooltip-bubble,
.inventory-status-badge:focus-within .inventory-tooltip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.inventory-search-form input {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 1023px) {
  .inventory-hero-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .inventory-hero-controls {
    justify-self: stretch;
    width: 100%;
  }

  .inventory-filter-row {
    justify-content: flex-start;
  }

  .inventory-filter-group-inline {
    width: 100%;
  }

  .inventory-filter-group-inline > div {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .inventory-hero-controls {
    padding: 0.75rem;
  }

  .inventory-hero-controls .inventory-search-button {
    width: 100%;
  }

  .inventory-filter-group-inline {
    grid-template-columns: 1fr;
    row-gap: 0.35rem;
  }

  .inventory-filter-group-inline > div {
    justify-content: flex-start;
  }

  .inventory-brand-select {
    width: 100%;
    min-width: 0;
  }

  .inventory-brand-select-wrap {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .inventory-search-form input,
  .inventory-search-form input::placeholder {
    font-size: 1.15rem;
  }

  .inventory-card-price {
    font-size: 1.42rem;
  }

  .inventory-card-description {
    min-height: 0;
  }
}

#contact-panel,
#contact-panel p,
#contact-panel a,
#contact-panel button {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}

/* Footer: Cormorant Garamond for branding, Inter for body/links */
footer .font-display {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
}

/* Display / heading font */
.font-display {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

/* ── Button System ─────────────────────────────────────────────── */
/*
  Use these classes for any new buttons. Existing Tailwind-inline
  buttons continue to work; these extend the design system cleanly.
*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;        /* 11px */
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  padding: 0.875rem 2rem;
  border: none;
  transition: background-color 220ms ease,
              color 220ms ease,
              border-color 220ms ease,
              opacity 220ms ease;
}

.btn-primary {
  background: var(--mp-crimson);
  color: #ffffff;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--mp-crimson-hover);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: var(--mp-crimson);
  border: 1.5px solid var(--mp-crimson);
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--mp-crimson);
  color: #ffffff;
}

.btn-outline-white {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}
.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-white {
  background: #ffffff;
  color: var(--mp-ink);
}
.btn-white:hover {
  background: #f5f3f0;
}

/* ── Section eyebrow label ─────────────────────────────────────── */
.section-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mp-crimson);
}

/* ── Scroll indicator bounce ───────────────────────────────────── */
@keyframes mp-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ── Pop-in on scroll ──────────────────────────────────────────── */
/* Only applied to elements that explicitly carry this class in HTML */
.pop-in {
  opacity: 0 !important;
  transform: translateY(22px) scale(0.985) !important;
  transition:
    opacity 900ms cubic-bezier(0.18, 0.95, 0.2, 1),
    transform 900ms cubic-bezier(0.18, 0.95, 0.2, 1);
  will-change: opacity, transform;
}

.pop-in.is-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

@media (prefers-reduced-motion: reduce) {
  .pop-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
}

/* ── Brands marquee ────────────────────────────────────────────── */
@keyframes brands-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.brands-track {
  display: flex;
  align-items: center;
  gap: 5rem;
  width: max-content;
}

.brands-track.is-css-marquee {
  animation: brands-scroll 12s linear infinite;
}

.brands-track.is-css-marquee:hover {
  animation-play-state: paused;
}

.mp-brand-logo-shell {
  overflow: visible;
}

.mp-brand-logo-img {
  max-width: none;
  max-height: none;
}

.mp-brand-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(24, 22, 20, 0.25);
  color: rgba(24, 22, 20, 0.6);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .brands-track.is-css-marquee {
    animation: none;
  }
}
