/* Modern CSS variables and reset for Pet Pro Home Search */
:root {

  /* ── Paleta de Marca Pet Pro ─────────────────────────────────────────────
     Fuente de verdad: modificar aquí propaga el cambio a todo el widget.
     ──────────────────────────────────────────────────────────────────────── */
  --ppf-color-raspberry: #E7356F;   /* Rosa Frambuesa  — CTA principal       */
  --ppf-color-plum:      #9F5170;   /* Púrpura Ciruela — marca & títulos     */
  --ppf-color-blush:     #F7CDD7;   /* Rosa Pastel     — acento secundario   */
  --ppf-color-cream:     #FFF6F7;   /* Blanco Crema    — fondo base UI       */
  --ppf-color-charcoal:  #2B2B2F;   /* Carbón          — texto de lectura    */
  --ppf-color-mist:      #F0F2F5;   /* Gris Claro      — soporte UI          */
  --ppf-color-mustard:   #E29D4B;   /* Mostaza         — ilustraciones       */
  --ppf-color-coral:     #D9414B;   /* Rojo Coral      — detalles de acento  */

  /* ── Tokens Semánticos — Widget Buscador ─────────────────────────────────
     Estos tokens son los que usan los selectores BEM del widget.
     Cambia la paleta arriba; raramente necesitarás tocar este bloque.
     ──────────────────────────────────────────────────────────────────────── */
  --ppf-home-primary:          var(--ppf-color-raspberry);
  --ppf-home-primary-hover:    #cc2d60;                       /* hover botón buscar       */
  --ppf-home-primary-shadow:   rgba(231, 53, 111, 0.2);
  --ppf-home-bg-color:         var(--ppf-color-cream);
  --ppf-home-card-bg:          #FFFFFF;
  --ppf-home-field-bg:         var(--ppf-color-mist);
  --ppf-home-text-main:        var(--ppf-color-charcoal);
  --ppf-home-text-muted:       #9CA3AF;
  --ppf-home-border-color:     var(--ppf-color-mist);
  --ppf-home-border-focus:     var(--ppf-color-blush);        /* divider & scrollbar      */
  --ppf-home-focus-ring:       #FDEEF2;                       /* ring al enfocar campo    */
  --ppf-home-focus-border:     var(--ppf-color-blush);        /* borde al enfocar campo   */
  --ppf-home-item-hover-bg:    var(--ppf-color-cream);        /* hover de sugerencias     */
  --ppf-home-widget-border:    var(--ppf-color-blush);        /* borde card widget        */
  --ppf-home-icon-service-bg:  #FDF0DC;                       /* mostaza claro — servicio */
  --ppf-home-icon-location-bg: #FDEEF4;                       /* rosa suave — ubicación   */
  --ppf-home-shadow-widget:    0 8px 30px rgba(0, 0, 0, 0.08);
  --ppf-home-shadow-dropdown:  0 12px 32px rgba(0, 0, 0, 0.15);
  --ppf-home-font-family:      'Plus Jakarta Sans', sans-serif;

  /* ── Quick-Access Pills Theme ────────────────────────────────────────────── */
  --ppf-pill-bg:          transparent;
  --ppf-pill-border:      var(--ppf-color-blush);
  --ppf-pill-text:        var(--ppf-color-plum);
  --ppf-pill-active-bg:   var(--ppf-color-raspberry);
  --ppf-pill-active-text: #FFFFFF;
  --ppf-pill-shadow:      0 4px 12px rgba(231, 53, 111, 0.3);
}

/* Container Wrapper */
.search-widget-container {
  max-width: 896px;
  margin: 20px auto;
  position: relative;
  box-sizing: border-box;
  font-family: var(--ppf-home-font-family);
  width: 100%;
}

/* BEM: Search Widget Card Block */
.search-widget {
  background-color: var(--ppf-home-card-bg);
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--ppf-home-shadow-widget);
  border: 1px solid var(--ppf-home-widget-border);
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

.search-widget__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}



/* Elements: Field */
.search-widget__field {
  width: 100%;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  border-radius: 16px;
  background-color: var(--ppf-home-field-bg);
  border: 1px solid var(--ppf-home-border-color);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-widget__field:focus-within {
  border-color: var(--ppf-home-focus-border);
  background-color: var(--ppf-home-card-bg);
  box-shadow: 0 0 0 3px var(--ppf-home-focus-ring);
}



.search-widget__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ppf-home-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: block;
  line-height: 1;
}

.search-widget__input-group {
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-widget__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--ppf-home-primary);
}

.search-widget__input {
  width: 100%;
  min-width: 0;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  font-family: inherit;
  font-size: 15px;
  color: var(--ppf-home-text-main);
  margin-left: 10px;
  padding: 0 !important;
  height: 24px;
  line-height: normal;
  box-sizing: border-box;
}

.search-widget__input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.search-widget__input::placeholder {
  color: var(--ppf-home-text-muted);
}

.search-widget__chevron {
  color: var(--ppf-home-text-muted);
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

/* Element: Divider (visible solo en desktop — ver @media al final) */
.search-widget__divider {
  display: none;
}

/* Element: Action / Button */
.search-widget__action {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.search-widget__button {
  width: 100%;
  color: var(--ppf-home-card-bg);
  background-color: var(--ppf-home-primary);
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.search-widget__button:hover {
  background-color: var(--ppf-home-primary-hover);
  transform: translateY(-1px);
}

.search-widget__button:active {
  transform: scale(0.98);
}

/* Element: Dropdown Suggestions Box */
.search-widget__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 12px;
  background-color: var(--ppf-home-card-bg);
  border-radius: 16px;
  box-shadow: var(--ppf-home-shadow-dropdown);
  border: 1px solid var(--ppf-home-border-color);
  overflow: hidden;
  z-index: 200;
}

/* Modifier: Hidden dropdown state */
.search-widget__dropdown--hidden {
  display: none;
}

.search-widget__list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-height: 320px;
  overflow-y: auto;
}

/* Reset heredado del tema sobre los <li> dentro del dropdown */
.search-widget__list .search-widget__item {
  margin: 0 !important;
  padding: 12px 16px !important;
  list-style: none !important;
}

/* Custom Scrollbar for suggestions */
.search-widget__list::-webkit-scrollbar {
  width: 6px;
}

.search-widget__list::-webkit-scrollbar-thumb {
  background-color: var(--ppf-home-border-focus);
  border-radius: 10px;
}

.search-widget__list::-webkit-scrollbar-track {
  background: transparent;
}

/* Suggestions Items */
.search-widget__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
}

.search-widget__item:hover,
.search-widget__item--active {
  background-color: var(--ppf-home-item-hover-bg);
}

.search-widget__item--empty {
  color: var(--ppf-home-text-muted);
  cursor: default;
  justify-content: center;
  text-align: center;
  font-style: italic;
  padding: 16px;
}

.search-widget__item--empty:hover {
  background-color: transparent;
}

.search-widget__item-icon-box {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modifiers for suggestions item icon colors */
.search-widget__item-icon-box--service {
  background-color: var(--ppf-home-icon-service-bg);
}

.search-widget__item-icon-box--location {
  background-color: var(--ppf-home-icon-location-bg);
}

.search-widget__item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.search-widget__item-text {
  color: var(--ppf-home-text-main);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   BEM: Quick-Access Category Pills
   ========================================================================== */
.search-widget__pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin-top: 14px;
  padding: 0 4px;
}

.search-widget__pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background-color: var(--ppf-pill-bg);
  border: 1px solid var(--ppf-pill-border);
  color: var(--ppf-pill-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 15px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.search-widget__pill:hover {
  background-color: var(--ppf-pill-active-bg);
  border-color: var(--ppf-pill-active-bg);
  color: var(--ppf-pill-active-text);
  transform: translateY(-2px);
  box-shadow: var(--ppf-pill-shadow);
}

.search-widget__pill--active {
  background-color: var(--ppf-pill-active-bg) !important;
  border-color: var(--ppf-pill-active-bg) !important;
  color: var(--ppf-pill-active-text) !important;
  transform: translateY(-2px);
  box-shadow: var(--ppf-pill-shadow);
}

.search-widget__pill:active {
  transform: scale(0.96);
}

.search-widget__pill-icon {
  font-size: 12px;
  color: inherit;
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-widget__pill:hover .search-widget__pill-icon,
.search-widget__pill--active .search-widget__pill-icon {
  transform: scale(1.15);
}

.search-widget__pill-text {
  white-space: nowrap;
  color: inherit;
}

.search-widget__pill--more {
  background-color: transparent;
  border: 1px dashed var(--ppf-pill-border);
}

.search-widget__pill--more:hover {
  background-color: var(--ppf-pill-active-bg);
  border-style: solid;
}

/* ==========================================================================
   Responsive — Desktop (≥ 768px)
   ========================================================================== */
@media (min-width: 768px) {
  .search-widget__form {
    flex-direction: row;
    align-items: stretch;
  }

  .search-widget__field {
    flex: 1;
    min-width: 0;
  }

  .search-widget__divider {
    display: block;
    width: 1px;
    background-color: var(--ppf-home-border-focus);
    flex-shrink: 0;
    align-self: stretch;
    margin: 8px 0;
  }

  .search-widget__button {
    width: auto;
  }
}

/* ==========================================================================
   Responsive — Mobile (≤ 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .search-widget__pills {
    justify-content: flex-start;
    gap: 6px 8px;
    margin-top: 10px;
  }

  .search-widget__pill {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* ==========================================================================
   BEM: Mobile Bottom Sheet Modal (< 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
  .search-widget__dropdown {
    display: none !important;
  }
}

.ppf-bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: var(--ppf-home-font-family);
}

.ppf-bottom-sheet-overlay--hidden {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ppf-bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ppf-bottom-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 85vh;
  height: 85dvh;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  overflow: hidden;
}

.ppf-bottom-sheet-overlay--hidden .ppf-bottom-sheet {
  transform: translateY(100%);
}

.ppf-bottom-sheet__handle {
  width: 36px;
  height: 4px;
  background: #E5E7EB;
  border-radius: 9999px;
  margin: 10px auto 4px auto;
  flex-shrink: 0;
}

.ppf-bottom-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 8px 20px;
  flex-shrink: 0;
}

.ppf-bottom-sheet__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ppf-color-charcoal);
  margin: 0;
  line-height: 1.2;
}

.ppf-bottom-sheet__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ppf-color-mist);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ppf-home-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
  padding: 0;
}

.ppf-bottom-sheet__close:hover,
.ppf-bottom-sheet__close:active {
  background: var(--ppf-color-blush);
  color: var(--ppf-color-raspberry);
}

.ppf-bottom-sheet__search-box {
  margin: 8px 20px 12px 20px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--ppf-color-mist);
  border: 1.5px solid var(--ppf-color-mist);
  border-radius: 16px;
  padding: 0 14px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.ppf-bottom-sheet__search-box:focus-within {
  border-color: var(--ppf-color-blush);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px var(--ppf-home-focus-ring);
}

.ppf-bottom-sheet__search-icon {
  color: var(--ppf-color-raspberry);
  font-size: 15px;
  flex-shrink: 0;
}

.ppf-bottom-sheet__input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 15px;
  font-family: inherit;
  color: var(--ppf-color-charcoal);
  padding: 13px 10px !important;
  height: auto !important;
}

.ppf-bottom-sheet__input::placeholder {
  color: var(--ppf-home-text-muted);
}

.ppf-bottom-sheet__clear {
  border: none;
  background: transparent;
  color: var(--ppf-home-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ppf-bottom-sheet__clear--hidden {
  display: none;
}

.ppf-bottom-sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px 24px 12px;
}

.ppf-bottom-sheet__list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ppf-bottom-sheet__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color 0.18s ease;
  gap: 12px;
}

.ppf-bottom-sheet__item:hover,
.ppf-bottom-sheet__item:active {
  background-color: var(--ppf-color-cream);
}

.ppf-bottom-sheet__item--empty {
  color: var(--ppf-home-text-muted);
  justify-content: center;
  text-align: center;
  font-style: italic;
  padding: 24px 16px;
  cursor: default;
}

.ppf-bottom-sheet__item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.ppf-bottom-sheet__item-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ppf-bottom-sheet__item-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ppf-color-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ppf-bottom-sheet__item-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--ppf-home-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Modifiers for Item Icons (Semantic Colors) */
.ppf-bottom-sheet__item-icon-box--category {
  background-color: #EFF6FF;
  color: #3B82F6;
}

.ppf-bottom-sheet__item-icon-box--specialty {
  background-color: #FEF3C7;
  color: #D97706;
}

.ppf-bottom-sheet__item-icon-box--condition {
  background-color: #FEE2E2;
  color: #EF4444;
}

.ppf-bottom-sheet__item-icon-box--study {
  background-color: #F3E8FF;
  color: #8B5CF6;
}

.ppf-bottom-sheet__item-icon-box--location {
  background-color: var(--ppf-home-icon-location-bg);
  color: var(--ppf-home-primary);
}

.ppf-bottom-sheet__item-icon-box--gps {
  background-color: #F3E8FF;
  color: #7C3AED;
}

@media (min-width: 768px) {
  .ppf-bottom-sheet-overlay {
    display: none !important;
  }
}
