/* =========================================================
   UniDash - Popular Restaurants Block
   File: assets/css/popular-restaurants.css
   ========================================================= */

.ud-pr-section {
  padding-top: 16px;
  padding-bottom: 10px;
}

/* ================= HEADER ================= */

.ud-pr-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.ud-pr-title {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  color: #111;
}

.ud-pr-title .ud-pr-highlight {
  color: var(--ud-primary);
  font-weight: 700;
}

.ud-pr-explore {
  background: #14a44d;
  border: 0;
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ud-pr-explore:hover {
  filter: brightness(0.95);
}

/* ================= TOP LOGO STRIP ================= */

.ud-pr-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  margin-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--ud-primary) #ededf4;
}

.ud-pr-strip::-webkit-scrollbar {
  height: 10px;
}

.ud-pr-strip::-webkit-scrollbar-track {
  background: #ededf4;
}

.ud-pr-strip::-webkit-scrollbar-thumb {
  background: var(--ud-primary);
  border-radius: 10px;
  border: 2px solid #ededf4;
}

/* ================= PILLS ================= */

.ud-pr-pill {
  width: 74px;
  flex: 0 0 74px;
  text-align: center;
  cursor: pointer;
}

.ud-pr-pill-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  margin: 0 auto 6px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  overflow: hidden;
}

.ud-pr-pill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ud-pr-pill-name {
  font-size: 12px;
  line-height: 1.1;
  color: #222;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 28px;
}

.ud-pr-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  margin: 6px auto 0;
}

.ud-pr-pill.active .ud-pr-dot {
  background: var(--ud-primary);
}

/* ================= CAROUSEL ================= */

.ud-pr-carousel-wrap {
  position: relative;
  overflow: visible;
}

.ud-pr-carousel {
  position: relative;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 2px 20px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.ud-pr-carousel::-webkit-scrollbar {
  display: none;
}

.ud-pr-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

/* ================= CARD ================= */
/* ✅ keep design; just reduce height (not square) */
.ud-pr-card {
  flex: 0 0 360px;
  height: 280px;                 /* ✅ reduced from 240 */
  background: #f2f2f7;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  position: relative;
  scroll-snap-align: start;
}

.ud-pr-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================= OVERLAY ================= */
/* ✅ fixed size so text never stretches; text clipped cleanly */
.ud-pr-overlay {
  position: absolute;
  left: 16px;
  bottom: 16px;

  width: 310px;                  /* fixed width */
  height: 90px;                  /* fixed height (enough for name + 3 lines) */
  box-sizing: border-box;

  background: rgba(60, 45, 30, 0.78);
  color: #fff;
  padding: 12px;
  border-radius: 4px;
  display: flex;
  gap: 10px;
  align-items: flex-start;        /* ✅ stack text from top */
  overflow: hidden;              /* ✅ clip */
}

.ud-pr-mini-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  margin-top: 2px;
}

.ud-pr-mini-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= TEXT BLOCK ================= */

.ud-pr-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.ud-pr-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ✅ force EXACT 3 visible lines from your <br> output
   - we can't clamp <br> reliably, so we give a fixed height for 3 lines
   - overflow hidden ensures extra gets clipped
*/
.ud-pr-sub {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.92;

  line-height: 1.12;             /* tight */
  max-height: calc(1.12em * 3);  /* ✅ exactly 3 lines */
  overflow: hidden;
}

/* kill big <br> spacing (your earlier issue) */
.ud-pr-sub br {
  display: block;
  content: "";
  margin: 0;                     /* ✅ tight line gap */
}

/* ================= OFFER ================= */

.ud-pr-offer {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 8px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ud-pr-offer-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #00d084;
  box-shadow: 0 0 0 2px rgba(0, 208, 132, 0.25);
}

/* ================= ARROW ================= */

.ud-pr-arrow img {
  width: 50px;
  height: 50px;
  display: block;
}

/* ================= PAGER ================= */

.ud-pr-pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.ud-pr-pager span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #cfcfe6;
}

.ud-pr-pager span.active {
  background: var(--ud-primary);
  width: 18px;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 991px) {
  .ud-pr-title {
    font-size: 22px;
  }

  .ud-pr-card {
    flex-basis: 300px;
    height: 280px;               /* ✅ reduced for smaller cards */
  }

  .ud-pr-overlay {
    width: 260px;
    height: 88px;
  }
}
