/* =========================================================
   KKF Places Grid
   Version: 1.0.0
   Loads after kkf-trip-basket.css and reuses its tokens.
   ========================================================= */

.kkf-places {
  --pg-sun: var(--kkf-sun, #f0522b);
  --pg-mango: var(--kkf-mango, #f7941d);
  --pg-ink: var(--kkf-ink, #17211f);
  --pg-soft: var(--kkf-ink-soft, #5f6f6a);
  --pg-line: var(--kkf-line, #ecdfd3);
  --pg-sand: var(--kkf-sand, #fbf6f0);
  --pg-teal: var(--kkf-teal, #0e6e63);
  --pg-ease: 0.22s cubic-bezier(0.32, 0.72, 0.35, 1);

  max-width: 1280px;
  margin: 0 auto;
  font-family: var(--kkf-font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  color: var(--pg-ink);
}

.kkf-places *,
.kkf-places *::before,
.kkf-places *::after {
  box-sizing: border-box;
}

/* =========================================================
   Sticky bar: search + filters
   ========================================================= */

.kkf-places-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 0 12px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pg-line);
}

.kkf-places-search {
  position: relative;
  margin-bottom: 12px;
}

#kkfPlacesSearch {
  width: 100%;
  min-height: 56px;
  padding: 15px 52px 15px 52px;
  border: 1.5px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-sand)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6f6a' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.6'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E")
    19px center / 20px 20px no-repeat;
  font-family: inherit;
  font-size: 16px;
  color: var(--pg-ink);
  appearance: none;
  transition: border-color var(--pg-ease), background-color var(--pg-ease),
    box-shadow var(--pg-ease);
}

#kkfPlacesSearch::-webkit-search-cancel-button {
  display: none;
}

#kkfPlacesSearch::placeholder {
  color: #9aa8a3;
}

#kkfPlacesSearch:focus {
  outline: none;
  border-color: var(--pg-sun);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(240, 82, 43, 0.14);
}

.kkf-places-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 33, 31, 0.08);
  color: var(--pg-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.kkf-places-clear:hover {
  background: rgba(23, 33, 31, 0.14);
  color: var(--pg-ink);
}

.kkf-places-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* category chips */

.kkf-places-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.kkf-places-chips::-webkit-scrollbar {
  display: none;
}

.kkf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 18px;
  border: 1.5px solid var(--pg-line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--pg-ink);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--pg-ease), background var(--pg-ease),
    color var(--pg-ease), transform var(--pg-ease);
}

.kkf-chip span {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pg-sand);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--pg-soft);
}

.kkf-chip:hover {
  border-color: #f6c9b6;
}

.kkf-chip.is-active {
  border-color: transparent;
  background: linear-gradient(120deg, var(--pg-mango), var(--pg-sun));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(240, 82, 43, 0.9);
}

.kkf-chip.is-active span {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.kkf-places-selects {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.kkf-places-select select {
  min-height: 42px;
  padding: 10px 34px 10px 16px;
  border: 1.5px solid var(--pg-line);
  border-radius: 999px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317211f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    right 13px center / 15px 15px no-repeat;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--pg-ink);
  cursor: pointer;
  appearance: none;
}

.kkf-places-select select:focus {
  outline: none;
  border-color: var(--pg-sun);
}

/* =========================================================
   Heading
   ========================================================= */

.kkf-places-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.kkf-places-head h2 {
  margin: 0;
  font-family: var(--kkf-font-display, "Fraunces", Georgia, serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.kkf-places-count {
  margin: 0;
  color: var(--pg-soft);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* =========================================================
   View basket button + floating basket
   ========================================================= */

.kkf-places-headline {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.kkf-places-basket {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 12px 20px;
  border: 1.5px solid var(--pg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--pg-ink) !important;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--pg-ease), background var(--pg-ease),
    transform var(--pg-ease);
}

.kkf-places-basket::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317211f' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h18l-1.7 11.2a2 2 0 0 1-2 1.8H6.7a2 2 0 0 1-2-1.8z'/%3E%3Cpath d='M8.5 7l3-4M15.5 7l-3-4'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.kkf-places-basket:hover {
  transform: translateY(-2px);
  border-color: var(--pg-sun);
  background: var(--kkf-sun-wash, #fff1ea);
}

.kkf-places-basket-count {
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--pg-mango), var(--pg-sun));
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  text-align: center;
}

.kkf-places-basket-count:empty,
.kkf-places-basket[data-count="0"] .kkf-places-basket-count {
  display: none;
}

/* floating basket, appears once something is in the trip */

.kkf-basket-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--pg-mango), var(--pg-sun));
  color: #fff !important;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 18px 34px -14px rgba(240, 82, 43, 0.95);
  animation: kkf-fab-in 0.3s cubic-bezier(0.32, 0.72, 0.35, 1) both;
  transition: transform var(--pg-ease);
}

.kkf-basket-fab[hidden] {
  display: none;
}

.kkf-basket-fab:hover {
  transform: scale(1.06);
}

.kkf-basket-fab.is-bump {
  animation: kkf-fab-bump 0.45s ease;
}

.kkf-basket-fab::before {
  content: "";
  width: 26px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h18l-1.7 11.2a2 2 0 0 1-2 1.8H6.7a2 2 0 0 1-2-1.8z'/%3E%3Cpath d='M8.5 7l3-4M15.5 7l-3-4'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.kkf-basket-fab-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--pg-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

@keyframes kkf-fab-in {
  from { opacity: 0; transform: scale(0.6) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes kkf-fab-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* =========================================================
   Card grid
   ========================================================= */

.kkf-places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.kkf-places-grid > * {
  height: 100%;
}

.kkf-place-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pg-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(23, 33, 31, 0.05);
  transition: transform var(--pg-ease), box-shadow var(--pg-ease),
    border-color var(--pg-ease);
  animation: kkf-card-in 0.34s ease both;
}

.kkf-place-card:hover {
  transform: translateY(-3px);
  border-color: #f6c9b6;
  box-shadow: 0 22px 44px -24px rgba(23, 33, 31, 0.45);
}

.kkf-place-card.is-flash {
  border-color: var(--pg-sun);
  box-shadow: 0 0 0 3px rgba(240, 82, 43, 0.18);
}

.kkf-place-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--pg-sand);
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 4 / 3) {
  .kkf-place-card-media {
    height: 0;
    padding-bottom: 75%;
  }
}

/*
   Themes commonly set `img { height: auto }`, which beats a plain
   height:100% and leaves the photo floating in a half empty box.
   Pinning the image to all four edges fills the frame whatever the
   theme says, and object-fit crops instead of stretching.
*/
.kkf-place-card-media img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0.35, 1);
}

.kkf-place-card:hover .kkf-place-card-media img {
  transform: scale(1.06);
}

.kkf-place-card-noimage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(140deg, #ffd9a8, #f8a65c);
  color: #fff;
  font-family: var(--kkf-font-display, Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.kkf-place-card-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--pg-ink);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.5);
}

.kkf-place-card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 auto;
  padding: 14px 15px 15px;
}

.kkf-place-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  font-family: var(--kkf-font-display, "Fraunces", Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--pg-ink) !important;
  text-decoration: none;
  transition: color var(--pg-ease);
}

.kkf-place-card-title:hover {
  color: var(--pg-sun) !important;
}

.kkf-place-card-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
  margin: 0;
  color: var(--pg-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.kkf-place-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin-top: auto;
  padding-top: 6px;
}

.kkf-place-card-region {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--pg-teal);
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kkf-place-card-region::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* add button, the round cart control */

/* Stadium shaped cart button, orange outline that fills on hover */
.kkf-place-add {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--pg-sun);
  border-radius: 999px;
  background: #fff;
  color: var(--pg-sun);
  line-height: 0;
  cursor: pointer;
  transition: background var(--pg-ease), color var(--pg-ease),
    border-color var(--pg-ease), transform var(--pg-ease),
    box-shadow var(--pg-ease);
}

.kkf-place-add svg {
  width: 22px;
  height: 22px;
  display: block;
}

.kkf-place-add:hover {
  transform: translateY(-1px);
  border-color: transparent;
  background: linear-gradient(120deg, var(--pg-mango), var(--pg-sun));
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(240, 82, 43, 0.95);
}

.kkf-place-add:active {
  transform: translateY(0) scale(0.96);
}

.kkf-place-add.is-added,
.kkf-place-add:disabled {
  border-color: var(--pg-teal);
  background: var(--kkf-teal-wash, #eaf5f3);
  color: var(--pg-teal);
  box-shadow: none;
  transform: none;
  cursor: default;
}

.kkf-place-add.is-added svg,
.kkf-place-add:disabled svg {
  width: 18px;
  height: 18px;
}

/* =========================================================
   Skeletons, empty state, pagination
   ========================================================= */

.kkf-place-skeleton {
  animation: none;
  border-color: var(--pg-line);
  box-shadow: none;
  pointer-events: none;
}

.kkf-place-skeleton .kkf-place-card-media,
.kkf-skeleton-line {
  background: linear-gradient(
    100deg,
    var(--pg-sand) 30%,
    #f2e9df 50%,
    var(--pg-sand) 70%
  );
  background-size: 220% 100%;
  animation: kkf-shimmer 1.3s linear infinite;
}

.kkf-skeleton-line {
  display: block;
  height: 12px;
  border-radius: 6px;
}

.kkf-skeleton-line.is-short {
  width: 60%;
}

.kkf-places-empty {
  grid-column: 1 / -1;
  padding: 54px 24px;
  border: 1.5px dashed var(--pg-line);
  border-radius: 22px;
  background: var(--pg-sand);
  text-align: center;
}

.kkf-places-empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--kkf-font-display, Georgia, serif);
  font-size: 20px;
  font-weight: 600;
}

.kkf-places-empty p {
  margin: 0 0 18px;
  color: var(--pg-soft);
  font-size: 14.5px;
}

.kkf-places-more {
  margin-top: 28px;
  text-align: center;
}

.kkf-places-more-btn {
  min-height: 52px;
  padding: 14px 34px;
  border: 1.5px solid var(--pg-line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--pg-ink);
  cursor: pointer;
  transition: border-color var(--pg-ease), background var(--pg-ease),
    transform var(--pg-ease);
}

.kkf-places-more-btn:hover {
  transform: translateY(-2px);
  border-color: var(--pg-sun);
  background: var(--kkf-sun-wash, #fff1ea);
  color: var(--kkf-sun-deep, #c33b16);
}

.kkf-places-end {
  color: var(--pg-soft);
  font-size: 13.5px;
}

@keyframes kkf-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes kkf-shimmer {
  from { background-position: 130% 0; }
  to { background-position: -30% 0; }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .kkf-places-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .kkf-places-selects {
    justify-content: space-between;
  }

  .kkf-places-select {
    flex: 1 1 0;
  }

  .kkf-places-select select {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .kkf-places-head {
    flex-wrap: wrap;
  }

  .kkf-places-headline {
    width: 100%;
    justify-content: space-between;
  }

  .kkf-places-basket {
    min-height: 42px;
    padding: 10px 16px;
    font-size: 13.5px;
  }

  .kkf-basket-fab {
    right: 14px;
    bottom: 14px;
    width: 66px;
    height: 66px;
    font-size: 10.5px;
  }

  .kkf-places-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .kkf-place-card {
    border-radius: 16px;
  }

  .kkf-place-card-body {
    padding: 11px 12px 12px;
    gap: 5px;
  }

  .kkf-place-card-title {
    font-size: 15px;
  }

  .kkf-place-card-text {
    font-size: 12.5px;
    -webkit-line-clamp: 2;
  }

  .kkf-place-add {
    width: 52px;
    height: 36px;
  }

  .kkf-place-add svg {
    width: 20px;
    height: 20px;
  }

  #kkfPlacesSearch {
    min-height: 50px;
    font-size: 15px;
  }

  .kkf-places-head h2 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kkf-places * {
    animation: none !important;
    transition: none !important;
  }
}