/* ============================================
   WIDGET RECENSIONI - STILI UNIFICATI
   ============================================ */

   .reviews-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1300px;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .reviews-widget * {
    box-sizing: border-box;
  }
  
  /* Reset button styles */
  .reviews-widget button {
    font-family: inherit;
  }
  
  /* ============================================
     FILTRI (STILE TOUS LES AVIS)
     ============================================ */
  
  .avis-all-filters-row {
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  
  .avis-filter-divider {
    width: 1px;
    height: 28px;
    background: #E5E7EB;
  }
  
  /* Dropdown Custom */
  .avis-filter-dropdown {
    position: relative;
  }
  
  .avis-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 10.5px;
    padding: 7px 12px;
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8.75px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12.25px;
    color: #363636;
    transition: background 0.2s;
    min-height: 32.5px;
  }
  
  .avis-dropdown-trigger:hover {
    background: #F9FAFB;
  }
  
  .avis-filter-icon {
    width: 17.5px;
    height: 17.5px;
    color: #363636;
    flex-shrink: 0;
  }
  
  .avis-dropdown-label {
    white-space: nowrap;
  }
  
  .avis-dropdown-arrow {
    width: 14px;
    height: 14px;
    color: #6B7280;
    transition: transform 0.2s;
    flex-shrink: 0;
  }
  
  .avis-dropdown-trigger.active .avis-dropdown-arrow {
    transform: rotate(180deg);
  }
  
  .avis-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8.75px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    overflow: hidden;
  }
  
  .avis-dropdown-menu.show {
    display: block;
  }
  
  .avis-dropdown-item {
    padding: 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 12.25px;
    color: #363636;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
  }
  
  .avis-dropdown-item:hover {
    background: #F9FAFB;
  }
  
  .avis-dropdown-item.active {
    background: #E5E7EB;
    font-weight: 500;
  }
  
  /* Toggle Switch */
  .avis-filter-toggle {
    display: flex;
    align-items: center;
    gap: 10.5px;
  }
  
  .avis-toggle-label {
    font-family: 'Inter', sans-serif;
    font-size: 12.25px;
    color: #363636;
    line-height: 17.5px;
  }
  
  .avis-toggle-switch {
    position: relative;
    width: 38.5px;
    height: 21px;
    cursor: pointer;
  }
  
  .avis-toggle-track {
    position: absolute;
    inset: 0;
    background: #E5E7EB;
    border-radius: 100px;
    transition: background 0.2s;
  }
  
  .avis-toggle-switch[data-active="true"] .avis-toggle-track {
    background: #3B82F6;
  }
  
  .avis-toggle-thumb {
    position: absolute;
    top: 3.5px;
    left: 3.5px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
  }
  
  .avis-toggle-switch[data-active="true"] .avis-toggle-thumb {
    transform: translateX(17.5px);
  }
  
  /* Sort */
  .avis-filter-sort {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  
  .avis-sort-label {
    font-family: 'Inter', sans-serif;
    font-size: 12.25px;
    color: #6B7280;
    line-height: 17.5px;
  }
  
  /* ============================================
     GRID RECENSIONI - RESPONSIVE 4-3-2-1
     ============================================ */
  
  .avis-reviews-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    margin-bottom: 32px;
  }
  
  @media (min-width: 480px) {
    .avis-reviews-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 24px;
    }
  }
  
  @media (min-width: 900px) {
    .avis-reviews-grid {
      grid-template-columns: repeat(3, 1fr);
      gap: 28px;
    }
  }
  
  @media (min-width: 1280px) {
    .avis-reviews-grid {
      grid-template-columns: repeat(4, 1fr);
      gap: 32px;
    }
  }
  
  /* ============================================
     CARD RECENSIONI (STILE TOUS LES AVIS)
     ============================================ */
  
  .avis-card {
    background: #FAFAFA;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: background-color 0.2s ease;
    min-width: 0;
  }
  
  .avis-card:hover {
    background: #F5F5F5;
  }
  
  .avis-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  
  .avis-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
  }
  
  .avis-avatar {
    width: 35px;
    height: 35px;
    background: #E5E7EB;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .avis-avatar-text {
    color: #364153;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
  }
  
  .avis-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }
  
  .avis-author-name {
    color: #363636;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .avis-author-date {
    color: #9CA3AF;
    font-size: 12.25px;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    margin: 0;
  }
  
  .avis-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid #99A1AF;
    border-radius: 6.75px;
    font-size: 10.5px;
    font-weight: 500;
    color: #364153;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.09px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .avis-verified-icon {
    width: 14px;
    height: 14px;
  }
  
  .avis-stars {
    display: flex;
    gap: 2px;
    align-items: center;
  }
  
  .avis-star {
    width: 14px;
    height: 14px;
    color: #FDC700;
  }
  
  .avis-star-empty {
    color: #D1D5DB;
  }
  
  .avis-title {
    font-size: 14px;
    font-weight: 600;
    color: #363636;
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.4;
  }
  
  .avis-comment {
    color: #4B5563;
    font-size: 12.25px;
    font-family: 'Inter', sans-serif;
    line-height: 1.43;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .avis-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
    margin-top: 8px;
  }
  
  @media (min-width: 768px) {
    .avis-photos {
      grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
      gap: 8px;
    }
  }
  
  .avis-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  
  .avis-photo:hover {
    opacity: 0.85;
  }
  
  .avis-recommend {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin-top: 8px;
  }
  
  .avis-recommend-icon {
    width: 14px;
    height: 14px;
    color: #6B7280;
  }
  
  .avis-recommend-text {
    color: #6B7280;
    font-size: 12.25px;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    margin: 0;
  }
  
  /* ============================================
     LIGHTBOX, MODAL, LOADING
     ============================================ */
  
  /* Loading spinner */
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  .reviews-widget .spinner {
    border: 3px solid #f3f4f6;
    border-top-color: #363636;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
  }
  
  /* Lightbox */
  .reviews-widget .lightbox {
    transition: opacity 0.3s;
    z-index: 1000099 !important;
  }
  
  .reviews-widget .lightbox-image {
    animation: fadeIn 0.3s;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Modal */
  .modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000099 !important;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-content {
    position: relative;
    max-width: 500px;
    margin: 10vh auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
  }
  
  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* ============================================
     RESPONSIVE
     ============================================ */
  
     @media (max-width: 768px) {
        .avis-all-filters-row {
          flex-direction: column;
          align-items: stretch;
        }
        
        .avis-filter-divider {
          display: none;
        }
        
        .avis-filter-dropdown,
        .avis-filter-toggle,
        .avis-filter-sort,
        .leave-review-btn {
          width: 100%;
        }
        
        .avis-dropdown-trigger {
          width: 100%;
          justify-content: space-between;
        }
        
        .leave-review-btn {
          justify-content: center;
        }
        
        .avis-card {
          padding: 16px;
        }
        
        .avis-verified-badge {
          font-size: 9px;
          padding: 3px 6px;
        }
      }
  
  /* Responsive grid fix - SOLO per stats, NON per azioni */
  @media (min-width: 1024px) {
    .reviews-widget > div > div[style*="grid-template-columns: 1fr"][style*="gap: 0"] {
      grid-template-columns: 1fr 1fr !important;
    }
  }
  
  /* Hover effects */
  .reviews-widget button:not(:disabled):hover {
    opacity: 0.9;
    transition: opacity 0.2s;
  }
  
  /* Focus states for accessibility */
  .reviews-widget button:focus,
  .reviews-widget input:focus,
  .reviews-widget textarea:focus,
  .reviews-widget select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
  }
  
  /* Disabled state */
  .reviews-widget button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }
  
  /* Smooth scrolling */
  .reviews-widget {
    scroll-behavior: smooth;
  }

/* ===== RIMUOVI OUTLINE BLU AL FOCUS ===== */

.leave-review-btn:focus,
.leave-review-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.avis-dropdown-trigger:focus,
.avis-dropdown-trigger:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.avis-toggle-switch:focus,
.avis-toggle-switch:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.filter-photos-btn:focus,
.filter-photos-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.rating-filter-btn:focus,
.rating-filter-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Generale per tutti i button */
button:focus,
button:focus-visible {
  outline: none !important;
}