/* =========================================
   GLOBAL
========================================= */
:root {
  --fresty-primary-start: #ff8c00;
  --fresty-primary-end:   #ff4b2b;
  --fresty-dark:          #111827;
  --fresty-soft-bg:       #f3f4ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #c7d2ff 0%, #99a5f0 35%, #6c63ff 70%, #171b3a 100%);
  color: #111827;
}

/* =========================================
   BOTONES
========================================= */

/* Botón principal Fresty */
.btn-fresty {
  background: linear-gradient(135deg, var(--fresty-primary-start), var(--fresty-primary-end));
  border: none;
  color: #17110F;
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-fresty:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.2);
  filter: brightness(1.05);
}

/* Botones redondeados globales */
.btn,
.btn-sm,
.btn-lg {
  border-radius: 999px;
}

/* =========================================
   HERO BASE
========================================= */
.hero {
  background: radial-gradient(circle at top left, #ffe0b2, #fff);
}

/* Navbar en celular */
@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero .lead {
    font-size: 0.95rem;
  }

  .btn-fresty.btn-lg {
    font-size: 0.95rem;
    padding: 0.6rem 1.4rem;
  }
}

/* Mesas responsivas */
.table-responsive {
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}

/* =========================================
   IMÁGENES DE PRODUCTO
========================================= */

/* Imágenes de productos (cliente + administrador) */
.product-img-fixed {
  width: 100%;              /* Ocupa todo el ancho del contenedor */
  height: 240px;            /* Alto fijo para que todas se vean uniformes */
  object-fit: contain;      /* Muestra la imagen completa sin recortarla */
  background-color: #f8f9fa;/* Fondo clarito para cuando sobren espacios */
  padding: 8px;             /* Un pequeño margen interno */
  border-radius: 10px;      /* Bordes redondeados opcionales */
}

/* =========================================
   TARJETAS DE CATEGORÍA
========================================= */

.category-link {
  display: block;
  text-decoration: none;
}

.category-card {
  border: none;
  border-radius: 18px;
  padding: 4px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-position 0.4s ease;
  background-size: cover;
  background-position: center;
  color: #240909;
}

.category-card .card-title,
.category-card .card-text {
  color: #240909;
}

.category-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

/* Icono redondo arriba */
.category-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* Badge de acción */
.category-badge {
  background: rgba(255, 255, 255, 0.9);
  color: #222;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 999px;
}

/* TARJETAS POR CATEGORÍA CON DEGRADADO + FOTO */

/* Detalles personalizados */
.cat-detalles {
  background-image:
    linear-gradient(135deg, rgba(255,154,158,0.85), rgba(255,106,136,0.85)),
    url('../img/cat-detalles.png');
}

/* Juguetes */
.cat-juguetes {
  background-image:
    linear-gradient(135deg, rgba(246,211,101,0.85), rgba(253,160,133,0.85)),
    url('../img/cat-juguetes.png');
}

/* Librería */
.cat-libreria {
  background-image:
    linear-gradient(135deg, rgba(94,231,223,0.85), rgba(180,144,202,0.85)),
    url('../img/cat-libreria.png');
}

/* Mantenimiento y reparación de PC */
.cat-servicio {
  background-image:
    linear-gradient(135deg, rgba(102,125,182,0.85), rgba(0,130,200,0.85)),
    url('../img/cat-servicio.png');
}

/* Sublimación */
.cat-sublimacion {
  background-image:
    linear-gradient(135deg, rgba(251,194,235,0.85), rgba(161,140,209,0.85)),
    url('../img/cat-sublimacion.png');
}

/* Tecnología */
.cat-tecnologia {
  background-image:
    linear-gradient(135deg, rgba(67,206,162,0.85), rgba(24,90,157,0.85)),
    url('../img/cat-tecnologia.png');
}

/* Ajustes para móvil (categorías) */
@media (max-width: 576px) {
  .category-card {
    border-radius: 16px;
  }

  .category-card .card-body {
    padding: 14px 14px 16px;
  }

  .category-icon {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .category-card .card-title {
    font-size: 1rem;
  }

  .category-card .card-text {
    font-size: 0.85rem;
  }
}

/* =========================================
   HERO FRESTY ANIMADO
========================================= */

.hero-animated {
  position: relative; /* importante para ::before y ::after */
  overflow: hidden;
  z-index: 0;
}

.hero-animated::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -40%;
  bottom: -40%;
  left: -40%;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 183, 197, 0.40), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(125, 196, 255, 0.35), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(255, 230, 150, 0.40), transparent 55%);
  opacity: 0.8;
  z-index: -1;
  animation: heroGlow 12s ease-in-out infinite alternate;
}

.hero-animated::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.90), rgba(255,255,255,1));
  z-index: -1;
}

/* Animaciones de entrada */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes heroGlow {
  0%   { transform: scale(1);   filter: blur(0px); }
  50%  { transform: scale(1.05); filter: blur(2px); }
  100% { transform: scale(1.02); filter: blur(1px); }
}

.hero-title {
  animation: heroFadeUp 0.7s ease-out both;
}

.hero-subtitle {
  animation: heroFadeUp 0.9s ease-out both;
}

.hero-cta {
  animation: heroFadeUp 1.1s ease-out both;
  position: relative;
  border-radius: 999px;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.12);
}

/* Contenedor con borde degradado del hero */
.hero-border-wrapper {
  position: relative;
  padding: 10px;              /* Grosor del borde */
  border-radius: 26px;        /* Bordes redondeados generales */
  margin-left: auto;
  margin-right: auto;
  max-width: 960px;
  z-index: 0;                 /* para ordenar capas internas */
}

/* Capa del borde degradado animado */
.hero-border-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    #ff7eb9,
    #ff65a3,
    #7afcff,
    #feff9c,
    #fff740
  );
  background-size: 300% 300%;
  animation: borderFlowFresty 6s ease infinite;
  z-index: -1;
}

/* Fondo blanco detrás para evitar que el degradado se salga */
.hero-border-wrapper::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  left: 6px;
  border-radius: 22px;
  background: #ffffff;
  z-index: -2;
}

/* Hero interno respetando el radio */
.hero-border-wrapper .hero {
  border-radius: 22px;
}

@keyframes borderFlowFresty {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ajustes responsive del hero */
@media (max-width: 768px) {
  .hero-border-wrapper {
    margin-left: 1rem;
    margin-right: 1rem;
    padding: 2px;
    border-radius: 22px;
  }

  .hero-border-wrapper::after {
    top: 4px;
    right: 4px;
    bottom: 4px;
    left: 4px;
    border-radius: 18px;
  }

  .hero-border-wrapper .hero {
    border-radius: 18px;
  }
}

/* =========================================
   BLOQUES GENERALES FRESTY
========================================= */
.fresty-block {
  position: relative;
  overflow: hidden;
}

/* Efecto de fondo suave para todos los bloques */
.fresty-block::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  bottom: -20%;
  left: -20%;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 126, 185, 0.15), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(122, 252, 255, 0.12), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(254, 255, 156, 0.12), transparent 55%);
  opacity: 0.8;
  z-index: -2;
  animation: frestyBgSoft 18s ease-in-out infinite alternate;
}

@keyframes frestyBgSoft {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-10px, 10px, 0) scale(1.05); }
  100% { transform: translate3d(10px, -10px, 0) scale(1.02); }
}

/* Contenedor para que el contenido esté por encima del fondo animado */
.fresty-block > .container {
  position: relative;
  z-index: 1;
}

/* =========================================
   BLOQUES ESPECÍFICOS
========================================= */

/* CARRUSEL: fondo oscuro degradado */
.fresty-block-carousel {
  background: radial-gradient(circle at top, #141e30, #243b55);
}

/* HERO: fondo claro con degradado animado */
.fresty-block-hero {
  background: linear-gradient(135deg, #fff6fb, #f0f7ff);
}

/* CATEGORÍAS: fondo pastel con ondas */
.fresty-block-categorias {
  background: linear-gradient(135deg, #fdfbff 0%, #f3f5ff 40%, #fdfbff 100%);
}

.fresty-block-categorias::before {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 126, 185, 0.25), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(122, 252, 255, 0.25), transparent 55%);
  animation: frestyCategoriasWave 20s ease-in-out infinite alternate;
}

@keyframes frestyCategoriasWave {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(20px, -10px, 0) scale(1.05); }
  100% { transform: translate3d(-10px, 15px, 0) scale(1.03); }
}

/* Efecto hover en cards de categorías dentro del bloque */
.fresty-block-categorias .category-card {
  border: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fresty-block-categorias .category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

/* UBICACIÓN */
.fresty-block-ubicacion {
  background: radial-gradient(circle at top, #f0f4ff, #dfe7ff);
}

/* REDES SOCIALES */
.fresty-block-redes {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ffe1ff 100%);
}

.fresty-block-redes::before {
  background:
    radial-gradient(circle at 0% 50%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(circle at 100% 50%, rgba(255, 255, 255, 0.25), transparent 55%);
  animation: frestyRedesGlow 16s ease-in-out infinite alternate;
}

@keyframes frestyRedesGlow {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(-15px, 10px, 0) scale(1.04); }
  100% { transform: translate3d(15px, -10px, 0) scale(1.02); }
}

/* =========================================
   CONTORNO (BORDE) DEGRADADO GENÉRICO
========================================= */
.hero-gradient-border {
  position: relative;
  padding: 3rem 1rem;
  border-radius: 22px;
}

/* Borde degradado externo */
.hero-gradient-border::before {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  bottom: -4px;
  left: -4px;
  border-radius: 26px;
  background: linear-gradient(
    120deg,
    #ff7eb9,
    #ff65a3,
    #7afcff,
    #feff9c,
    #fff740
  );
  background-size: 300% 300%;
  animation: borderFlow 6s ease infinite;
  z-index: -1;
}

/* Fondo blanco dentro del borde */
.hero-gradient-border::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: white;
  z-index: -1;
}

/* Animación suave del borde */
@keyframes borderFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* =========================================
   FILTROS TIENDA
========================================= */
.card .form-label.fw-semibold {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card .form-control,
.card .form-select {
  border-radius: 10px;
}

/* =========================================
   DASHBOARD FRESTY
========================================= */

body.bg-dashboard {
  background: radial-gradient(circle at top left, #ff9a9e 0, #fad0c4 35%, #fbc2eb 65%, #a18cd1 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Contenedor principal del dashboard */
.dashboard-wrapper {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
}

/* Título del dashboard */
.dashboard-title {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #1f2933;
}

/* Subtítulo */
.dashboard-subtitle {
  color: #4b5563;
  font-size: 0.95rem;
}

/* ===== CARDS ESTADÍSTICAS ===== */

.card-stat {
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffffee, #f9fafb);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, translate 0.18s;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

.card-stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s ease-out;
  z-index: -1;
  pointer-events: none;
}

.card-stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
}

.card-stat:hover::before {
  opacity: 1;
}

.card-stat-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  margin-bottom: 4px;
}

.card-stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
}

.card-stat-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: #92400e;
}

/* Icono circular en la card */
.icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

/* Puedes cambiar los colores según el tipo de card */
.icon-circle.blue {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #ffffff;
}

.icon-circle.green {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  color: #ffffff;
}

.icon-circle.orange {
  background: linear-gradient(135deg, #f97316, #fdba74);
  color: #ffffff;
}

.icon-circle.purple {
  background: linear-gradient(135deg, #a855f7, #c4b5fd);
  color: #ffffff;
}

/* ===== CARDS GENERALES (para tablas, gráficos, etc.) ===== */

.card-glass {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
}

/* ===== ANIMACIONES GENERALES ===== */

.fade-in-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.5s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.08s; }
.fade-in-delay-2 { animation-delay: 0.16s; }
.fade-in-delay-3 { animation-delay: 0.24s; }
.fade-in-delay-4 { animation-delay: 0.32s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== CARDS PARA LISTADOS (PRODUCTOS, CATEGORÍAS, ETC.) ===== */

.card-list {
  border-radius: 18px;
  border: none;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out;
}

.card-list:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

/* =========================================
   CARRUSEL FRESTY PROFESIONAL
========================================= */

.fresty-carousel-wrapper {
  position: relative;
}

.fresty-carousel-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Altura fija y recorte elegante de las imágenes */
.fresty-carousel-img {
  height: 260px;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease, filter 0.8s ease;
}

@media (min-width: 768px) {
  .fresty-carousel-img {
    height: 420px;
  }
}

/* Contenedor para overlay y animaciones */
.fresty-carousel-media {
  position: relative;
  overflow: hidden;
}

/* Degradado encima de la imagen para contraste de texto */
.fresty-carousel-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(15,23,42,0.8) 0%, rgba(15,23,42,0.4) 45%, transparent 85%);
  pointer-events: none;
}

/* Zoom suave al estar activo */
.fresty-carousel-item.active .fresty-carousel-img {
  transform: scale(1.03);
  filter: brightness(1.05);
}

/* Zoom extra en hover (desktop) */
.fresty-carousel-media:hover .fresty-carousel-img {
  transform: scale(1.06);
}

/* Indicadores tipo pill */
.fresty-carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background-color: rgba(255,255,255,0.4);
  transition: width 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

.fresty-carousel-indicators .active {
  width: 28px;
  background-color: #ffb347;
  transform: translateY(-1px);
}

/* Controles laterales */
.fresty-carousel-control {
  width: 8%;
}

.fresty-carousel-control .carousel-control-prev-icon,
.fresty-carousel-control .carousel-control-next-icon {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
}

/* Texto del carrusel */
.fresty-carousel-caption {
  max-width: 520px;
  animation: frestyCarouselFadeUp 0.8s ease-out both;
}

.fresty-carousel-title {
  text-shadow: 0 4px 16px rgba(0,0,0,0.6);
}

.fresty-carousel-text {
  font-size: 1.05rem;
}

/* Animación de entrada del texto del carrusel */
@keyframes frestyCarouselFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Ajustes para móvil: carrusel más compacto */
@media (max-width: 576px) {
  .fresty-block-carousel {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  .fresty-carousel-inner {
    border-radius: 1.5rem;
  }

  /* En móvil el caption ya está controlado con d-none d-md-block en HTML */
}
