/* ========================================
   RESTAURANTES MÁS PEDIDOS - CARRUSEL
   Diseño alineado con categoriasVisuales.css
   ======================================== */

   .restaurantes-populares-section {
    margin: 2.5rem auto;
    padding: 2.2rem 1.75rem 1.75rem;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-smooth);
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    max-width: calc(100% - 2rem);
    width: 100%;
  }
  
  /* Borde superior animado */
  .restaurantes-populares-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    animation: gradient-flow 3s ease infinite;
  }
  
  /* Brillo decorativo */
  .restaurantes-populares-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.03) 0%, transparent 70%);
    pointer-events: none;
  }
  
  .restaurantes-populares-section.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* ========================================
     TÍTULO
     ======================================== */
  .titulo-restaurantes-populares {
    font-size: 1.75rem;
    color: #1a202c;
    text-align: center;
    margin-bottom: 1.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    position: relative;
    z-index: 1;
  }
  
  .titulo-restaurantes-populares .titulo-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.32);
  }
  
  .titulo-restaurantes-populares .titulo-icono svg {
    width: 20px;
    height: 20px;
    color: white;
  }
  
  /* ========================================
     CONTENEDOR CARRUSEL
     ======================================== */
  .restaurantes-populares-container {
    position: relative;
    width: 100%;
    padding: 0 3.25rem;
  }
  
  .restaurantes-populares-scroll {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    padding: 0.6rem 0.3rem 1rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding: 0 0.5rem;
  }
  
  .restaurantes-populares-scroll::-webkit-scrollbar {
    display: none;
  }
  
  /* ========================================
     TARJETA — un poco más ancha y alta
     ======================================== */
  .restaurante-popular-card {
    flex: 0 0 190px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    text-align: center;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: slide-in-up 0.6s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.09s);
  }
  
  /* Fondo animado en hover */
  .restaurante-popular-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
    border-radius: 20px;
    pointer-events: none;
    z-index: 0;
  }
  
  /* Borde superior animado */
  .restaurante-popular-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
    border-radius: 20px 20px 0 0;
    z-index: 3;
  }
  
  .restaurante-popular-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--shadow-hover);
    border-color: rgba(102, 126, 234, 0.3);
  }
  
  .restaurante-popular-card:hover::before {
    opacity: 0.05;
  }
  
  .restaurante-popular-card:hover::after {
    transform: scaleX(1);
    animation: gradient-flow 2s ease infinite;
  }
  
  .restaurante-popular-card:active {
    transform: translateY(-6px) scale(0.98);
  }
  
  /* ========================================
     IMAGEN DEL RESTAURANTE — más alta
     ======================================== */
  .restaurante-popular-imagen {
    width: 100%;
    height: 118px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0, #e8e8f0);
    border-radius: 18px 18px 0 0;
    z-index: 1;
  }
  
  .restaurante-popular-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
  }
  
  .restaurante-popular-card:hover .restaurante-popular-imagen img {
    transform: scale(1.08);
  }
  
  /* Overlay gradiente sobre la imagen */
  .restaurante-popular-imagen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.22), transparent);
    pointer-events: none;
    z-index: 2;
  }
  
  /* Fallback SVG cuando no hay imagen */
  .restaurante-popular-imagen .imagen-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  }
  
  .restaurante-popular-imagen .imagen-fallback svg {
    width: 46px;
    height: 46px;
    color: #667eea;
    opacity: 0.4;
  }
  
  /* ========================================
     LOGO FLOTANTE — más grande y visible
     ======================================== */
  .restaurante-popular-logo-wrapper {
    position: relative;
    margin-top: -26px;
    z-index: 4;
    display: flex;
    justify-content: center;
  }
  
  .restaurante-popular-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3.5px solid #ffffff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }
  
  .restaurante-popular-card:hover .restaurante-popular-logo {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.38);
    transform: scale(1.1);
  }
  
  .restaurante-popular-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }
  
  .restaurante-popular-logo .logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  }
  
  .restaurante-popular-logo .logo-fallback svg {
    width: 26px;
    height: 26px;
    color: #667eea;
    opacity: 0.65;
  }
  
  /* ========================================
     INFO (nombre + botón)
     ======================================== */
  .restaurante-popular-info {
    padding: 0.55rem 0.8rem 0.9rem;
    position: relative;
    z-index: 1;
  }
  
  .restaurante-popular-nombre {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.6em;
    word-break: break-word;
    margin-bottom: 0.6rem;
  }
  
  /* ========================================
     BOTÓN "PEDIR"
     ======================================== */
  .restaurante-popular-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.45rem 1.1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    pointer-events: none;
  }
  
  .restaurante-popular-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
  }
  
  .restaurante-popular-card:hover .restaurante-popular-btn {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
    transform: scale(1.06);
  }
  
  .restaurante-popular-card:hover .restaurante-popular-btn svg {
    transform: translateX(3px);
  }
  
  /* ========================================
     BOTONES DE NAVEGACIÓN
     ======================================== */
  .restaurantes-populares-container .scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    color: #667eea;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
  }
  
  .restaurantes-populares-container .scroll-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
  }
  
  .restaurantes-populares-container .scroll-btn:hover {
    transform: translateY(-50%) scale(1.1);
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    color: white;
  }
  
  .restaurantes-populares-container .scroll-btn:hover::before {
    opacity: 1;
  }
  
  .restaurantes-populares-container .scroll-btn span {
    position: relative;
    z-index: 1;
  }
  
  .restaurantes-populares-container .scroll-btn-left  { left: 0; }
  .restaurantes-populares-container .scroll-btn-right { right: 0; }
  
  /* ========================================
     LOADING SKELETON
     ======================================== */
  .restaurantes-populares-loading {
    display: flex;
    gap: 1.1rem;
    padding: 0.6rem 0;
  }
  
  .restaurante-popular-skeleton {
    flex: 0 0 190px;
    height: 218px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8f0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
  }
  
  @keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  
  /* ========================================
     RESPONSIVE
     ======================================== */
  
  @media (min-width: 1200px) {
    .restaurantes-populares-section {
      max-width: 1200px;
      margin: 2.5rem auto;
      padding: 2.2rem 1.75rem;
    }
    .restaurante-popular-card     { flex: 0 0 185px; }
    .restaurante-popular-skeleton { flex: 0 0 185px; }
    .titulo-restaurantes-populares { font-size: 1.6rem; }
  }
  
  @media (min-width: 1440px) {
    .restaurantes-populares-section { max-width: 1320px; }
    .restaurante-popular-card     { flex: 0 0 180px; }
    .restaurante-popular-skeleton { flex: 0 0 180px; }
  }
  
  /* Tablets grandes */
  @media (max-width: 1024px) {
    .restaurantes-populares-section   { padding: 2rem 1.5rem; }
    .restaurantes-populares-container { padding: 0 2.75rem; }
  }
  
  /* Tablets */
  @media (max-width: 768px) {
    .restaurantes-populares-section {
      margin: 1.75rem auto;
      padding: 1.75rem 1.25rem;
      max-width: calc(100% - 1rem);
      border-radius: 22px;
    }
    .titulo-restaurantes-populares {
      font-size: 1.45rem;
      margin-bottom: 1.4rem;
    }
    .restaurantes-populares-container { padding: 0 2.4rem; }
    .restaurante-popular-card         { flex: 0 0 172px; }
    .restaurante-popular-imagen        { height: 105px; }
    .restaurante-popular-logo          { width: 46px; height: 46px; }
    .restaurante-popular-logo-wrapper  { margin-top: -23px; }
    .restaurante-popular-skeleton      { flex: 0 0 172px; height: 200px; }
    .restaurantes-populares-container .scroll-btn { width: 42px; height: 42px; }
  }
  
  /* Móviles grandes */
  @media (max-width: 640px) {
    .restaurante-popular-card     { flex: 0 0 158px; }
    .restaurante-popular-imagen   { height: 95px; }
    .restaurante-popular-nombre   { font-size: 0.82rem; }
    .restaurante-popular-btn      { font-size: 0.7rem; padding: 0.4rem 0.9rem; }
    .restaurante-popular-skeleton { flex: 0 0 158px; height: 188px; }
  }
  
  /* Móviles pequeños */
  @media (max-width: 480px) {
    .restaurantes-populares-section {
      padding: 1.4rem 0.9rem;
      border-radius: 18px;
    }
    .titulo-restaurantes-populares {
      font-size: 1.25rem;
      gap: 0.5rem;
      margin-bottom: 1.2rem;
    }
    .titulo-restaurantes-populares .titulo-icono {
      width: 32px;
      height: 32px;
      border-radius: 9px;
    }
    .titulo-restaurantes-populares .titulo-icono svg { width: 17px; height: 17px; }
    .restaurantes-populares-container { padding: 0 1.75rem; }
    .restaurante-popular-card {
      flex: 0 0 148px;
      border-radius: 17px;
    }
    .restaurante-popular-imagen {
      height: 86px;
      border-radius: 15px 15px 0 0;
    }
    .restaurante-popular-logo          { width: 42px; height: 42px; border-width: 3px; }
    .restaurante-popular-logo-wrapper  { margin-top: -21px; }
    .restaurante-popular-logo .logo-fallback svg { width: 22px; height: 22px; }
    .restaurante-popular-info          { padding: 0.4rem 0.65rem 0.75rem; }
    .restaurante-popular-nombre        { font-size: 0.78rem; margin-bottom: 0.5rem; }
    .restaurante-popular-btn           { font-size: 0.65rem; padding: 0.35rem 0.8rem; }
    .restaurante-popular-btn svg       { width: 12px; height: 12px; }
    .restaurantes-populares-container .scroll-btn { width: 36px; height: 36px; }
    .restaurante-popular-skeleton      { flex: 0 0 148px; height: 180px; }
  }
  
  /* Móviles muy pequeños */
  @media (max-width: 380px) {
    .restaurante-popular-card         { flex: 0 0 132px; }
    .restaurante-popular-imagen       { height: 76px; }
    .restaurante-popular-logo         { width: 36px; height: 36px; }
    .restaurante-popular-logo-wrapper { margin-top: -18px; }
    .restaurantes-populares-container .scroll-btn { display: none; }
    .restaurante-popular-skeleton     { flex: 0 0 132px; height: 165px; }
  }
  
  /* Dispositivos táctiles */
  @media (hover: none) and (pointer: coarse) {
    .restaurante-popular-card:active {
      transform: scale(0.96);
    }
    .restaurante-popular-card:active .restaurante-popular-btn {
      box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    }
  }