/* ============================================================
   AromaNSur — Category Base Styles (Bento Grid)
   Estructura compartida para todas las páginas de categoría.
   Cada categoría importa este archivo + su CSS de tonalidad.
   ============================================================ */

/* ── Category Hero ── */
.cat-hero {
  padding: calc(var(--navbar-height) + var(--space-3xl)) 0 var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cat-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--cat-glow) 0%, transparent 70%);
  opacity: 0.15;
  pointer-events: none;
}

.cat-hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: var(--space-md);
  position: relative;
}

.cat-hero__title-accent {
  color: var(--cat-accent);
  font-style: italic;
}

/* ── Title Stroke-Draw Animation ── */

/* Initial state: text is just an outline, no fill */
.cat-hero__title.stroke-ready {
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.05);
  -webkit-text-fill-color: transparent;
}

.cat-hero__title.stroke-ready .cat-hero__title-accent {
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1.5px rgba(232, 168, 124, 0.05);
}

/* When scroll-reveal adds .visible, trigger the animation */
.cat-hero__title.stroke-ready.visible {
  animation: title-stroke-draw 2.4s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.cat-hero__title.stroke-ready.visible .cat-hero__title-accent {
  animation: title-accent-draw 2.4s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes title-stroke-draw {
  0% {
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0);
    -webkit-text-fill-color: transparent;
  }
  15% {
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.7);
    -webkit-text-fill-color: transparent;
  }
  40% {
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.5);
    -webkit-text-fill-color: transparent;
  }
  70% {
    -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.3);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.6);
  }
  100% {
    -webkit-text-stroke: 0px transparent;
    -webkit-text-fill-color: var(--color-text-heading, #ffffff);
  }
}

@keyframes title-accent-draw {
  0% {
    -webkit-text-stroke: 1.5px rgba(232, 168, 124, 0);
    -webkit-text-fill-color: transparent;
  }
  15% {
    -webkit-text-stroke: 1.5px rgba(232, 168, 124, 0.8);
    -webkit-text-fill-color: transparent;
  }
  40% {
    -webkit-text-stroke: 1.5px rgba(232, 168, 124, 0.6);
    -webkit-text-fill-color: transparent;
  }
  70% {
    -webkit-text-stroke: 0.8px rgba(232, 168, 124, 0.3);
    -webkit-text-fill-color: rgba(232, 168, 124, 0.7);
  }
  100% {
    -webkit-text-stroke: 0px transparent;
    -webkit-text-fill-color: var(--cat-accent, #e8a87c);
  }
}

.cat-hero__description {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.cat-hero__back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.cat-hero__back:hover {
  color: var(--cat-accent);
}

.cat-hero__back svg {
  width: 16px;
  height: 16px;
}

/* ── Bento Grid ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 280px);
  gap: var(--space-md);
  padding: var(--space-xl) 0 var(--space-4xl);
}

.bento-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--cat-surface);
  transition: transform var(--transition-slow),
              box-shadow var(--transition-slow);
}

.bento-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cat-gradient);
  opacity: 0.6;
  z-index: 1;
  transition: opacity var(--transition-base);
  border-radius: var(--radius-lg);
}

.bento-item:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px var(--cat-glow);
  z-index: 2;
}

.bento-item:hover::before {
  opacity: 0.4;
}

.bento-item img,
.bento-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 0;
  display: block;
}

.bento-item img {
  transition: transform var(--transition-slow);
}

.bento-item:hover img {
  transform: scale(1.06);
}

/* Overlay con nombre del producto */
.bento-item__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  z-index: 2;
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.bento-item:hover .bento-item__overlay {
  transform: translateY(0);
}

.bento-item__overlay h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.bento-item__overlay p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* ── Bento Grid Item Sizes ── */
/* Item 1: small top-left */
.bento-item:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

/* Item 2: small top-center */
.bento-item:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

/* Item 3: large top-right (spans 1 col, 2 rows) — como la imagen de referencia */
.bento-item:nth-child(3) {
  grid-column: 3;
  grid-row: 1 / 3;
}

/* Item 4: large bottom-left (spans 1 col) */
.bento-item:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
}

/* Item 5: large bottom-center-right (spans 1 col) — vacío como en la imagen */
.bento-item:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}

/* ── Bento Grid ALT Layout (tall item on the left) ── */
.bento-grid--alt .bento-item:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / 3;
}

.bento-grid--alt .bento-item:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.bento-grid--alt .bento-item:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

.bento-grid--alt .bento-item:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.bento-grid--alt .bento-item:nth-child(5) {
  grid-column: 3;
  grid-row: 2;
}

/* ── Decorative circle (como en la imagen de referencia) ── */
.bento-item--circle::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--cat-circle);
  opacity: 0.3;
  z-index: 1;
  pointer-events: none;
}

.bento-item:nth-child(1)::after {
  bottom: -20px;
  left: -20px;
}

.bento-item:nth-child(3)::after {
  top: 40%;
  right: -30px;
  width: 150px;
  height: 150px;
}

.bento-item:nth-child(5)::after {
  bottom: -30px;
  left: 30%;
  width: 140px;
  height: 140px;
}

/* Alt grid decorative overrides */
.bento-grid--alt .bento-item:nth-child(1)::after {
  bottom: auto;
  left: auto;
  top: 40%;
  right: -30px;
  width: 150px;
  height: 150px;
}

.bento-grid--alt .bento-item:nth-child(3)::after {
  top: auto;
  right: auto;
  bottom: -20px;
  left: -20px;
  width: 120px;
  height: 120px;
}

/* ── Bento Divider (golden animated bar) ── */
.bento-divider {
  width: 100%;
  max-width: 600px;
  height: 2px;
  margin: var(--space-3xl) auto;
  position: relative;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 168, 124, 0.15) 15%,
    rgba(232, 168, 124, 0.5) 50%,
    rgba(232, 168, 124, 0.15) 85%,
    transparent 100%
  );
  border-radius: 2px;
  overflow: hidden;
  contain: paint;
}

.bento-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), rgba(232, 168, 124, 0.6), transparent);
  animation: divider-shimmer 3s ease-in-out infinite;
}

@keyframes divider-shimmer {
  0%   { left: -60px; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.bento-divider::after {
  content: '✦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  color: var(--color-accent);
  background: var(--color-bg);
  padding: 0 var(--space-md);
  opacity: 0.7;
  letter-spacing: 0.5em;
  pointer-events: none;
}

/* ── Category CTA Section ── */
.cat-cta-section {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-4xl);
}

.cat-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  background: var(--cat-accent);
  color: var(--color-bg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  position: relative;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-base);
}

.cat-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--cat-glow);
}

.cat-cta-note {
  margin-top: var(--space-xl);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  font-style: italic;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  padding: var(--space-md) var(--space-xl);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.cat-cta-note::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cat-accent, var(--color-accent)), transparent);
  opacity: 0.6;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 240px);
  }

  .bento-item:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  .bento-item:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  .bento-item:nth-child(5) {
    grid-column: 1 / 3;
    grid-row: 3;
  }

  /* Alt grid responsive: tall item spans full width on top */
  .bento-grid--alt .bento-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  .bento-grid--alt .bento-item:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .bento-grid--alt .bento-item:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .bento-grid--alt .bento-item:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
  }

  .bento-grid--alt .bento-item:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
  }
}

/* ── Bento Carousel Controls (Desktop default: hidden) ── */
.bento-controls {
  display: none;
}

@media (max-width: 860px) {

  .cat-hero {
    padding: calc(var(--navbar-height) + var(--space-md)) 0 var(--space-sm);
  }

  .cat-hero__title {
    font-size: clamp(2rem, 5.5vw, 3.2rem);
    margin-bottom: var(--space-xs);
  }

  .cat-hero__description {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 520px;
  }

  .cat-hero__back {
    margin-bottom: var(--space-md);
  }

  /* ── Mobile: Large One-card-at-a-time Swipe Carousel ── */
  .bento-grid,
  .bento-grid.bento-grid--alt {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-md);
    padding: var(--space-xs) var(--space-xs) 0;
    width: 100%;
    box-sizing: border-box;

    /* Hide scrollbar completely — button & dots replace it */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .bento-grid::-webkit-scrollbar {
    display: none;
  }

  /* Reset all nth-child grid placements */
  .bento-grid .bento-item:nth-child(n),
  .bento-grid--alt .bento-item:nth-child(n) {
    grid-column: unset;
    grid-row: unset;
  }

  /* Large, immersive mobile card (15% larger presence and height) */
  .bento-item {
    flex: 0 0 calc(100vw - 1.5rem);
    max-width: 530px;
    scroll-snap-align: center;
    aspect-ratio: 1 / 1.15;
    min-height: 370px;
    max-height: 530px;
    border-radius: var(--radius-xl);
    height: auto;
    opacity: 1 !important;
    transform: none !important;
    position: relative;
    overflow: hidden;
    background: var(--cat-surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }

  /* Images fill the card and scale with crystal-clear resolution */
  .bento-item img,
  .bento-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  /* Sleek overlay at the bottom of the card */
  .bento-item .bento-item__overlay {
    transform: translateY(0);
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.88) 0%,
      rgba(0, 0, 0, 0.4) 50%,
      transparent 100%
    );
    padding: var(--space-xl) var(--space-md) var(--space-md);
  }

  .bento-item__overlay h3 {
    font-size: 1.15rem;
    font-weight: 700;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  }

  .bento-item__overlay p {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    margin-top: 2px;
  }

  /* Reduce decorative circles on mobile */
  .bento-item--circle::after {
    width: 80px;
    height: 80px;
    opacity: 0.15;
  }

  /* Disable hover effects on touch */
  .bento-item:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }

  .bento-item:hover::before {
    opacity: 0.6;
  }

  .bento-item:hover img {
    transform: none;
  }

  /* ── Mobile Bento Controls Container ── */
  .bento-controls {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 var(--space-lg);
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 10;
  }

  /* ── Compact Minimalist "Desliza" Button with ‹ and › ── */
  .bento-swipe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 1.2px solid var(--cat-accent, var(--color-accent));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-full);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35),
                0 0 10px var(--cat-glow, rgba(232, 168, 124, 0.2));
    cursor: pointer;
    transition: transform var(--transition-fast),
                background var(--transition-fast),
                box-shadow var(--transition-fast);
  }

  .bento-swipe-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 0 18px var(--cat-glow);
  }

  .bento-swipe-btn__text {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
  }

  .bento-swipe-btn__arrow {
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 400;
    color: var(--cat-accent, var(--color-accent));
    display: inline-block;
  }

  .bento-swipe-btn__arrow--left {
    animation: swipe-btn-arrow-left 2s ease-in-out infinite;
  }

  .bento-swipe-btn__arrow--right {
    animation: swipe-btn-arrow-right 2s ease-in-out infinite;
  }

  @keyframes swipe-btn-arrow-left {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50% { transform: translateX(-3px); opacity: 1; }
  }

  @keyframes swipe-btn-arrow-right {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50% { transform: translateX(3px); opacity: 1; }
  }

  /* ── Dot Indicators ── */
  .bento-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 0;
  }

  .bento-dots__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background var(--transition-fast),
                transform var(--transition-fast),
                width var(--transition-fast);
  }

  .bento-dots__dot.active {
    background: var(--cat-accent, var(--color-accent));
    width: 20px;
    border-radius: 3px;
    box-shadow: 0 0 8px var(--cat-glow);
  }

  /* Divider adjustments */
  .bento-divider {
    margin: var(--space-lg) auto;
  }
}
