/* ============================================
   MyErossence 2027 - Bento Grid System
   ============================================ */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  container-type: inline-size;
  container-name: bento;
}

/* Cell sizes */
.bento-cell--1x1 { grid-column: span 3; grid-row: span 1; }
.bento-cell--2x1 { grid-column: span 6; grid-row: span 1; }
.bento-cell--2x2 { grid-column: span 6; grid-row: span 2; }
.bento-cell--3x1 { grid-column: span 9; grid-row: span 1; }
.bento-cell--3x2 { grid-column: span 9; grid-row: span 2; }
.bento-cell--4x1 { grid-column: span 12; grid-row: span 1; }
.bento-cell--4x2 { grid-column: span 12; grid-row: span 2; }

/* Cell base */
.bento-cell {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(212, 165, 116, 0.08);
  min-height: 200px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.bento-cell:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Content types */
.bento-cell--product {
  display: flex;
  flex-direction: column;
}

.bento-cell--product .bento-cell__image {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.bento-cell--product .bento-cell__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-cell--product:hover .bento-cell__image img {
  transform: scale(1.05);
}

.bento-cell--product .bento-cell__content {
  padding: 1.25rem;
}

.bento-cell--editorial {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  background: linear-gradient(135deg, var(--secondary), rgba(10, 15, 17, 0.95));
}

.bento-cell--editorial .bento-cell__eyebrow {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.bento-cell--editorial .bento-cell__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.bento-cell--editorial .bento-cell__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.bento-cell--image {
  padding: 0;
}

.bento-cell--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-cell--image:hover img {
  transform: scale(1.05);
}

.bento-cell--quote {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.08), rgba(54, 117, 136, 0.08));
}

.bento-cell--quote .bento-cell__quote-mark {
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--primary);
  line-height: 1;
  opacity: 0.5;
}

.bento-cell--quote .bento-cell__quote-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.bento-cell--video {
  position: relative;
  cursor: pointer;
}

.bento-cell--video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 17, 0.3);
  transition: background 0.3s;
}

.bento-cell--video:hover::after {
  background: rgba(10, 15, 17, 0.1);
}

.bento-cell--video .bento-cell__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 64px;
  height: 64px;
  background: rgba(212, 165, 116, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.bento-cell--video:hover .bento-cell__play {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Affiliate button inside bento */
.bento-cell__affiliate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary);
  color: var(--bg);
  border-radius: 0.5rem;
  transition: background 0.3s;
}

.bento-cell__affiliate-btn:hover {
  background: var(--primary-dark);
}

/* Layout presets */
.bento-grid--editorial-a > :nth-child(1) { grid-column: span 8; grid-row: span 2; }
.bento-grid--editorial-a > :nth-child(2) { grid-column: span 4; }
.bento-grid--editorial-a > :nth-child(3) { grid-column: span 4; }
.bento-grid--editorial-a > :nth-child(4) { grid-column: span 4; }
.bento-grid--editorial-a > :nth-child(5) { grid-column: span 4; }
.bento-grid--editorial-a > :nth-child(6) { grid-column: span 4; }

.bento-grid--magazine > :nth-child(1) { grid-column: span 6; grid-row: span 2; }
.bento-grid--magazine > :nth-child(2) { grid-column: span 6; }
.bento-grid--magazine > :nth-child(3) { grid-column: span 3; }
.bento-grid--magazine > :nth-child(4) { grid-column: span 3; }
.bento-grid--magazine > :nth-child(5) { grid-column: span 6; }

/* Responsive */
@container bento (max-width: 768px) {
  .bento-cell--1x1,
  .bento-cell--2x1,
  .bento-cell--2x2,
  .bento-cell--3x1,
  .bento-cell--3x2,
  .bento-cell--4x1,
  .bento-cell--4x2 {
    grid-column: span 12;
    grid-row: span 1;
  }

  .bento-grid--editorial-a > *,
  .bento-grid--magazine > * {
    grid-column: span 12 !important;
    grid-row: span 1 !important;
  }
}

@supports not (container-type: inline-size) {
  @media (max-width: 768px) {
    .bento-cell--1x1,
    .bento-cell--2x1,
    .bento-cell--2x2,
    .bento-cell--3x1,
    .bento-cell--3x2,
    .bento-cell--4x1,
    .bento-cell--4x2 {
      grid-column: span 12;
      grid-row: span 1;
    }

    .bento-grid--editorial-a > *,
    .bento-grid--magazine > * {
      grid-column: span 12 !important;
      grid-row: span 1 !important;
    }
  }
}
