/* =========================================================
   WP RENTAL TOOLS – CLEAN CSS (bez ponavljanja/konflikta)
   ========================================================= */

/* ---------- Base / Cards grid ---------- */
.wprt-category { width: 100%; box-sizing: border-box; }

.wprt-alat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.wprt-alat-item {
  width: calc(33.333% - 10.666px);
  cursor: pointer;
}

.wprt-alat-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.wprt-alat-card .wprt-thumb img {
  max-width: 100px;
  height: auto;
  display: block;
  border-radius: 6px;
}

.wprt-alat-card .wprt-info h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

/* Display wrapper */
.wprt-display{
  margin-top: 20px;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ---------- Prices table ---------- */
.wprt-prices-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.wprt-prices-table th,
.wprt-prices-table td {
  border: 1px solid #eee;
  padding: 8px;
  text-align: left;
}

.wprt-prices-table th {
  background: #fafafa;
}

.wprt-prices-table-wrap{
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ---------- Booking layout (fallback) ---------- */
.wprt-booking-row{
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 1024px){
  .wprt-booking-row{ grid-template-columns: 1fr; }
}

/* ---------- Calendar ---------- */
.wprt-calendar-col{
  width: 100%;
}

.wprt-calendar-col .flatpickr-calendar.inline{
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-shadow: none;
  box-sizing: border-box;
}

.wprt-calendar-col .flatpickr-innerContainer,
.wprt-calendar-col .flatpickr-rContainer,
.wprt-calendar-col .flatpickr-days,
.wprt-calendar-col .dayContainer{
  width: 100% !important;
  min-width: 100% !important;
}

.wprt-calendar-col .flatpickr-weekdays{
  width: 100% !important;
}

.wprt-calendar-col .flatpickr-weekdaycontainer{
  display: flex;
  width: 100%;
}

.wprt-calendar-col .flatpickr-weekday{
  flex: 1;
  text-align: center;
}

.wprt-calendar-col .flatpickr-days .dayContainer{
  display: flex;
  flex-wrap: wrap;
}

.wprt-calendar-col .flatpickr-day{
  flex: 0 0 calc(100% / 7);
  max-width: calc(100% / 7);
  height: 44px;
  line-height: 44px;
  font-size: 15px;
  margin: 0;
}

.wprt-calendar-col .flatpickr-day.disabled,
.wprt-calendar-col .flatpickr-day.flatpickr-disabled{
  /* background: #e9e9e9 !important; */
  color: #39393917 !important;
  /* border-color: #e1e1e1 !important; */
  cursor: not-allowed;
}

/* Legenda */
.wprt-calendar-legend{
  margin-top: 10px;
  font-size: 14px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wprt-calendar-legend .dot{
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfcfcf;
  flex: 0 0 auto;
}

/* ---------- Lead form ---------- */
.wprt-form-card{
  width: 100%;
}

.wprt-lead-form-wrap{
  background: #fff;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}

.wprt-lead-form-wrap h4{
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.wprt-lead-form-wrap .wprt-field{
  margin-bottom: 12px;
}

.wprt-lead-form-wrap label{
  display: block;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}

.wprt-lead-form-wrap label br{
  display: none;
}

.wprt-lead-form-wrap label > input,
.wprt-lead-form-wrap label > select{
  margin-top: 8px;
}

.wprt-lead-form-wrap input[type="text"],
.wprt-lead-form-wrap input[type="email"],
.wprt-lead-form-wrap select{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px !important;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  min-height: 42px;
  background: #fff;
}

.wprt-lead-form-wrap input::placeholder{
  font-size: 13px;
  opacity: .7;
}

#wprt-date-from{
  cursor: pointer;
}

#wprt-lead-feedback{
  margin-top: 10px !important;
  font-size: 14px;
}

@media (max-width: 600px){
  .wprt-lead-form-wrap button{
    width: 100%;
  }
}

@media (max-width: 1024px){
  .wprt-form-card,
  .wprt-lead-form-wrap{
    max-width: none !important;
    width: 100% !important;
  }
}



/* ---------- Responsive alat cards ---------- */
@media (max-width: 900px){
  .wprt-alat-item { width: calc(50% - 10px); }
}

@media (max-width: 600px){
  .wprt-alat-item { width: 100%; }
}

/* ===== Selected tool title ===== */
.wprt-selected-title{
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

/* =========================================================
   DESKTOP GRID – forma startuje od tabele i završava se na dnu kalendara
   (legende su ispod i NE ulaze u visinu forme)
   ========================================================= */

.wprt-calendar-legends{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* pošto wrapper već pravi razmak, skini margin-top sa pojedinačne legende */
.wprt-calendar-legends .wprt-calendar-legend{
  margin-top: 0;
}

@media (min-width: 992px){
  .wprt-display{
    display: grid;
    grid-template-columns: 7fr 3fr;             /* 70/30 */
    grid-template-rows: auto auto auto auto;    /* title, table, calendar, legends */
    gap: 20px;
    align-items: start;
  }

  /* 1) Title */
  .wprt-selected-title{
    grid-column: 1;
    grid-row: 1;
  }

  /* 2) Table */
  .wprt-prices-table-wrap{
    grid-column: 1;
    grid-row: 2;
  }

  /* 3) Calendar */
  .wprt-calendar-col{
    grid-column: 1;
    grid-row: 3;
  }

  /* 4) Legends (poseban item ispod kalendara) */
  .wprt-calendar-legends{
    grid-column: 1;
    grid-row: 4;
    width: 100%;
  }

  /* Forma: samo tabela + kalendar (bez legendi) */
  .wprt-form-card{
    grid-column: 2;
    grid-row: 2 / 4;       /* ✅ row 2-3 */
    height: 100%;
    align-self: stretch;
  }

  /* da forma tačno legne u visinu (padding uračunat) */
  .wprt-lead-form-wrap{
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    /* bitno: feedback izvlačimo iz toka, pa rezervišemo prostor dole */
    position: relative;
    padding-bottom: 56px;  /* prostor za #wprt-lead-feedback */
  }

  .wprt-lead-form-wrap form{
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* dugme pri dnu */
  .wprt-lead-form-wrap .wprt-field:last-of-type{
    margin-top: auto;
  }

  /* feedback NE sme da utiče na visinu forme */
  #wprt-lead-feedback{
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 16px;
    margin-top: 0 !important;
  }

  /* booking-row wrapper neka ne utiče na layout */
  .wprt-booking-row{ display: contents; }
}

/* =========================================================
   Mobile/tablet: razmak između tabele i kalendara
   ========================================================= */
@media (max-width: 991px){
  .wprt-prices-table-wrap{
    margin-bottom: 16px;
  }

  /* na mobile feedback ide normalno u toku */
  #wprt-lead-feedback{
    position: static;
    left: auto; right: auto; bottom: auto;
    margin-top: 10px !important;
  }

  .wprt-lead-form-wrap{
    padding-bottom: 16px; /* vrati normalan padding */
  }
}

/* =========================================
   DESKTOP FIX: forma 1:1 sa kalendarom
   (bez +par px “rep”)
   ========================================= */
@media (min-width: 992px){

  /* forma neka se rastegne tačno po grid visini, ali da ne diktira visinu reda */
  .wprt-form-card{
    display: flex;
    min-height: 0;
    box-sizing: border-box;
  }

  .wprt-lead-form-wrap{
    flex: 1;
    min-height: 0;
    height: auto;              /* ✅ override height:100% */
    position: static;          /* ✅ skloni “absolute layout” */
    padding-bottom: 16px;      /* ✅ vrati normalan padding */
    box-sizing: border-box;
  }

  .wprt-lead-form-wrap form{
    min-height: 0;
  }

  /* feedback vraćamo u normalan tok (ne utiče na visinu dok je prazno) */
  #wprt-lead-feedback{
    position: static;
    left: auto; right: auto; bottom: auto;
    margin-top: 10px !important;
  }
}

/* =========================================
   DESKTOP: Calendar card only when calendar exists
   (sprečava prazno belo polje pre klika na alat)
   ========================================= */
@media (min-width: 992px){

  /* default (pre klika): bez card look-a */
  .wprt-calendar-col{
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }

  /* kada flatpickr inline postoji -> onda tek daj card look */
  .wprt-calendar-col:has(.flatpickr-calendar.inline){
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
  }

  /* da se ne duplira shadow na samom flatpickr-u */
  .wprt-calendar-col .flatpickr-calendar.inline{
    box-shadow: none !important;
  }
}

/* Fallback za browser bez :has():
   neće 100% sakriti, ali bar neće ostati “mrtav” blok kad je prazan */
@supports not selector(:has(*)){
  @media (min-width: 992px){
    .wprt-calendar-col{
      min-height: 0;
    }
  }
}
