/**
 * Homepage desktop showcase — hero + 3×2 card grid (lg+).
 */

.hp-desktop {
  display: none;
}

@media (min-width: 768px) {
  .homepage-desktop-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
    width: 100%;
    max-width: none;
    padding: 12px 20px 24px;
    background: #eef2f7;
    box-sizing: border-box;
  }

  .homepage-desktop-panels > .homepage-showcase-section,
  .homepage-desktop-panels > .homepage-marketplace-promo,
  .homepage-desktop-panels > .homepage-popular-near,
  .homepage-desktop-panels > .homepage-popular-services,
  .homepage-desktop-panels > .homepage-education-knowledge,
  .homepage-desktop-panels > .homepage-study-library,
  .homepage-desktop-panels > .homepage-consultants,
  .homepage-desktop-panels > .homepage-community-hub {
    min-width: 0;
    max-width: none;
  }

  .homepage-desktop-panels > .homepage-showcase-section {
    display: block;
    background: transparent;
    padding: 0;
    margin: 0;
    border: none;
  }

  .homepage-desktop-panels > .homepage-showcase-section,
  .homepage-desktop-panels > .homepage-showcase-section > .homepage-showcase-section__inner {
    display: contents;
  }

  .homepage-desktop-panels .homepage-showcase-section__inner,
  .homepage-desktop-panels .homepage-showcase-section__inner--businesses-only {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
  }

  /* Every panel spans two rows of the panels grid (head, cards) and shares them with the panel
     beside it via subgrid, so heads and card grids line up across side-by-side panels */
  .homepage-desktop-panels > * {
    grid-row: span 2;
  }

  /* Featured businesses: a full-width panel of image cards above the paired panels (card styles in
     homepage-showcase.css, panel colour in homepage-section-theme.css). The scrolling strip adds
     12px above, 14px below and 8px at the sides (room for the hover zoom), so cards still sit
     16px from the top/bottom and 14px from the sides of the panel. */
  .homepage-desktop-panels .homepage-showcase-panel--businesses {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 4px 6px 2px;
    border: 0;
    border-radius: 16px;
  }
}

@media (min-width: 992px) {
  .homepage-desktop-panels {
    padding: 12px 36px 32px;
    gap: 20px 24px;
  }

  .hp-desktop--community .hp-desktop__carousel.card-carousel[data-carousel-cols="3"] {
    --carousel-visible: 4;
  }

  .hp-desktop__hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 14px;
    flex-shrink: 0;
    height: 132px;
    min-height: 132px;
    max-height: 132px;
    background-image: var(--hp-desktop-hero);
    background-size: cover;
    background-position: center;
  }

  .hp-desktop__hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.88) 42%, rgba(255, 255, 255, 0.55) 100%);
  }

  .hp-desktop__hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
  }

  .hp-desktop__hero-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
  }

  .hp-desktop__hero-copy {
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hp-desktop__hero-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #2563eb;
  }

  .hp-desktop__hero-icon--pin-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #dc2626;
    color: #dc2626;
    background: #fff;
  }

  .hp-desktop__hero-icon--award {
    color: #ca8a04;
    font-size: 1.5rem;
  }

  .hp-desktop__title {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #0f172a;
  }

  .hp-desktop__title-accent {
    color: #15803d;
  }

  .hp-desktop--offers .hp-desktop__title-accent,
  .hp-desktop--ads .hp-desktop__title-accent {
    color: #15803d;
  }

  .hp-desktop--education .hp-desktop__title-accent {
    color: #2563eb;
  }

  .hp-desktop--study-material .hp-desktop__title-accent {
    color: #16a34a;
  }

  /* Study material: one row of 3 + horizontal scroll (no 3×2 squeeze) */
  .hp-desktop--study-material .hp-desktop__carousel {
    --carousel-visible: 3;
    --carousel-gap: 12px;
  }

  .hp-desktop--study-material .hp-desktop__carousel .card-carousel-item {
    flex: 0 0 calc((100% - (var(--carousel-gap) * 2)) / 3);
    max-width: calc((100% - (var(--carousel-gap) * 2)) / 3);
  }

  .hp-desktop--study-material .hp-desktop__carousel .card-carousel-track {
    flex-wrap: nowrap;
  }

  .hp-desktop--study-material .hp-desktop__carousel:not(.is-carousel-scrollable) .card-carousel-track {
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .hp-desktop--consultants .hp-desktop__title-accent {
    color: #1d4ed8;
  }

  .hp-desktop--community .hp-desktop__title-accent {
    color: #15803d;
  }

  .hp-desktop__subtitle {
    margin: 2px 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #64748b;
    max-width: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hp-desktop__chips {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 8px;
    max-height: 36px;
    overflow: hidden;
  }

  .hp-desktop__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;
    font-weight: 600;
    color: #334155;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-desktop__chip i {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
  }

  .hp-desktop__chip--green i { background: #16a34a; }
  .hp-desktop__chip--orange i { background: #ea580c; }
  .hp-desktop__chip--blue i { background: #2563eb; }
  .hp-desktop__chip--purple i { background: #7c3aed; }
  .hp-desktop__chip--red i { background: #dc2626; }
  .hp-desktop__chip--pink i { background: #db2777; }
  .hp-desktop__chip--teal i { background: #0d9488; }
  .hp-desktop__chip--amber i { background: #d97706; }

  .hp-desktop__cta {
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #14532d;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(20, 83, 45, 0.25);
    white-space: nowrap;
  }

  .hp-desktop__cta:hover {
    color: #fff;
    background: #166534;
  }

  .hp-desktop__carousel {
    --carousel-gap: 12px;
    --carousel-visible: 3;
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    padding: 0 2px;
  }

  .hp-desktop__carousel.card-carousel[data-carousel-cols="3"] {
    --carousel-visible: 3;
  }

  .hp-desktop__carousel .card-carousel-track {
    align-items: flex-start;
    padding-bottom: 4px;
  }

  .hp-desktop__carousel .card-carousel-item {
    display: flex;
    align-items: flex-start;
  }

  [data-slide-by="card"] .card-carousel-item > .hp-desktop-card {
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .hp-desktop__carousel .ad-slider-arrows {
    padding: 0 2px;
  }

  .hp-desktop__carousel .ad-slider-arrow {
    width: 32px;
    height: 32px;
    background: #fff;
    color: #334155;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
    font-size: 12px;
  }

  .hp-desktop__carousel .ad-slider-arrow:hover {
    background: #f8fafc;
    color: #0f172a;
  }

  .hp-desktop-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
  }

  .hp-desktop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    color: inherit;
  }

  .hp-desktop-card__media {
    position: relative;
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
    height: auto;
    overflow: hidden;
    background: #e2e8f0;
  }

  .hp-desktop-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .hp-desktop-card__tags {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
  }

  .hp-desktop-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  }

  .hp-desktop-card__badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .hp-desktop-card__badge i {
    flex-shrink: 0;
    font-size: 0.625rem;
  }

  .hp-desktop-card__badge--orange { background: #ea580c; }
  .hp-desktop-card__badge--pink { background: #db2777; }
  .hp-desktop-card__badge--blue { background: #2563eb; }
  .hp-desktop-card__badge--green { background: #16a34a; }
  .hp-desktop-card__badge--purple { background: #7c3aed; }
  .hp-desktop-card__badge--indigo { background: #4f46e5; }
  .hp-desktop-card__badge--teal { background: #0d9488; }
  .hp-desktop-card__badge--red { background: #dc2626; }
  .hp-desktop-card__badge--amber { background: #d97706; }
  .hp-desktop-card__badge--brown { background: #92400e; }
  .hp-desktop-card__badge--slate { background: #475569; }

  .hp-desktop-card__discount {
    display: inline-block;
    width: max-content;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ff1744, #e11d48);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.625rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: left;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
    white-space: normal;
    word-break: break-word;
  }

  .hp-desktop-card__body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 1 auto;
  }

  .hp-desktop-card__title {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-desktop-card__desc {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-desktop-card__foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 2px;
  }

  .hp-desktop-card__meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #64748b;
  }

  .hp-desktop-card__loc,
  .hp-desktop-card__rating,
  .hp-desktop-card__offer-meta,
  .hp-desktop-card__study-meta {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-desktop-card__loc i,
  .hp-desktop-card__rating i,
  .hp-desktop-card__offer-meta i {
    display: inline;
    margin-right: 4px;
  }

  .hp-desktop-card__stats span {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-desktop-card__loc i { color: #dc2626; }
  .hp-desktop-card__rating i { color: #eab308; }
  .hp-desktop-card__offer-meta i { color: #dc2626; }

  .hp-desktop-card__stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #64748b;
  }

  .hp-desktop-card__action {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hp-desktop-card__action--orange { background: #ffedd5; color: #c2410c; }
  .hp-desktop-card__action--pink { background: #fce7f3; color: #be185d; }
  .hp-desktop-card__action--blue { background: #dbeafe; color: #1d4ed8; }
  .hp-desktop-card__action--green { background: #dcfce7; color: #15803d; }
  .hp-desktop-card__action--purple { background: #ede9fe; color: #6d28d9; }
  .hp-desktop-card__action--indigo { background: #e0e7ff; color: #4338ca; }
  .hp-desktop-card__action--teal { background: #ccfbf1; color: #0f766e; }
  .hp-desktop-card__action--red { background: #fee2e2; color: #b91c1c; }
  .hp-desktop-card__action--amber { background: #fef3c7; color: #b45309; }
  .hp-desktop-card__action--brown { background: #fef3c7; color: #92400e; }
  .hp-desktop-card__action--slate { background: #f1f5f9; color: #475569; }
}

@media (min-width: 1200px) {
  .homepage-desktop-panels {
    padding-left: 48px;
    padding-right: 48px;
    gap: 24px 28px;
  }

  .hp-desktop__title {
    font-size: 1.5rem;
  }

  .hp-desktop__carousel {
    --carousel-gap: 14px;
  }

  .hp-desktop--community .hp-desktop__carousel.card-carousel[data-carousel-cols="3"] {
    --carousel-visible: 5;
  }
}

@media (min-width: 1400px) {
  .hp-desktop--community .hp-desktop__carousel.card-carousel[data-carousel-cols="3"] {
    --carousel-visible: 6;
  }
}
