/* ============================================
   ESTILOS PARA INDEX.PHP - CATÁLOGO DE RINES
   ============================================ */

/* Variables CSS */
:root {
  --brand-yellow: #ffcc00;
  --brand-blue: #3b82f6;
  --dark-blue: #1e3a8a;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --brand-purple: #a855f7;
  --brand-yellow-rgb: 245, 180, 1;
  --brand-blue-rgb: 59, 130, 246;
  --text-light: #E5E7EB;
  --text-dark: #111827;
  --card-image-bg: #212936;
}

/* Reset y Base */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--brand-yellow-rgb), 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(var(--brand-yellow-rgb), 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--brand-yellow-rgb), 0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes rotate-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

@keyframes spin-slow {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 5px rgba(var(--brand-yellow-rgb), 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(var(--brand-yellow-rgb), 0.7);
  }

  100% {
    box-shadow: 0 0 5px rgba(var(--brand-yellow-rgb), 0.5);
  }
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utilidades */
.fadeInUp {
  animation: fadeInUp 0.8s forwards;
}

.delayed-100 {
  animation-delay: 100ms;
}

.delayed-200 {
  animation-delay: 200ms;
}

.delayed-300 {
  animation-delay: 300ms;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 1.5em;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 3em;
}

.shimmer-effect {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

.animate-glow {
  animation: pulse-glow 2s infinite;
}

/* Dividers */
.fancy-divider {
  position: relative;
  height: 80px;
  overflow: hidden;
  z-index: 1;
}

.divider-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.wave-divider {
  position: absolute;
  width: 100%;
  height: 60px;
  left: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23111827' opacity='0.5'%3E%3C/path%3E%3C/svg%3E");
  background-size: cover;
}

.diamond-divider {
  position: relative;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--brand-yellow) 0%, #f59e0b 100%);
  transform: rotate(45deg);
  margin: 0 auto;
  box-shadow: 0 0 15px rgba(var(--brand-yellow-rgb), 0.5);
}

.diamond-divider::before,
.diamond-divider::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 1px solid var(--brand-yellow);
  opacity: 0.5;
  animation: pulse 2s infinite;
}

.diamond-divider::after {
  animation-delay: 1s;
}

.divider-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-yellow), transparent);
  width: 80%;
  max-width: 300px;
  margin: 0 auto;
}

.circle-divider {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue) 0%, #2563eb 100%);
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(var(--brand-blue-rgb), 0.5);
}

/* Títulos */
.fancy-title {
  position: relative;
  display: inline-block;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #f3f4f6, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
  padding-bottom: 0.4em;
  /* Increased to ensure descender visibility */
  padding-top: 0.1em;
  line-height: 1.4 !important;
  /* Increased line-height significantly */
}

.fancy-title .highlight {
  background: linear-gradient(to right, var(--brand-yellow), #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.title-decoration {
  position: relative;
  width: 100%;
  height: 10px;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-line {
  height: 2px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--brand-yellow), transparent);
  margin: 0 4px;
}

.title-diamond {
  width: 10px;
  height: 10px;
  background: var(--brand-yellow);
  transform: rotate(45deg);
  margin: 0 4px;
}

.title-circle {
  width: 6px;
  height: 6px;
  background: var(--brand-blue);
  border-radius: 50%;
  margin: 0 4px;
}

/* Patrones de fondo */
.bg-pattern-dots {
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Testimonios */
.testimonial-card {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideUp 0.8s forwards;
}

/* Scroll personalizado */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

/* Swiper */
.swiper-button-next,
.swiper-button-prev {
  color: var(--brand-yellow, #ffcc00);
  background-color: rgba(31, 41, 55, 0.7);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 10;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background-color: rgba(55, 65, 81, 0.9);
  color: #fff;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 1.25rem;
  font-weight: bold;
}

.swiper-button-disabled {
  opacity: 0.3;
  cursor: auto;
  pointer-events: none;
}

.nuevos-productos-swiper {
  padding-left: 10px;
  padding-right: 10px;
  box-sizing: border-box;
}

.nuevos-productos-carousel-container .swiper-slide {
  width: auto;
  box-sizing: border-box;
}

/* Touch Scroll */
@media (max-width: 768px) {
  .touch-scroll:not(.swiper-container) {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .touch-scroll:not(.swiper-container)::-webkit-scrollbar {
    display: none;
  }

  .touch-scroll:not(.swiper-container)>* {
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  button,
  a {
    touch-action: manipulation;
  }

  .swiper-button-next,
  .swiper-button-prev {
    width: 36px;
    height: 36px;
  }

  .swiper-button-next::after,
  .swiper-button-prev::after {
    font-size: 1rem;
  }

  .swiper-button-prev {
    left: 5px;
  }

  .swiper-button-next {
    right: 5px;
  }
}

/* Optimizaciones móvil para productos nuevos */
@media (max-width: 639px) {
  .nuevos-productos-carousel-container {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .nuevos-productos-swiper {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .nuevos-productos-swiper .swiper-slide {
    /* Ancho fijo para efecto 'peek' centrado */
    width: 85% !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-sizing: border-box;
  }

  /* Asegurar que el wrapper tenga espacio para centrar la última slide */
  .nuevos-productos-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
    transform: translate3d(0, 0, 0);
  }

  /* Asegurar que el contenedor del swiper tenga el ancho correcto */
  .nuevos-productos-swiper .swiper-container {
    width: 100%;
    overflow: hidden;
  }

  .nuevos-productos-swiper .swiper-slide>* {
    width: 100%;
    box-sizing: border-box;
    will-change: auto;
  }

  .nuevos-productos-swiper .swiper-slide .aspect-square {
    width: 100%;
    padding-top: 100%;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
  }

  .nuevos-productos-swiper .swiper-slide .aspect-square img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    transform: translateZ(0);
    image-rendering: -webkit-optimize-contrast;
  }

  .nuevos-productos-swiper .swiper-slide span[class*="bg-"][class*="text-"],
  .nuevos-productos-swiper .swiper-slide a[class*="bg-"][class*="text-"] {
    font-size: 0.85rem !important;
    padding: 5px 9px !important;
    margin: 3px !important;
    line-height: 1.3 !important;
    display: inline-flex !important;
    align-items: center !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
  }

  .nuevos-productos-swiper .swiper-slide .tag-nuevo,
  .nuevos-productos-swiper .swiper-slide div[class*="absolute"] span[class*="bg-blue"] {
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
    font-weight: 600 !important;
  }

  .nuevos-productos-swiper {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: scroll-position;
  }

  .nuevos-productos-swiper .swiper-wrapper {
    transform: translateZ(0);
    will-change: transform;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 375px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  section {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .fancy-title {
    font-size: 1.375rem !important;
    margin-bottom: 0.5rem;
  }

  .badge-container {
    padding: 0.375rem 0.625rem;
  }

  .badge-container .text-xs {
    font-size: 0.625rem;
  }

  .metrics-card {
    padding: 0.5rem !important;
    min-height: auto;
  }

  .metrics-card .icon-container {
    width: 1.5rem !important;
    height: 1.5rem !important;
    margin-bottom: 0.25rem !important;
  }

  .metrics-card .icon-container i {
    font-size: 0.65rem !important;
  }

  .metrics-card h3 {
    font-size: 1rem !important;
    line-height: 1.25rem !important;
    margin-bottom: 0.125rem !important;
  }

  .metrics-card p {
    font-size: 0.6rem !important;
    line-height: 1rem !important;
  }

  button,
  a,
  .tab-btn {
    min-height: 40px;
  }

  .touch-scroll:not(.swiper-container) {
    padding-bottom: 0.5rem;
    margin-bottom: 0.25rem;
  }

  .promo-card .badge {
    transform: scale(0.75);
  }

  .promo-card-container .bg-gray-900>.p-4,
  .promo-card-container .bg-gray-900>.p-5 {
    padding: 0.625rem;
  }

  .promo-card-container h3 {
    font-size: 0.9rem;
  }

  .promo-card-container .text-xl.sm\:text-2xl {
    font-size: 1rem;
  }

  .promo-card-container .countdown-item div:first-child {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.65rem;
  }

  .promo-card-container .countdown-item .text-\[8px\] {
    font-size: 0.45rem;
  }

  .title-decoration {
    margin-bottom: 0.625rem;
  }

  .category-card-image {
    height: 9rem;
  }

  .category-card-content {
    padding: 0.625rem;
  }

  .category-card-content h3 {
    font-size: 1rem;
  }

  .category-card-content p {
    font-size: 0.7rem;
  }

  .category-card-content .text-yellow-500 {
    font-size: 0.8rem;
  }

  .category-card-content .text-xs {
    font-size: 0.6rem;
  }

  .testimonial-card .bg-gradient-to-br.from-gray-800.to-gray-900.rounded-xl {
    padding: 0.625rem;
  }

  .testimonial-card h3 {
    font-size: 0.8rem;
  }

  .testimonial-card .text-gray-300.italic {
    font-size: 0.7rem;
  }

  .testimonial-card .w-10.h-10 {
    width: 1.75rem;
    height: 1.75rem;
  }

  .testimonial-card .text-\[10px\] {
    font-size: 0.55rem;
  }

  .testimonial-card .text-xs {
    font-size: 0.65rem;
  }

  .testimonial-card .h-4.w-4 {
    width: 0.8rem;
    height: 0.8rem;
  }

  .final-cta-section h2 {
    font-size: 1.25rem;
  }

  .final-cta-section p {
    font-size: 0.8rem;
  }

  .final-cta-section .flex.space-x-2>div,
  .final-cta-section .flex.space-x-3>div {
    padding: 0.4rem;
  }

  .final-cta-section .w-8.h-8,
  .final-cta-section .w-10.h-10 {
    width: 1.75rem;
    height: 1.75rem;
  }

  .final-cta-section .w-8.h-8 i,
  .final-cta-section .w-10.h-10 i {
    font-size: 0.8rem;
  }

  .final-cta-section .text-xs {
    font-size: 0.6rem;
  }

  .final-cta-section .text-sm {
    font-size: 0.7rem;
  }

  .final-cta-section a span {
    font-size: 0.8rem;
  }

  .final-cta-section a i {
    margin-right: 0.4rem;
  }
}

/* Soporte Safari */
@supports (-webkit-touch-callout: none) {
  .touch-scroll:not(.swiper-container) {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .fancy-title {
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }

  .flex {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
  }
}