:root {
  --rf-rose-primary: #d9537c;
  --rf-rose-dark: #a14b68;
  --rf-rose-light: #ffeef5;
  --rf-ink: #333333;
  --rf-muted: #777777;
  --rf-border: #e0e0e0;
  --rf-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --rf-shadow-hover: 0 8px 24px rgba(217, 83, 124, 0.12);
  --rf-transition: all 0.25s ease;
}

.rnf-lsa-v3 {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  box-sizing: border-box;
}

.rnf-lsa__search-container {
  width: 100%;
  box-sizing: border-box;
}

.rnf-lsa__field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: #fff;
  border-radius: 50px;
  transition: var(--rf-transition);
}

.rnf-lsa__field:hover {
  border-color: var(--rf-rose-primary);
}

.rnf-lsa__field:focus-within {
  border-color: var(--rf-rose-primary);
  box-shadow: 0 0 0 3px rgba(217, 83, 124, 0.1);
}

.rnf-lsa__rosy {
  height: 52px;
  width: auto;
  flex-shrink: 0;
  border-radius: 0!important;
  object-fit: contain;
  transition: var(--rf-transition);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rnf-lsa__field:hover .rnf-lsa__rosy {
  transform: scale(1.05);
}

.rnf-lsa__field:focus-within .rnf-lsa__rosy {
  transform: scale(1.1);
  filter: drop-shadow(0 2px 6px rgba(217, 83, 124, 0.3));
}

.rnf-lsa__input,
input[type="search"] {
  background-color: #fff !important;
  border-radius: 50px;
}

.rnf-lsa__input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  font-size: 15px;
  color: var(--rf-ink);
  background: transparent !important;
  font-weight: 400;
  font-family: inherit;
  box-shadow: none !important;
}

.rnf-lsa__input::placeholder {
  color: var(--rf-muted);
  font-weight: 400;
}

.rnf-lsa__clear {
  border: 0;
  background: transparent;
  color: var(--rf-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--rf-transition), opacity 0.2s ease;
  visibility: hidden;
  flex-shrink: 0;
  opacity: 0;
}

.rnf-lsa__clear:hover {
  color: var(--rf-rose-primary);
  background: var(--rf-rose-light);
}

.rnf-lsa-v3.is-open::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 9998;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.rnf-lsa__panel {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--rf-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 9999;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rnf-lsa__panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rnf-lsa__results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rf-border);
  background: #fff;
  flex: 1;
}

.rnf-lsa__results-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--rf-ink);
  margin: 0;
}

.rnf-lsa__results-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--rf-rose-primary);
  padding: 4px 12px;
  background: var(--rf-rose-light);
  border-radius: 999px;
}

.rnf-lsa__close-mobile {
  display: none;
  border: 0;
  background: transparent;
  color: var(--rf-muted);
  cursor: pointer;
  padding: 20px;
  transition: var(--rf-transition);
}

.rnf-lsa__close-mobile:hover {
  color: var(--rf-rose-primary);
}

.rnf-lsa__body {
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rf-border) transparent;
}

.rnf-lsa__body::-webkit-scrollbar {
  width: 6px;
}

.rnf-lsa__body::-webkit-scrollbar-track {
  background: transparent;
}

.rnf-lsa__body::-webkit-scrollbar-thumb {
  background: var(--rf-border);
  border-radius: 3px;
}

.rnf-lsa__body::-webkit-scrollbar-thumb:hover {
  background: var(--rf-rose-primary);
}

.rnf-lsa__ai-answer {
  background: var(--rf-rose-light);
  border-left: 3px solid var(--rf-rose-primary);
  padding: 16px 20px;
  margin: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--rf-ink);
}

/* Style spécial pour message inapproprié */
.rnf-lsa__ai-answer.inappropriate {
  background: #fff3cd;
  border-left: 3px solid #ff9800;
}

.rnf-lsa__ai-answer a {
  color: var(--rf-rose-primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.rnf-lsa__ai-answer a:hover {
  text-decoration: underline;
}

.rnf-lsa__cat-suggestion {
  background: #fff9e6;
  border-left: 3px solid #ffc107;
  padding: 14px 20px;
  margin: 16px 20px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--rf-ink);
}

.rnf-lsa__cat-suggestion strong {
  color: #f57c00;
}

.rnf-lsa__products {
  padding: 20px;
}

.rnf-lsa__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.rnf-lsa__product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: var(--rf-transition);
}

.rnf-lsa__product-card:hover {
  transform: translateY(-2px);
  border-color: var(--rf-rose-primary);
  box-shadow: var(--rf-shadow-hover);
}

.rnf-lsa__product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9f9f9;
}

.rnf-lsa__product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rnf-lsa__product-card:hover .rnf-lsa__product-img {
  transform: scale(1.05);
}

.rnf-lsa__product-img.placeholder {
  background: linear-gradient(135deg, #fafafa, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--rf-border);
}

.rnf-lsa__product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.rnf-lsa__product-title {
  color: var(--rf-ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 40px;
}

.rnf-lsa__product-price {
  color: var(--rf-rose-dark);
  font-weight: 700;
  font-size: 15px;
  margin-top: auto;
}

.rnf-lsa__product-list-item {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--rf-border);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  transition: var(--rf-transition);
}

.rnf-lsa__product-list-item:hover {
  border-color: var(--rf-rose-primary);
  background: #fafafa;
}

.rnf-lsa__list-image {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f9f9f9;
}

.rnf-lsa__list-image .rnf-lsa__product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rnf-lsa__list-image .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #fafafa, #f0f0f0);
  color: var(--rf-border);
}

.rnf-lsa__list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rnf-lsa__list-info .rnf-lsa__product-title {
  font-size: 13px;
  min-height: auto;
  -webkit-line-clamp: 1;
}

.rnf-lsa__list-info .rnf-lsa__product-price {
  font-size: 14px;
  margin-top: 0;
}

.rnf-lsa__blog-section {
  border-top: 1px solid var(--rf-border);
  padding: 20px;
  background: #fafafa;
}

.rnf-lsa__blog-header {
  margin-bottom: 14px;
}

.rnf-lsa__blog-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--rf-ink);
  margin: 0;
}

.rnf-lsa__blog-grid {
  display: grid;
  gap: 10px;
}

.rnf-lsa__blog-card {
  display: flex;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--rf-border);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  transition: var(--rf-transition);
}

.rnf-lsa__blog-card:hover {
  border-color: var(--rf-rose-primary);
  background: #fafafa;
}

.rnf-lsa__blog-img {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
}

.rnf-lsa__blog-info {
  flex: 1;
  min-width: 0;
}

.rnf-lsa__blog-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--rf-ink);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rnf-lsa__blog-excerpt {
  font-size: 12px;
  color: var(--rf-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rnf-lsa__blog-date {
  font-size: 11px;
  color: var(--rf-muted);
  margin-top: 4px;
}

.rnf-lsa__favorites {
  border-top: 1px solid var(--rf-border);
  padding: 20px;
  background: #fafafa;
}

.rnf-lsa__fav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--rf-rose-primary);
}

.rnf-lsa__fav-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--rf-ink);
  margin: 0;
}

.rnf-lsa__fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.rnf-lsa__fav-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rf-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: var(--rf-transition);
}

.rnf-lsa__fav-card:hover {
  border-color: var(--rf-rose-primary);
  transform: translateY(-2px);
  box-shadow: var(--rf-shadow-hover);
}

.rnf-lsa__fav-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9f9f9;
}

.rnf-lsa__fav-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rnf-lsa__fav-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rnf-lsa__fav-info .rnf-lsa__fav-title {
  color: var(--rf-ink);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rnf-lsa__fav-price {
  color: var(--rf-rose-dark);
  font-weight: 700;
  font-size: 14px;
}

.rnf-lsa__footer {
  border-top: 1px solid var(--rf-border);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}

.rnf-lsa__cat,
.rnf-lsa__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid;
  transition: var(--rf-transition);
}

.rnf-lsa__cat {
  color: var(--rf-ink);
  border-color: var(--rf-border);
  background: #fff;
}

.rnf-lsa__cat:hover {
  border-color: var(--rf-rose-primary);
  color: var(--rf-rose-primary);
}

.rnf-lsa__all {
  color: #fff;
  border-color: var(--rf-rose-primary);
  background: var(--rf-rose-primary);
}

.rnf-lsa__all:hover {
  background: var(--rf-rose-dark);
  border-color: var(--rf-rose-dark);
}

.rnf-lsa__empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--rf-muted);
  font-weight: 500;
  font-size: 15px;
}

.rnf-lsa__empty::before {
  content: "🔍";
  display: block;
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.rnf-lsa__loading {
  padding: 60px 24px;
  text-align: center;
}

.rnf-lsa__loading::after {
  content: "";
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--rf-border);
  border-top-color: var(--rf-rose-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.rnf-lsa__loading-text {
  display: block;
  margin-top: 16px;
  color: var(--rf-muted);
  font-weight: 500;
  font-size: 14px;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .rnf-lsa__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rnf-lsa__product-list-item:nth-child(n+3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .rnf-lsa-v3 {
    max-width: 100%;
    margin: 0;
    padding: 0 12px;
  }

  .rnf-lsa__panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: 0 !important;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  .rnf-lsa__panel-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }

  .rnf-lsa__results-header {
    padding: 14px 16px;
  }

  .rnf-lsa__results-title {
    font-size: 15px;
  }

  .rnf-lsa__close-mobile {
    display: flex;
  }

  .rnf-lsa__body {
    max-height: calc(100vh - 60px);
    padding-bottom: 80px;
  }

  .rnf-lsa__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rnf-lsa__product-card,
  .rnf-lsa__product-list-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    min-height: auto;
  }

  .rnf-lsa__product-image,
  .rnf-lsa__list-image {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px;
    aspect-ratio: 1;
    flex-shrink: 0;
    border-radius: 6px;
  }

  .rnf-lsa__product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .rnf-lsa__product-info,
  .rnf-lsa__list-info {
    flex: 1;
    min-width: 0;
    padding: 0 !important;
    gap: 2px;
  }

  .rnf-lsa__product-title,
  .rnf-lsa__list-info .rnf-lsa__product-title {
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.3;
    min-height: auto !important;
    -webkit-line-clamp: 2;
    margin-bottom: 2px;
  }

  .rnf-lsa__product-price,
  .rnf-lsa__list-info .rnf-lsa__product-price {
    font-size: 14px !important;
    font-weight: 700;
    margin-top: 0 !important;
  }

  .rnf-lsa__ai-answer,
  .rnf-lsa__cat-suggestion {
    margin: 12px 16px;
    padding: 12px 14px;
    font-size: 13px;
  }

  .rnf-lsa__blog-section {
    padding: 16px;
  }

  .rnf-lsa__blog-card {
    padding: 8px;
    gap: 10px;
  }

  .rnf-lsa__blog-img {
    width: 60px;
    height: 60px;
  }

  .rnf-lsa__blog-card-title {
    font-size: 12px;
  }

  .rnf-lsa__blog-excerpt {
    font-size: 11px;
  }

  .rnf-lsa__favorites {
    padding: 16px;
  }

  .rnf-lsa__fav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .rnf-lsa__fav-card {
    border-radius: 8px;
  }

  .rnf-lsa__fav-info {
    padding: 10px;
  }

  .rnf-lsa__fav-info .rnf-lsa__fav-title {
    font-size: 12px;
  }

  .rnf-lsa__fav-price {
    font-size: 13px;
  }

  .rnf-lsa__footer {
    position: sticky;
    bottom: 0;
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border-top: 2px solid var(--rf-border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  }

  .rnf-lsa__cat,
  .rnf-lsa__all {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 12px;
  }

  .rnf-lsa__field {
    padding: 10px 12px;
    gap: 10px;
  }

  .rnf-lsa__rosy {
    height: 40px;
  }

  .rnf-lsa__input {
    font-size: 14px;
  }

  .rnf-lsa__products {
    padding: 12px 16px;
  }

@media (max-width: 480px) {
  .rnf-lsa-v3 {
    padding: 0 10px;
  }

  .rnf-lsa__rosy {
    height: 36px;
  }

  .rnf-lsa__field {
    padding: 9px 10px;
    gap: 8px;
  }

  .rnf-lsa__product-image,
  .rnf-lsa__list-image {
    width: 55px !important;
    height: 55px !important;
    min-width: 55px;
  }

  .rnf-lsa__product-title,
  .rnf-lsa__list-info .rnf-lsa__product-title {
    font-size: 12px !important;
  }

  .rnf-lsa__product-price,
  .rnf-lsa__list-info .rnf-lsa__product-price {
    font-size: 13px !important;
  }

  .rnf-lsa__blog-img {
    width: 50px;
    height: 50px;
  }

  .rnf-lsa__fav-grid {
    gap: 6px;
  }
}
