/* ============================================================
   GRILLE TARIFAIRE + SIMULATEUR + DATEPICKER
   Copie des styles de solution-park-page-prices pour usage
   autonome dans le plugin solution-park (page partenaires).
   ============================================================ */

/* ---- GRILLE TARIFAIRE ---- */

.sp-tariffs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto 0;
}

.sp-product-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  border: 1px solid #e8e8ee;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  scroll-margin-top: 100px;
}

.sp-product-title {
  margin: 0 0 16px !important;
  font-size: 17px;
  font-weight: 700;
  color: var(--sp-color);
  background: none;
  padding: 0;
  border-radius: 0;
}

.sp-grille-toggle {
  display: inline-flex;
  background: #f0f0f5;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 16px;
}

.sp-grille-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.2;
}

.sp-grille-btn.is-active {
  background: var(--sp-color);
  color: #fff;
}

.sp-grille-btn:disabled {
  cursor: default;
}

.sp-grille-panel[hidden] {
  display: none;
}

.sp-badges {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.sp-badge {
  flex: 1;
  background: linear-gradient(
    135deg,
    var(--sp-color),
    color-mix(in srgb, var(--sp-color) 87%, #000)
  );
  border-radius: 14px;
  padding: 20px 16px;
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 20px var(--sp-color-soft);
}

.sp-badge-days {
  display: block;
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sp-badge-price {
  display: block;
  font-size: 18px;
  font-weight: 700;
  margin: 6px 0 2px;
  line-height: 1.1;
}

.sp-badge-perday {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}

.sp-price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
  margin: 0;
}

.sp-price-table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a8a9a;
  font-weight: 600;
  padding: 8px 12px;
  text-align: right;
  background: none;
  border: none;
}

.sp-price-table thead th:first-child {
  text-align: left;
}

.sp-price-table tbody tr {
  background: transparent;
}

.sp-price-table tbody tr:nth-child(odd) {
  background: #f8f8fb;
}

.sp-price-table tbody td {
  padding: 10px 12px;
  border: none;
}

.sp-price-table tbody td:first-child {
  font-weight: 500;
  border-radius: 8px 0 0 8px;
}

.sp-cell-price {
  text-align: right;
  font-weight: 600;
  font-size: 15px;
}

.sp-cell-perday {
  text-align: right;
  font-size: 12px;
  color: #8a8a9a;
  font-weight: 400;
  border-radius: 0 8px 8px 0;
}

.sp-row-extra {
  display: none;
}

.sp-grille-panel.is-expanded .sp-row-extra {
  display: table-row;
}

.sp-table-expand {
  display: block;
  margin: 12px auto 0;
  background: #2e2e2e;
  border: none;
  border-radius: 5px;
  padding: 8px 20px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

.sp-grille-panel .sp-expand-expanded {
  display: none;
}

.sp-grille-panel.is-expanded .sp-expand-collapsed {
  display: none;
}

.sp-grille-panel.is-expanded .sp-expand-expanded {
  display: inline;
}

.sp-extra-message {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 13px;
  color: #666;
}

.sp-extra-message p {
  margin: 8px 0;
}

.sp-extra-message p:last-child {
  text-align: left;
}

.sp-extra-message a {
  margin: 8px 0;
}

@media (max-width: 480px) {
  .sp-product-card {
    padding: 22px 18px;
  }

  .sp-badges {
    gap: 8px;
  }

  .sp-badge {
    padding: 16px 8px;
  }

  .sp-badge-price {
    font-size: 22px;
  }

  .sp-badge-days {
    font-size: 12px;
  }
}

/* ---- SIMULATEUR DE TARIFS ---- */

.sp-simulator-section {
  margin: 0 -20px 32px;
  padding: 32px 20px;
  position: relative;
}

.sp-simulator {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border: none;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.sp-simulator-title {
  margin: 0 0 20px !important;
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  background: none;
  border-radius: 5px;
  text-align: center;
  background-color: #f2f2f2;
  padding: 20px;
}

.sp-simulator-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  align-items: end;
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.sp-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8a8a9a;
  font-weight: 600;
  line-height: 1;
}

.sp-field-input {
  height: 48px;
  padding: 0 14px;
  border: 1px solid #e8e8ee;
  border-radius: 10px;
  background: #f8f8fb;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
  line-height: 48px;
}

.sp-field-input:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
  background: #fff;
}

select.sp-field-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'><path fill='%238a8a9a' d='M6 7L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  padding-right: 36px;
}

input.sp-datepicker {
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238a8a9a' viewBox='0 0 16 16'><path d='M4 0a1 1 0 0 1 1 1h6a1 1 0 1 1 0-2h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V0zm0 5v1h8V5H4zm0 3v1h8V8H4zm0 3v1h5v-1H4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 36px;
}

.sp-simulator-result {
  border-top: 1px solid #f0f0f5;
  padding-top: 20px;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-simulator-empty,
.sp-simulator-loading,
.sp-simulator-error {
  font-size: 14px;
  color: #8a8a9a;
  margin: 0;
}

.sp-simulator-loading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid #e8e8ee;
  border-top-color: #1e3a5f;
  border-radius: 50%;
  animation: sp-spin 0.8s linear infinite;
  vertical-align: middle;
}

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

.sp-simulator-error {
  color: #b94545;
  font-weight: 500;
}

.sp-simulator-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(101, 174, 115, 0.06);
  border-radius: 12px;
  padding: 16px 28px;
}

.sp-simulator-success-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a8a9a;
  font-weight: 600;
}

.sp-simulator-success-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--sp-result-color, #1a1a2e);
  line-height: 1.1;
}

.sp-simulator-success-price .woocommerce-Price-amount {
  color: inherit;
}

.sp-simulator-success-meta {
  font-size: 13px;
  color: #666;
}

/* ---- DATEPICKER JQUERY UI ---- */

.ui-datepicker.ui-widget {
  background: #fff;
  border: none;
  border-radius: 16px;
  padding: 16px;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  font-family: inherit;
  font-size: 14px;
  z-index: 9999 !important;
  width: 280px;
}

.ui-datepicker .ui-datepicker-header {
  background: none;
  border: none;
  padding: 0 0 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ui-datepicker .ui-datepicker-title {
  font-weight: 700;
  font-size: 15px;
  color: #1a1a2e;
  text-align: center;
  text-transform: capitalize;
  flex: 1;
  order: 2;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background: #f0f0f5;
  transition: background 0.15s;
  flex-shrink: 0;
}

.ui-datepicker .ui-datepicker-prev {
  order: 1;
}

.ui-datepicker .ui-datepicker-next {
  order: 3;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover,
.ui-datepicker .ui-datepicker-prev-hover,
.ui-datepicker .ui-datepicker-next-hover {
  background: #e4e4ec !important;
  border: none;
  position: static;
  top: auto;
  left: auto;
  right: auto;
}

.ui-datepicker .ui-datepicker-prev .ui-icon,
.ui-datepicker .ui-datepicker-next .ui-icon {
  background-image: none !important;
  text-indent: -9999px;
  width: 0;
  height: 0;
  overflow: hidden;
  position: static;
  margin: 0;
  left: auto;
  top: auto;
}

.ui-datepicker .ui-datepicker-prev::after,
.ui-datepicker .ui-datepicker-next::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-top: 2px solid #1a1a2e;
  border-right: 2px solid #1a1a2e;
}

.ui-datepicker .ui-datepicker-prev::after {
  transform: rotate(-135deg);
  margin-left: 2px;
}

.ui-datepicker .ui-datepicker-next::after {
  transform: rotate(45deg);
  margin-right: 2px;
}

.ui-datepicker table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ui-datepicker th {
  color: #1a1a2e;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  padding: 0 0 6px;
  border: none;
  background: none;
  text-align: center;
}

.ui-datepicker td {
  padding: 3px 0;
  border: none;
  background: none;
  text-align: center;
}

.ui-datepicker td a,
.ui-datepicker td span {
  display: block !important;
  text-align: center !important;
  line-height: 36px !important;
  height: 36px !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 8px;
  color: #1a1a2e;
  text-decoration: none;
  border: none !important;
  background: none !important;
  font-weight: 500;
  font-size: 14px;
  transition:
    background 0.15s,
    color 0.15s;
  position: static !important;
  float: none !important;
  box-sizing: border-box !important;
}

.ui-datepicker td a:hover {
  background: #eef1f6 !important;
  color: #1e3a5f !important;
}

.ui-datepicker td span {
  color: #d0d0d8;
  cursor: default;
}

.ui-datepicker .ui-state-highlight {
  background: #eef1f6 !important;
  color: #1e3a5f !important;
  border: none !important;
  font-weight: 700;
  border-radius: 8px;
}

.ui-datepicker .ui-state-active,
.ui-datepicker td a.ui-state-active {
  background: #1e3a5f !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  border-radius: 8px;
}

.ui-datepicker td a.ui-state-active.ui-state-highlight {
  background: #1e3a5f !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 720px) {
  .sp-simulator-title {
    font-size: 18px;
  }

  .sp-simulator-form {
    grid-template-columns: 1fr;
  }

  .sp-simulator-success-price {
    font-size: 28px;
  }
}
