/* ==========================================================================
   MAT&GO Platform — Mobile-first extensions
   ========================================================================== */

.hidden { display: none !important; }
.loading-msg, .error-msg, .pricing-hint {
  color: var(--text-muted);
  padding: 16px;
  text-align: center;
}
.error-msg { color: #DC2626; }

/* Caution séparée du total location */
.pricing-row.pricing-deposit {
  border-bottom: none;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pricing-row.pricing-deposit strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}
.pricing-row.pricing-deposit small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
}
.pricing-deposit-note {
  font-size: 0.9rem;
  color: var(--text-muted) !important;
}
.pricing-deposit-note small { font-weight: 400; }
.product-deposit-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: -8px 0 12px;
}
.product-deposit-hint small { font-style: italic; }

/* Header search */
.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.header-search-toggle {
  min-width: 48px;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: var(--bg-white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
}
.header-search-toggle i { font-size: 1.15rem; }
.header-search-toggle-label { display: none; }
@media (min-width: 900px) {
  .header-search-toggle-label { display: inline; }
}
#header.scrolled .header-search-toggle,
#header.header-solid .header-search-toggle {
  background: var(--bg-light);
  color: var(--secondary);
}
.header-search-panel {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(560px, calc(100vw - 24px));
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 1200;
  overflow: hidden;
}
.header-search-panel.open { display: block; }
.header-search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
}
.header-search-input-row i { color: var(--text-muted); font-size: 1.15rem; }
.header-search-input-row input {
  flex: 1; border: none; outline: none; font-size: 1.1rem;
  font-family: var(--font-body); background: transparent; color: var(--text-main); min-height: 28px;
}
.header-search-close { border: none; background: none; font-size: 1.4rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.header-search-results { max-height: 70vh; overflow-y: auto; }
.header-search-list { list-style: none; margin: 0; padding: 0; }
.header-search-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); color: var(--text-main); }
.header-search-list a:hover { background: var(--bg-light); }
.header-search-list img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--bg-light); flex-shrink: 0; }
.header-search-list span { flex: 1; min-width: 0; }
.header-search-list strong { display: block; font-size: 0.9rem; }
.header-search-list small { display: block; color: var(--text-muted); font-size: 0.75rem; }
.header-search-list em { font-style: normal; font-size: 0.8rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.header-search-all { display: block; text-align: center; padding: 12px; font-weight: 600; font-size: 0.9rem; color: var(--primary); }
.header-search-empty { padding: 16px; color: var(--text-main); font-size: 0.9rem; }
.header-search-empty p { margin-bottom: 10px; color: var(--text-muted); }
.header-search-empty p strong { color: var(--text-main); }
.tool-request-form .input-group { margin-bottom: 10px; }
.tool-request-form label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.tool-request-form input, .tool-request-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; font-family: var(--font-body); font-size: 0.9rem; }
.tool-request-feedback { margin-top: 10px; font-size: 0.85rem; padding: 10px; border-radius: 8px; }
.tool-request-feedback.success { background: #ECFDF5; color: #065F46; }
.tool-request-feedback.error { background: #FEE2E2; color: #991B1B; }

@media (max-width: 768px) {
  .header-search-wrap { margin-left: auto; }
  .header-search-toggle { min-width: 44px; min-height: 44px; }
  .header-search-panel { position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 90px); overflow: auto; z-index: 1090; }
  .header-search-list a { flex-wrap: wrap; gap: 8px; }
  .header-search-list em { width: 100%; text-align: left; }
  .catalog-toolbar select, .catalog-toolbar input, .search-box input { font-size: 16px; }
  .product-layout, .booking-section { grid-template-columns: 1fr !important; }
  .rates-grid, .pricing-live { grid-template-columns: 1fr; }
  .gallery-thumbs { overflow-x: auto; flex-wrap: nowrap; }
  #booking-summary, .booking-steps { font-size: 0.95rem; }
  .card-actions { flex-direction: column; }
  .card-actions .btn { width: 100%; }
}

/* Catalog page */
.catalog-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.search-box { position: relative; width: 100%; }
.search-box input { width: 100%; padding: 18px 18px 18px 52px; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 1.125rem; background: var(--bg-white); min-height: 58px; }
.search-box i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.15rem; }

/* FAQ */
.faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 4px 18px; }
.faq-item summary { cursor: pointer; list-style: none; font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; color: var(--secondary); padding: 16px 28px 16px 0; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.4rem; font-weight: 700; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 0 0 16px; color: var(--text-muted); line-height: 1.65; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.catalog-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.catalog-controls select { flex: 1; min-width: 140px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 0.9rem; background: var(--bg-white); }
.filter-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-white); cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.filter-panel { display: none; flex-direction: column; gap: 12px; padding: 16px; background: var(--bg-light); border-radius: var(--radius); margin-bottom: 20px; }
.filter-panel.open { display: flex; }
.filter-panel label { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 4px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 0.9rem; color: var(--text-muted); }
.no-results { display: none; text-align: center; padding: 48px 20px; background: var(--bg-light); border-radius: var(--radius); }
.no-results.show { display: block; }
.no-results .tool-request-box { text-align: left; max-width: 420px; margin: 0 auto; }
.catalog-card .card-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }

.product-ref { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; margin-bottom: 6px; }

/* Product page */
.product-layout { display: grid; gap: 32px; }
.product-gallery .gallery-main { border-radius: var(--radius); overflow: hidden; background: var(--bg-light); aspect-ratio: 4/3; }
.product-gallery .gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb { flex-shrink: 0; width: 72px; height: 72px; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: none; }
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-heading { margin-bottom: 20px !important; }
.product-booking { width: 100%; margin: 0 0 30px; box-sizing: border-box; }
.product-description { margin: 0 0 24px; }
.product-description h2 { margin: 0 0 10px; font-size: 1.2rem; }
.product-description p { margin: 0; line-height: 1.7; }
.product-details-accordion { display: grid; gap: 10px; margin-top: 8px; }
.product-details-accordion details { border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-white); overflow: hidden; }
.product-details-accordion summary { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 14px 18px; box-sizing: border-box; cursor: pointer; list-style: none; font-family: var(--font-heading); font-weight: 700; color: var(--text-color, #1f2937); user-select: none; }
.product-details-accordion summary::-webkit-details-marker { display: none; }
.product-details-accordion summary::after { content: '+'; flex: 0 0 auto; font-size: 1.35rem; line-height: 1; color: var(--accent); }
.product-details-accordion details[open] summary::after { content: '−'; }
.product-details-accordion details[open] summary { border-bottom: 1px solid var(--border-color); }
.product-details-accordion details > ul, .product-details-accordion details > p { margin: 0; padding: 16px 18px 18px; }
.product-details-accordion .product-features { padding-left: 36px; }
.product-details-accordion details > p { color: var(--text-muted); line-height: 1.65; }

.rates-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.rate-item { display: flex; min-height: 88px; flex-direction: column; justify-content: center; background: var(--bg-light); padding: 12px 10px; border: 1px solid var(--border-color); border-radius: var(--radius); text-align: center; }
.rate-item span { display: block; font-size: 0.78rem; line-height: 1.3; color: var(--text-muted); }
.rate-item strong { display: block; margin-top: 5px; font-size: 1.05rem; color: var(--accent); }
.rate-item:last-child { grid-column: 1 / -1; min-height: auto; padding: 9px 12px; flex-direction: row; align-items: center; justify-content: space-between; text-align: left; }
.rate-item:last-child strong { margin-top: 0; }
.booking-section { background: var(--bg-light); padding: 24px 16px; border-radius: var(--radius); border: 1px solid var(--border-color); }
.booking-steps { margin-top: 20px; }
.step-indicator { display: flex; gap: 8px; margin-bottom: 20px; font-size: 0.8rem; }
.step-indicator span { flex: 1; text-align: center; padding: 8px; background: var(--bg-white); border-radius: 6px; color: var(--text-muted); }
.step-indicator span.active { background: var(--primary); color: white; font-weight: 600; }

/* Calendar */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: 1rem; text-transform: capitalize; }
.cal-nav { width: 36px; height: 36px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-white); cursor: pointer; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-green { background: #059669; }
.dot-red { background: #DC2626; }
.dot-black { background: #374151; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays span { text-align: center; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); padding: 4px; }
.cal-day { aspect-ratio: 1; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-white); cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.cal-day.empty { border: none; background: none; cursor: default; }
.cal-day:disabled { opacity: 0.45; cursor: not-allowed; }
.cal-reserved:disabled { background: #FEE2E2; }
.cal-maintenance:disabled, .cal-blocked:disabled { background: #E5E7EB; }
.cal-past:disabled { background: #F9FAFB; color: #CBD5E1; }
.cal-day.in-range { background: rgba(27, 77, 110, 0.12); }
.cal-day.range-start, .cal-day.range-end { background: var(--primary); color: white; border-color: var(--primary); }
.cal-selection { margin-top: 12px; font-size: 0.9rem; text-align: center; min-height: 1.4em; }
.cal-selection.cal-error { color: #DC2626; }

/* Live pricing */
.pricing-live { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.pricing-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; }
.pricing-row.total { border-bottom: none; font-size: 1.1rem; font-weight: 700; color: var(--primary); padding-top: 12px; }
.pricing-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; }

/* Options payantes — fiche produit */
.product-options { margin: 20px 0 8px; padding: 16px 0 0; border-top: 1px solid var(--border-color); }
.product-options-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: var(--primary); margin: 0 0 12px; }
#product-options-list { display: flex; flex-direction: column; gap: 10px; }
.product-option-card { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-light); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.product-option-card:hover { border-color: var(--primary-light); background: var(--bg-white); }
.product-option-card:has(input:checked) { border-color: var(--primary); background: var(--bg-white); box-shadow: inset 3px 0 0 var(--accent); }
.product-option-card input[type="checkbox"] { margin-top: 3px; width: 1.05rem; height: 1.05rem; accent-color: var(--primary); flex-shrink: 0; }
.product-option-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.product-option-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product-option-top strong { font-size: 0.95rem; color: var(--text-main); font-weight: 600; }
.product-option-top em { font-style: normal; font-weight: 700; font-size: 0.9rem; color: var(--accent); white-space: nowrap; }
.product-option-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
#booking-summary .summary-extras { margin: 0 0 12px; padding-left: 1.2em; color: var(--text-main); }
#booking-summary .summary-extras li { margin: 4px 0; }
#booking-summary { background: var(--bg-white); padding: 20px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.95rem; }
#booking-summary hr { margin: 12px 0; border: none; border-top: 1px solid var(--border-color); }
.btn-row { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* Confirmation */
.confirm-box { max-width: 560px; margin: 0 auto; text-align: center; padding: 40px 20px; }
.confirm-icon { width: 80px; height: 80px; background: #ECFDF5; color: #059669; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 24px; }
.confirm-icon.err { background: #FEE2E2; color: #DC2626; }
.confirm-icon.warn { background: #FEF3C7; color: #D97706; }
.confirm-icon.ok { background: #ECFDF5; color: #059669; }

@media (prefers-reduced-motion: reduce) { .reveal { transition: none; } }

@media (min-width: 768px) {
  .catalog-toolbar { flex-direction: row; align-items: center; }
  .search-box { flex: 1; }
  .filter-panel { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .filter-panel.open { display: flex; }
  .filter-toggle { display: none; }
  .filter-panel { display: flex !important; background: transparent; padding: 0; margin-bottom: 24px; }
  .product-layout { grid-template-columns: 1fr; }
  .rates-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-actions { flex-direction: row !important; }
  .card-actions .btn { flex: 1; }
  .btn-row { flex-direction: row; }
}

@media (min-width: 1024px) {
  .product-layout { grid-template-columns: 1fr; gap: 32px; }
  .product-booking { position: static; }
}
