/* ================================================================
   Tour Manager – Frontend Styles
   ================================================================ */

/* Scoped box-sizing reset to avoid conflicts with the theme */
.tm-single-tour *,
.tm-tour-list *,
.tm-booking-widget * {
  box-sizing: border-box;
}

/* ── Variables ────────────────────────────────────────────────── */
:root {
  --tm-primary: #F7D800;
  --tm-primary-lt: #FFEC68;
  --tm-accent: #e8a020;
  --tm-bg: #f8f9fa;
  --tm-white: #ffffff;
  --tm-border: #e0e4e8;
  --tm-text: #272727;
  --tm-muted: #718096;
  --tm-success: #38a169;
  --tm-danger: #e53e3e;
  --tm-radius: 10px;
  --tm-shadow: 0 2px 16px rgba(0, 0, 0, .08);
}

/* ── Tour list / cards ───────────────────────────────────────── */
.tm-tour-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 16px 0;
}

.tm-tour-card {
  background: var(--tm-white);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.tm-tour-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
}

/* Mini slider */
.tm-card-slider {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--tm-border);
}

.tm-card-slides {
  height: 100%;
}

.tm-card-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .4s;
}

.tm-card-slide.active {
  opacity: 1;
}

.tm-card-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tm-no-photo {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8edf2 0%, #d0d8e4 100%);
}

.tm-slide-prev,
.tm-slide-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .4);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 2;
}

.tm-slide-prev {
  left: 8px;
}

.tm-slide-next {
  right: 8px;
}

.tm-slide-prev:hover,
.tm-slide-next:hover {
  background: rgba(0, 0, 0, .65);
}

/* Card body */
.tm-card-body {
  padding: 16px;
}

.tm-card-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
}

.tm-card-title a {
  color: var(--tm-text);
  text-decoration: none;
}

.tm-card-title a:hover {
  color: var(--tm-primary);
}

.tm-card-slogan {
  color: var(--tm-muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.tm-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--tm-muted);
}

.tm-card-vehicle img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.tm-card-duration,
.tm-card-price {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tm-card-price strong {
  color: var(--tm-primary);
  font-size: 15px;
}

/* ── Single tour ─────────────────────────────────────────────── */
.tm-single-tour {
  margin: 0 auto;
}

/* Hero */
.tm-hero {
  margin-bottom: 32px;
  border-radius: var(--tm-radius);
  overflow: hidden;
}

.tm-hero-slider {
  position: relative;
  aspect-ratio: 21/8;
  background: #111;
}

.tm-hero-slides {
  height: 100%;
}

.tm-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s;
}

.tm-hero-slide.active {
  opacity: 1;
}

.tm-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tm-hero-prev,
.tm-hero-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .45);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background .2s;
}

.tm-hero-prev {
  left: 16px;
}

.tm-hero-next {
  right: 16px;
}

.tm-hero-prev:hover,
.tm-hero-next:hover {
  background: rgba(0, 0, 0, .7);
}

.tm-hero-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.tm-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: background .2s;
}

.tm-hero-dot.active {
  background: #fff;
}

/* Layout */
.tm-single-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .tm-single-layout {
    grid-template-columns: 1fr;
  }
}

/* Tour info */
.tm-locality-badge {
  display: inline-block;
  color: var(--tm-text);
  font-size: 18px;
  font-weight: 500;
}

.tm-badge-vehicle {
  display: inline-block;
  color: var(--tm-text);
  font-size: 18px;
  font-weight: 500;
  background: var(--tm-primary);
  padding: 2px 5px;
}

.tm-tour-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--tm-text);
  margin: 0 0 8px;
  line-height: 1.2;
  border-bottom: 1px solid #ECECEC;
}

.single .entry-content p.tm-tour-subtitle {
  font-size: 22px !important;
}

.tm-tour-subtitle {

  color: var(--tm-text);
  margin: 0 0 10px;
  font-weight: 400;
  line-height: 1.4;
  border-bottom: 1px solid #ececec;
}

/* Azioni (Mappa e Condividi) */
.tm-meta-action {
  color: var(--tm-text) !important;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: underline;
}

.tm-meta-action:hover {
  opacity: 0.8;
}

.tm-meta-action i {
  font-size: 1.2rem;
}

.tm-meta-action:hover {
  color: var(--tm-text);
}

/* Reset AddToAny per integrarsi nel testo */
.tm-share-btn .a2a_kit {
  display: inline-flex !important;
  vertical-align: middle;
}

.tm-share-btn .a2a_svg {
  display: none !important;
  /* Nascondiamo l'icona tonda di default di AddToAny */
}

.tm-addtoany-wrapper .a2a_label {
  overflow: visible !important;
  position: relative !important;
  -webkit-clip-path: initial;
  clip-path: initial;
  color: var(--tm-text) !important;
  font-size: 16px;
  border: none !important;
  width: auto !important;
  text-decoration: underline;
}

.tm-addtoany-wrapper .a2a_svg {
  display: none !important;
}

.tm-addtoany-wrapper .a2a_kit {
  line-height: 0 !important;
}

.tm-tour-slogan {
  color: var(--tm-muted);
  font-size: 16px;
  margin: 0 0 20px;
}

.tm-tour-highlights,
.tm-tour-notes {
  margin-bottom: 24px;
}

.tm-tour-highlights h3,
.tm-tour-notes h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--tm-text);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--tm-border);
  font-family: "interstate-compressed", sans-serif;
}

.tm-highlights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tm-highlights-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 15px;
  color: var(--tm-text);
  line-height: 1.5;
}

.tm-highlights-list li::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tm-primary);
  flex-shrink: 0;
  margin-top: 7px;
}

.tm-tour-notes p {
  font-size: 14px;
  color: var(--tm-muted);
  line-height: 1.7;
  margin: 0;
  background: var(--tm-bg);
  border-left: 3px solid var(--tm-border);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
}

.tm-tour-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tm-bg);
  border: 1px solid var(--tm-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--tm-muted);
}

.tm-badge-vehicle img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tm-tour-description {
  line-height: 1.7;
  color: var(--tm-text);
  margin-bottom: 24px;
}

/* Stile per i tag "Per chi ama" */
.tm-tag-pill {
  display: inline-block;
  background: #ececec;
  color: var(--tm-text);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
  width: fit-content;
  font-weight: 300;
}

.tm-maps-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tm-primary);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 20px;
}

.tm-maps-link:hover {
  text-decoration: underline;
}

.tm-tour-video {
  margin-bottom: 24px;
}

.tm-tour-video iframe {
  width: 100%;
  border-radius: var(--tm-radius);
}

.tm-attachments h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.tm-attachments ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tm-attachments li {
  margin-bottom: 6px;
}

.tm-attachments a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tm-primary);
  font-size: 14px;
  text-decoration: none;
}

.tm-attachments a:hover {
  text-decoration: underline;
}

/* ── Booking widget ─────────────────────────────────────────── */
.tm-booking-widget {
  position: sticky;
  top: 24px;
}

.tm-booking-box {
  background: var(--tm-white);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
  overflow: hidden;
  border: 1px solid var(--tm-border);
}

.tm-price-preview {
  background: var(--tm-primary);
  color: #272727;
  padding: 16px 20px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.tm-from {
  font-size: 13px;
  opacity: .8;
}

.tm-price-display {
  font-size: 28px;
  font-weight: 700;
  transition: all .3s;
}

.tm-per-person {
  font-size: 13px;
  opacity: .8;
}

.tm-step {
  padding: 20px;
}

.tm-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--tm-text);
  margin: 0 0 18px;
}

.tm-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tm-primary);
  color: #272727;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Field groups */
.tm-field-group {
  margin-bottom: 14px;
}

.tm-label {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--tm-text);
  margin-bottom: 6px;
}

.tm-input,
.tm-select,
.tm-textarea {
  width: 100%;
  border: 1.5px solid var(--tm-border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--tm-text);
  background: var(--tm-white);
  transition: border-color .2s;
  font-family: inherit;
}

.tm-input:focus,
.tm-select:focus,
.tm-textarea:focus {
  outline: none;
  border-color: var(--tm-primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, .1);
}

.tm-textarea {
  resize: vertical;
}

/* Toggle group */
.tm-toggle-group {
  display: flex;
  gap: 8px;
}

.tm-toggle-btn {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 7px;
  background: #F3F4F6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #272727;
  transition: all .2s;
}

.tm-toggle-btn.active {
  border-color: var(--tm-primary);
  background: var(--tm-primary);
  color: #272727;
}

/* Pax picker */
.tm-pax-picker {
  border: 1.5px solid var(--tm-border);
  border-radius: 7px;
  overflow: hidden;
}

.tm-pax-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--tm-border);
}

.tm-pax-row:last-child {
  border-bottom: none;
}

.tm-pax-info strong {
  display: block;
  font-size: 14px;
  color: var(--tm-text);
}

.tm-pax-info small {
  font-size: 12px;
  color: var(--tm-muted);
}

.tm-pax-counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-pax-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--tm-border);
  border-radius: 50%;
  background: var(--tm-white);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tm-text);
  font-weight: 600;
  transition: all .15s;
}

.tm-pax-btn:hover {
  background: var(--tm-primary);
  color: var(--tm-text);
  border-color: var(--tm-primary);
}

.tm-pax-btn:disabled {
  opacity: .4;
  cursor: default;
}

.tm-pax-input {
  width: 40px;
  text-align: center;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--tm-text);
  background: transparent;
  pointer-events: none;
}

/* Price breakdown */
.tm-price-breakdown {
  background: var(--tm-bg);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.tm-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--tm-muted);
}

.tm-breakdown-total {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--tm-border);
  font-size: 15px;
  color: var(--tm-text);
}

/* ── Calendar ───────────────────────────────────────────────── */
.tm-calendar-wrapper {
  border: 1.5px solid var(--tm-border);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tm-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--tm-primary);
  color: var(--tm-text);
}

.tm-calendar-header button {
  background: none;
  border: none;
  color: var(--tm-text);
  font-size: 20px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}

#tm-cal-month-label {
  font-weight: 600;
  font-size: 15px;
}

.tm-calendar-grid {
  padding: 8px;
}

.tm-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--tm-muted);
  text-transform: uppercase;
  padding: 4px 0 6px;
}

.tm-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.tm-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  cursor: default;
  transition: all .15s;
}

.tm-cal-day.empty {
  visibility: hidden;
}

.tm-cal-day.past {
  color: var(--tm-border);
}

.tm-cal-day.available {
  color: var(--tm-text);
  font-weight: 600;
  cursor: pointer;
  background: #f8f9fa;
}

.tm-cal-day.available:hover {
  background: var(--tm-primary);
  color: #272727;
}

.tm-cal-day.selected {
  background: var(--tm-primary) !important;
  color: #272727 !important;
}

.tm-cal-day.today {
  border: 2px solid var(--tm-text);
}

.tm-cal-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--tm-muted);
  border-top: 1px solid var(--tm-border);
}

.tm-cal-avail-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #e8f0fe;
  border: 1px solid #bcd0f7;
}

/* Time slots */
.tm-time-slots-wrapper {
  margin-bottom: 14px;
}

.tm-time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tm-time-slot {
  padding: 6px 14px;
  border: 1.5px solid var(--tm-border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--tm-text);
  background: var(--tm-white);
  transition: all .15s;
}

.tm-time-slot:hover {
  border-color: var(--tm-primary);
  background: #e8f0fe;
}

.tm-time-slot.selected {
  background: var(--tm-primary);
  color: var(--tm-text);
  border-color: var(--tm-primary);
}

/* Form rows */
.tm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  /* Prevent children from overflowing the grid */
  min-width: 0;
}

.tm-form-row .tm-field-group {
  min-width: 0;
  /* critical: allows grid children to shrink below content size */
}

.tm-form-row .tm-input,
.tm-form-row .tm-select {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

@media (max-width: 480px) {
  .tm-form-row {
    grid-template-columns: 1fr;
  }
}

/* Coupon */
.tm-coupon-input-wrap {
  display: flex;
  gap: 8px;
}

.tm-coupon-input-wrap .tm-input {
  flex: 1;
}

/* Total bar */
.tm-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--tm-bg);
  border-radius: 7px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 15px;
  color: var(--tm-text);
}

.tm-total-bar strong {
  font-size: 20px;
  color: var(--tm-text);
}

/* Booking summary */
.tm-booking-summary {
  background: var(--tm-bg);
  border-radius: 7px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

.tm-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--tm-muted);
}

.tm-summary-row strong {
  color: var(--tm-text);
}

/* Payment methods */
.tm-method-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 16px;
}

.tm-method-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 2px solid var(--tm-border);
  border-radius: 7px;
  background: var(--tm-white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--tm-muted);
  transition: all .2s;
}

.tm-method-tab.active {
  border-color: var(--tm-primary);
  color: var(--tm-primary);
  background: #e8f0fe;
}

/* Payment panels: hidden by default, shown via JS .show() or .active class */
.tm-payment-panel {
  display: none;
}

.tm-payment-panel.active,
.tm-payment-panel[style*="display: block"],
.tm-payment-panel[style*="display:block"] {
  display: block;
}

/* Back link (step 4) */
.tm-back-link {
  font-size: 12px;
  color: var(--tm-text) !important;
  text-decoration: none;
  opacity: .7;
  transition: opacity .2s;
}

.tm-back-link:hover {
  opacity: 1;
  color: var(--tm-primary);
  text-decoration: underline;
}

/* Stripe element */
.tm-stripe-card-element {
  border: 1.5px solid var(--tm-border);
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 12px;
  min-height: 42px;
}

/* Buttons */
.tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
  font-family: inherit;
}

.tm-btn-primary {
  background: var(--tm-primary);
  color: var(--tm-text);
  border-color: var(--tm-primary);
}

.tm-btn-primary:hover {
  background: var(--tm-primary-lt);
  border-color: var(--tm-primary-lt);
}

.tm-btn-primary:disabled {
  opacity: .5;
  cursor: default;
}

.tm-btn-secondary {
  background: var(--tm-white);
  color: var(--tm-text);
  border-color: var(--tm-text);
}

.tm-btn-secondary:hover {
  border-color: var(--tm-primary);
  background: var(--tm-primary);
}

.tm-btn-full {
  width: 100%;
}

.tm-btn-flex {
  flex: 1;
}

.tm-btn-pay {
  font-size: 15px;
  padding: 13px 20px;
  margin-top: 4px;
}

/* Messages */
.tm-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 6px;
  color: var(--tm-danger);
  padding: 8px 12px;
  font-size: 13px;
  margin: 8px 0;
}

.tm-msg {
  font-size: 13px;
  padding: 6px 0;
}

.tm-msg.success {
  color: var(--tm-success);
}

.tm-msg.error {
  color: var(--tm-danger);
}

/* Steps progress */
.tm-steps-progress {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--tm-border);
  background: var(--tm-bg);
}

.tm-progress-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tm-border);
  color: var(--tm-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  flex-shrink: 0;
}

.tm-progress-step.active {
  background: var(--tm-primary);
  color: var(--tm-text);
}

.tm-progress-step.completed {
  background: #ffc107;
  ;
  color: var(--tm-text);
}

.tm-progress-line {
  flex: 1;
  height: 2px;
  background: var(--tm-border);
  margin: 0 4px;
}

/* Success */
.tm-success-box {
  text-align: center;
  padding: 24px 16px;
}

.tm-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tm-success);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.tm-success-box h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--tm-text);
}

.tm-success-box p {
  color: var(--tm-muted);
  font-size: 14px;
  margin: 0 0 6px;
}

/* Container della griglia */
.tm-gallery-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  /* Proporzione tra foto grande e piccola */
  grid-template-rows: 220px 220px;
  gap: 15px;
  margin-bottom: 30px;
}

.tm-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  /* Bordi arrotondati come da screenshot */
}

.tm-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.4s ease;
}

.tm-gallery-item:hover img {
  transform: scale(1.05);
}

/* La prima immagine occupa entrambe le righe a sinistra */
.tm-gallery-item.item-0 {
  grid-row: span 2;
}

/* Badge "Tutte le foto" in basso a destra */
.tm-gallery-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  text-transform: uppercase;
}

/* Responsive per Tablet e Mobile */
@media (max-width: 768px) {
  .tm-gallery-container {
    grid-template-columns: 1fr;
    grid-template-rows: 350px 200px 200px;
  }

  .tm-gallery-item.item-0 {
    grid-row: span 1;
  }
}

/* Griglia Desktop - Manteniamo il tuo stile precedente */
@media (min-width: 768px) {
  .tm-gallery-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: 220px 220px;
    gap: 15px;
  }

  .tm-gallery-item.item-0 {
    grid-row: span 2;
  }

  .tm-gallery-item {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
  }

  .tm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* Slider Mobile - Ripristino stile precedente */
@media (max-width: 767.98px) {
  .tm-hero-slider {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    aspect-ratio: 4 / 2.4;
  }

  .tm-hero-slide {
    display: none;
  }

  .tm-hero-slide.active {
    display: block;
    height: 300px;
  }

  .tm-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/*Mobile booking widget*/
/* --- MOBILE STYLING (Airbnb Style) --- */
@media (max-width: 767px) {

  /* Nascondiamo il widget normale dal flusso della pagina */
  .tm-booking-widget {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
  }

  /* Classe per mostrare il widget come modal */
  .tm-booking-widget.is-open {
    display: block;
    animation: slideUp 0.3s ease-out;
  }

  /* Sticky bar in basso */
  .tm-mobile-booking-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 12px 20px;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
  }

  .tm-mobile-bar-content {
    display: flex;
    justify-content: space-between;
    /* Mantiene il prezzo a sinistra e il resto a destra */
    align-items: center;
    gap: 20px;
    /* Aggiunge uno spazio tra prezzo e bottone */
  }

  .tm-mobile-price {
    flex-shrink: 0;
    /* Impedisce al prezzo di restringersi se il testo è lungo */
  }

  .tm-mobile-price .tm-price-val {
    display: block;
    font-weight: 800;
    font-size: 1.2rem;
  }

  .tm-mobile-price .tm-price-label {
    font-size: 0.8rem;
    color: #666;
  }

  /* Aggiungiamo un tasto "chiudi" nel widget quando è aperto su mobile */
  .tm-booking-widget::before {
    content: '✕';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
  }

  #tm-trigger-mobile-modal {
    flex-grow: 1;
    /* Forza il bottone a occupare tutto lo spazio disponibile */
    text-align: center;
    justify-content: center;
    display: flex;
    /* Se vuoi centrare perfettamente il testo internamente */
    max-width: 100%;
    /* Sicurezza per evitare overflow */
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* --- DESKTOP STYLING --- */
@media (min-width: 768px) {
  .tm-mobile-booking-bar {
    display: none !important;
  }
}

.tm-info-list li {
  padding: 5px 0;
}

.tm-notice-min-people {
    background: #fcf5eb;
    padding: 10px !important;
    margin: 10px 0;
    border-radius: 15px;
}
/*Carosello Tour - markup/comportamento identico a quello stampato da [tour_carousel] nel tema,
  che però conta su CSS stampato inline solo dallo shortcode [overflow_carousel]. Qui replichiamo
  le regole generiche (overflow/bleed, controlli, progress bar) cosi' il carosello in tour-single.php
  si comporta come quello del tema veloservice anche senza quell'altro shortcode in pagina. */
.position-relative-lg {
  position: relative;
}

/* Bootstrap applica .overflow-hidden con !important a ogni breakpoint (qui non sono disponibili
   le utility responsive overflow-lg-*). Lo neutralizziamo solo da desktop per ottenere il bleed,
   lasciando il clip su mobile dove l'effetto non serve. */
@media (min-width: 992px) {
  .tm-popular-tours-wrapper .overflow-carousel-section.overflow-hidden {
    overflow: visible !important;
  }
}

@media (min-width: 1200px) {
  .overflow-carousel-section {
    margin-left: -25px;
  }

  .description-carousel .row {
    margin-left: 0;
  }
}

.overflow-carousel .slick-list {
  overflow: visible;
  margin: 0 -10px;
}

.overflow-carousel .overflow-slide {
  padding: 0;
}

.slick-progress {
  height: 5px;
  background-color: #eee;
  width: 100vw;
  overflow: hidden;
  position: relative;
  left: 5px;
}

.slick-progress .progress-bar-inner {
  height: 5px;
  background-color: #dedede;
  width: 0;
  transition: width 0.5s ease;
}

.overflow-controls button,
.hero-controls button {
  width: 38px;
  height: 38px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 100% !important;
  transition: all 0.3s ease;
}

.overflow-controls i,
.hero-controls i {
  font-size: 20px;
}

.overflow-controls button:disabled,
.hero-controls button:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed;
  border-color: #ccc;
  background-color: #f8f8f8;
  color: #272727;
}

.overflow-controls button:disabled i,
.hero-controls button:disabled i {
  color: #272727;
}

.carosello-tour .overflow-controls button, .carosello-tour .hero-controls button {
    background: #F7D800 !important;
    color: #32323C !important;
}
/* ── Nexi: nota nel pannello di pagamento ──────────────────────── */
.tm-nexi-note {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
}

/* ── Nexi: box esito al ritorno dal gateway ────────────────────── */
.tm-nexi-result {
  padding: 16px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.tm-nexi-msg {
  margin: 0;
  font-weight: 600;
  line-height: 1.5;
}

.tm-nexi-ref {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  opacity: 0.8;
}

.tm-nexi-ok {
  background: #f0f9f4;
  border-color: #86c9a4;
  color: #1d6b40;
}

.tm-nexi-ko {
  background: #fdf2f2;
  border-color: #e0a2a2;
  color: #8b2c2c;
}

.tm-nexi-cancelled {
  background: #fbf7ed;
  border-color: #ddc78a;
  color: #7a5c1e;
}

/* Stato neutro finché la notifica S2S non è confermata */
.tm-nexi-result.tm-nexi-checking {
  background: #f5f5f5;
  border-color: #d4d4d4;
  color: #555;
}

/* ── Nexi: schermata di verifica pagamento ─────────────────────── */
.tm-verifying-box {
  text-align: center;
  padding: 32px 20px;
}

.tm-verifying-box p {
  margin: 16px 0 0;
  color: #555;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.tm-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto;
  border: 3px solid #e5e5e5;
  border-top-color: #999;
  border-radius: 50%;
  animation: tm-spin 0.8s linear infinite;
}

@keyframes tm-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tm-spinner { animation-duration: 2s; }
}

.tm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.tm-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.tm-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.tm-modal-close:hover { color: #333; }
.tm-modal-icon { font-size: 42px; margin-bottom: 8px; }
.tm-modal-icon.ok { color: #2e7d32; }
.tm-modal-icon.ko { color: #c62828; }
.tm-modal-icon.pending { color: #ef6c00; }