/* =====================================================================
   Tour-Finder-Widget — Styling
   Prefix: .tfw (Tour Finder Widget)
   Farben: warmes Travertin/Anthrazit-Schema (Rom-Stein), Gold-Akzent
   ===================================================================== */

/* =====================================================================
   FARBSCHEMA B: Pompejanisches Rot & Sandstein
   ===================================================================== */
:root {
  --tfw-c-bg:        #faf6ee;     /* Sandstein-Cream */
  --tfw-c-card:      #ffffff;
  --tfw-c-ink:       #1f2024;
  --tfw-c-mute:      #6b6f78;
  --tfw-c-line:      #ebe4d6;
  --tfw-c-primary:   #8b2c1c;     /* Pompejanisches Rot */
  --tfw-c-primary-dk:#6e2316;
  --tfw-c-accent:    #e07c1e;     /* Terrakotta-Orange (CTA) */
  --tfw-c-accent-dk: #b96313;
  --tfw-c-cta:       var(--tfw-c-accent);
  --tfw-c-cta-hover: var(--tfw-c-accent-dk);
  --tfw-c-top-bg:    #fff4e8;
  --tfw-c-top-line:  var(--tfw-c-accent);
  --tfw-radius:      10px;
  --tfw-shadow:      0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --tfw-shadow-top:  0 2px 6px rgba(224,124,30,.18), 0 8px 24px rgba(0,0,0,.08);
}

.tfw {
  background: var(--tfw-c-bg);
  border-radius: var(--tfw-radius);
  padding: clamp(16px, 3vw, 28px);
  color: var(--tfw-c-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 100%;
  box-sizing: border-box;
}

.tfw *, .tfw *::before, .tfw *::after { box-sizing: border-box; }

.tfw__header { margin: 0 0 20px; }
.tfw__h2  { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin: 0 0 6px; font-weight: 600; line-height: 1.25; color: var(--tfw-c-ink); }
.tfw__sub { margin: 0 0 10px; color: var(--tfw-c-mute); font-size: .95rem; }
.tfw__hint-inline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 8px 12px;
  background: #f0f7ed;
  border-left: 3px solid #2d7a4f;
  border-radius: 6px;
  font-size: .9rem;
  color: #205a37;
  line-height: 1.4;
}
.tfw__hint-icon {
  flex-shrink: 0;
  color: #2d7a4f;
  font-weight: 700;
  font-size: 1rem;
}

/* ---------------- Form ---------------- */
.tfw__form { display: flex; flex-direction: column; gap: 14px; }

.tfw__tabs-wrap { border: 0; padding: 0; margin: 0; }
.tfw__tabs-label {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: var(--tfw-c-ink);
  margin: 0 0 10px;
  padding: 0;
}

.tfw__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
@media (max-width: 560px) {
  .tfw__tabs { grid-template-columns: 1fr; gap: 8px; }
}
.tfw__tab {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: var(--tfw-c-card);
  border: 2px solid var(--tfw-c-line);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  color: var(--tfw-c-ink);
  font-family: inherit;
  min-height: 64px;
}
.tfw__tab-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--tfw-c-ink);
}
.tfw__tab-sub {
  font-size: .82rem;
  color: var(--tfw-c-mute);
  line-height: 1.3;
}
.tfw__tab:hover {
  border-color: var(--tfw-c-primary);
  transform: translateY(-1px);
}
.tfw__tab--active {
  background: var(--tfw-c-primary);
  border-color: var(--tfw-c-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139,44,28,.25);
}
.tfw__tab--active .tfw__tab-title { color: #fff; }
.tfw__tab--active .tfw__tab-sub { color: rgba(255,255,255,.85); }

.tfw__checkbox {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: .92rem;
  color: var(--tfw-c-ink);
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
}
.tfw__checkbox input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--tfw-c-primary);
  cursor: pointer;
}
.tfw__checkbox-meta {
  color: var(--tfw-c-mute);
  font-size: .85rem;
  font-weight: 400;
}

.tfw__notice {
  margin: 18px 0 0;
  padding: 16px 18px;
  background: #fff4e8;
  border: 1px solid var(--tfw-c-accent);
  border-left-width: 4px;
  border-radius: 8px;
}
.tfw__notice-title {
  font-weight: 700;
  color: var(--tfw-c-primary-dk);
  font-size: 1.02rem;
  margin-bottom: 6px;
}
.tfw__notice-sub {
  margin: 0 0 12px;
  color: var(--tfw-c-ink);
  font-size: .94rem;
  line-height: 1.5;
}
.tfw__notice-cta {
  display: inline-block;
  padding: 10px 18px;
  background: var(--tfw-c-accent);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s;
}
.tfw__notice-cta:hover { background: var(--tfw-c-accent-dk); }

.tfw__inputs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 600px) { .tfw__inputs { grid-template-columns: 1fr; } }

.tfw__label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tfw__label-text { font-size: .85rem; color: var(--tfw-c-mute); font-weight: 500; }
.tfw__input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--tfw-c-line);
  border-radius: 8px;
  background: var(--tfw-c-card);
  font-size: 1rem;
  color: var(--tfw-c-ink);
  font-family: inherit;
  line-height: 1.25;
  min-height: 44px;
}
.tfw__input:focus { outline: 2px solid var(--tfw-c-accent); outline-offset: 1px; border-color: var(--tfw-c-accent); }

/* Select: Safari-Default-Pfeil entfernen, eigenen Pfeil als Background-SVG einsetzen */
select.tfw__input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%236b6f78' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

/* Date-Input: Kalendersymbol immer sichtbar (Safari versteckt es teils) */
input[type="date"].tfw__input {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6f78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
input[type="date"].tfw__input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  opacity: 0;
}
input[type="date"].tfw__input::-webkit-date-and-time-value { text-align: left; }
.tfw__label:has(input[type="date"]) { position: relative; }

.tfw__cta {
  padding: 12px 22px;
  background: var(--tfw-c-cta);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.tfw__cta:hover { background: var(--tfw-c-cta-hover); }

/* ---------------- Status / Hinweise ---------------- */
.tfw__status {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .95rem;
  color: var(--tfw-c-ink);
}
.tfw__status--loading { background: #f0ebe1; color: var(--tfw-c-mute); }
.tfw__status--empty   { background: #fff4e0; color: #8b6508; border: 1px solid #f0d590; }
.tfw__status--error   { background: #fce8e8; color: #8b1a1a; border: 1px solid #f0b0b0; }

.tfw__hint {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: #f5f1e8;
  border-left: 3px solid var(--tfw-c-accent);
  border-radius: 4px;
  font-size: .92rem;
  color: var(--tfw-c-ink);
}

/* ---------------- Ergebnisse ---------------- */
.tfw__results { margin-top: 20px; }
.tfw__results:empty { display: none; }

.tfw__weitere {
  margin: 28px 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tfw-c-ink);
}

.tfw__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .tfw__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tfw__grid { grid-template-columns: 1fr; } }

/* ---------------- Karte ---------------- */
.tfw__card {
  background: var(--tfw-c-card);
  border: 1px solid var(--tfw-c-line);
  border-radius: var(--tfw-radius);
  box-shadow: var(--tfw-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--tfw-c-ink);
}

.tfw__card--top {
  border: 2px solid var(--tfw-c-top-line);
  background: var(--tfw-c-top-bg);
  box-shadow: var(--tfw-shadow-top);
  flex-direction: row;
}
@media (max-width: 700px) {
  .tfw__card--top { flex-direction: column; }
}

.tfw__img-wrap {
  flex: 0 0 auto;
  overflow: hidden;
  background: #eee;
}
.tfw__card .tfw__img-wrap     { aspect-ratio: 16/10; }
.tfw__card--top .tfw__img-wrap {
  width: 42%;
  aspect-ratio: auto;
  align-self: stretch;
  min-height: 220px;
}
@media (max-width: 700px) {
  .tfw__card--top .tfw__img-wrap { width: 100%; aspect-ratio: 16/10; min-height: 0; }
}
.tfw__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tfw__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  color: var(--tfw-c-ink);
}
.tfw__card--top .tfw__body { padding: 20px 22px 22px; }

.tfw__top-badge {
  align-self: flex-start;
  padding: 4px 10px;
  background: var(--tfw-c-primary);
  color: #fff;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.tfw__title {
  font-size: 1.02rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--tfw-c-ink);
}
.tfw__card--top .tfw__title { font-size: 1.2rem; }

.tfw__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: .85rem;
  color: var(--tfw-c-mute);
}
.tfw__lang { display: inline-flex; gap: 4px; align-items: center; }
.tfw__badge {
  padding: 2px 8px;
  background: #e7eef5;
  color: #2b4a6b;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 500;
}

.tfw__rating-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: .92rem;
}
.tfw__rating  { color: var(--tfw-c-primary); font-weight: 600; }
.tfw__reviews { color: var(--tfw-c-mute); font-size: .85rem; }

.tfw__price-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-top: 4px;
}
.tfw__price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--tfw-c-ink);
}
.tfw__card--top .tfw__price { font-size: 1.6rem; }
.tfw__price-meta { color: var(--tfw-c-mute); font-size: .85rem; }
.tfw__price-total { font-size: .92rem; color: var(--tfw-c-mute); margin-top: -4px; }

.tfw__book {
  display: inline-block;
  margin-top: auto;
  padding: 11px 18px;
  background: var(--tfw-c-cta);
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  font-size: .95rem;
  transition: background .15s;
}
.tfw__book:hover { background: var(--tfw-c-cta-hover); }
.tfw__card--top .tfw__book {
  background: var(--tfw-c-accent);
  font-size: 1rem;
  padding: 13px 22px;
}
.tfw__card--top .tfw__book:hover { background: var(--tfw-c-accent-dk); }
