/* ── Customer detail page ── */

.customer-page {
    min-height: 100vh;
    background: var(--color-bg, #faf7f1);
    font-family: var(--font-primary, sans-serif);
}

/* Nav reuse from main.css */
.main-nav {
    background: #fff;
    border-bottom: 1px solid #e8e4dc;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
}
.main-nav__inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}
.main-nav__logo-img { height: 32px; display: block; }

/* ── Hero ── */
.customer-hero {
    padding: 3rem 1.5rem 1.5rem;
}
.customer-hero__content {
    max-width: 780px;
    margin: 0 auto;
}
.customer-hero__title {
    font-size: var(--font-size-3xl, 2.4rem);
    font-weight: var(--font-weight-extra-bold, 800);
    margin: 0 0 0.75rem;
    line-height: 1.2;
    color: #1c1b18;
}
.customer-hero__tagline {
    font-size: 1.15rem;
    color: #555;
    margin: 0 0 1.5rem;
    line-height: 1.6;
    max-width: 720px;
}
.customer-hero__link {
    display: inline-block;
    color: #229966;
    border: 1px solid #229966;
    border-radius: 4px;
    padding: 0.5rem 1.2rem;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.customer-hero__link:hover { background: rgba(255,255,255,0.1); }

/* ── Main layout ── */
.customer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* ── Sections ── */
.customer-section {
    padding: 2.5rem 0;
    border-bottom: 1px solid #e8e4dc;
}
.customer-section:last-child { border-bottom: none; }
.customer-section__inner {
    max-width: 900px;
}
/* Routes grid needs the full site width so 3 horizontal cards have room */
.customer-section__inner--wide {
    max-width: 1160px;
}
.customer-section__heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: #2c3e50;
}

/* ── Description ── */
.customer-description p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #444;
    margin: 0 0 1rem;
}
.customer-description a { color: #2c7a4b; }

/* ── Fun fact ── */
.customer-funfact {
    background: #f0f7f4;
    border-radius: 8px;
    border: none;
    padding: 2rem;
    margin: 0;
}
.customer-funfact__inner {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    max-width: 900px;
}
.customer-funfact__icon {
    font-size: 2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.customer-funfact__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.5rem;
}
.customer-funfact__text {
    font-size: 1rem;
    line-height: 1.65;
    color: #444;
    margin: 0;
}

/* ── Destination routes map ── */
.customer-map-container {
    position: relative;
    height: 55vh;
    min-height: 350px;
    max-height: 600px;
    overflow: hidden;
}

.customer-map-container .leaflet-container {
    height: 100%;
    width: 100%;
}

/* ── Map sidebar: shared widget styles live in map_sidebar.css ── */

/* Route-list button (top-left leaflet control) sits below the lock button */
#customer-map-container .leaflet-top.leaflet-left {
    margin-top: 50px;
}

/* leaflet-sidebar-v2 shifts left controls ~50px right to clear its (hidden)
   tab strip — pull them back to the map edge when the sidebar is closed,
   and push them right of the 350px panel when it is open. */
#customer-map .leaflet-sidebar-left ~ .leaflet-control-container .leaflet-left {
    left: 0;
    transition: left 0.3s ease;
}

#customer-map .leaflet-sidebar-left:not(.collapsed) ~ .leaflet-control-container .leaflet-left {
    left: 360px;
}

/* Keep the open sidebar above the map lock button (z-index 1500) */
#customer-map .leaflet-sidebar {
    z-index: 1600;
}

/* Hide the user-type toggles while the sidebar is open (they overlap) */
#customer-map-container.sidebar-open .route-type-toggles { display: none; }

/* ── Route cards grid (reused from main) ── */
.route-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.route-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: row;
    height: 140px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.route-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.route-card__image {
    width: 160px;
    flex-shrink: 0;
    overflow: hidden;
    background: #ddd;
}
.route-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.route-card__color-bar {
    height: 4px;
}
.route-card__body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.route-card__name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
    line-height: 1.3;
}
.route-card__description {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}
.route-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.5rem;
}
.route-card__type {
    font-size: 0.75rem;
    border-left: 3px solid #ccc;
    padding-left: 0.4rem;
    color: #555;
}
.route-card__user-type {
    font-size: 0.75rem;
    color: #777;
}
.route-card__cta {
    font-size: 0.85rem;
    color: #2c7a4b;
    text-decoration: none;
    margin-top: auto;
    padding-top: 0.5rem;
}
.route-card__cta:hover { text-decoration: underline; }

/* ── Credit ── */
.customer-credit {
    padding-top: 2rem;
}
.customer-credit__body {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.65;
}
.customer-credit__body a { color: #2c7a4b; }
.customer-credit__body p { margin: 0 0 0.5rem; }

/* ── Footer ── */
.customer-footer {
    border-top: 1px solid #e8e4dc;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}
.customer-footer__back {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
}
.customer-footer__back:hover { color: #2c3e50; }
.customer-footer__logo img { display: block; }

@media (max-width: 600px) {
    .customer-hero__title { font-size: 1.75rem; }
    .route-cards-grid { grid-template-columns: 1fr; }
    .customer-funfact__inner { flex-direction: column; }
}

/* Route color chip — matches the line color on the destination map */
.route-color-chip {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: baseline;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

/* The user-type filter on this page is an always-visible panel (bottom-left),
   unlike the front page's collapsible right-side filter */
#user-type-toggles {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    top: auto;
    right: auto;
    bottom: 12px;
    left: 10px;
    max-width: calc(100% - 170px);
    border-radius: 24px;
    padding: 7px 12px;
    overflow: visible;
}
