/**
 * PixelBorsch Core - Category Bento Grid Module
 * Modern homepage category grid with 5 premium presets.
 * @package PixelBorsch_Core
 */

:root {
  --pb-cb-bg-default: #f4f4f4;
  --pb-cb-title-color: #111111;
  --pb-cb-desc-color: #666666;
  --pb-cb-radius: 16px;
  --pb-cb-gap: 16px;
  --pb-cb-height: 240px;
}

/* 1. Base Container & Grid */
.pb-category-bento {
  width: 100%;
  box-sizing: border-box;
}

.pb-category-bento__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--pb-cb-gap);
  align-items: stretch;
}

/* Default span rules for Bento items (12-column system) */
.pb-cb-item {
  position: relative;
  border-radius: var(--pb-cb-radius);
  overflow: hidden;
  background-color: var(--pb-cb-bg-default);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  min-height: var(--pb-cb-height);
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  grid-column: span 4; /* Default: 3 columns per row (4/12) */
}

/* Column Spans */
.pb-cb-item--span-12 { grid-column: span 12; }
.pb-cb-item--span-8  { grid-column: span 8; }
.pb-cb-item--span-6  { grid-column: span 6; }
.pb-cb-item--span-4  { grid-column: span 4; }
.pb-cb-item--span-3  { grid-column: span 3; }

.pb-cb-item--row-span-2 { grid-row: span 2; }

/* 2. Content & Image Positioning inside Bento Cards */
.pb-cb-item__header {
  position: relative;
  z-index: 2;
}

.pb-cb-item__title {
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pb-cb-title-color);
  margin: 0 0 0.35rem 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.pb-cb-item__count {
  font-size: 0.82rem;
  color: var(--pb-cb-desc-color);
  font-weight: 500;
}

.pb-cb-item__image-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 1rem;
  z-index: 1;
}

.pb-cb-item__img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pb-cb-item:hover .pb-cb-item__img {
  transform: scale(1.06) translateY(-4px);
}

/* Hover effects */
.pb-cb-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
}

/* 3. Card Types */

/* Type A: Full Photo Background Card (like 'Lovy') */
.pb-cb-item--full-photo {
  justify-content: flex-start;
  padding: 1.75rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.pb-cb-item--full-photo .pb-cb-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

.pb-cb-item--full-photo .pb-cb-item__header {
  z-index: 2;
}

.pb-cb-item--full-photo .pb-cb-item__title {
  color: #ffffff;
  font-size: 1.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.pb-cb-item--full-photo .pb-cb-item__count {
  color: rgba(255, 255, 255, 0.85);
}

/* Type B: Logo / Brand Card (like 'RIX ACADEMY') */
.pb-cb-item--logo {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
}

.pb-cb-item--logo .pb-cb-item__img {
  max-height: 90px;
  filter: grayscale(100%);
  opacity: 0.85;
  transition: all 0.3s ease;
}

.pb-cb-item--logo:hover .pb-cb-item__img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

/* Type C: Wide Featured Card (like 'Všechny produkty') */
.pb-cb-item--featured .pb-cb-item__title {
  font-size: 1.5rem;
}

.pb-cb-item--featured .pb-cb-item__img {
  max-height: 220px;
}

/* 4. PRESETS */

/* Preset 1: Bento Modern (Точний дефолт з прикладу) */
.pb-category-bento--bento-modern .pb-cb-item {
  background-color: #f4f4f4;
  border-radius: 16px;
  border: none;
}

/* Preset 2: Luxury Editorial (Темний або преміум бордер) */
.pb-category-bento--luxury .pb-cb-item {
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
}

.pb-category-bento--luxury .pb-cb-item:hover {
  border-color: #C5A059;
  box-shadow: 0 15px 35px rgba(197, 160, 89, 0.12);
}

/* Preset 3: Glassmorphism Floating */
.pb-category-bento--glass .pb-cb-item {
  background: rgba(245, 240, 230, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
}

/* Preset 4: Clean Dark */
.pb-category-bento--dark .pb-cb-item {
  background-color: #1a1a1a;
  color: #ffffff;
  border-radius: 16px;
}

.pb-category-bento--dark .pb-cb-item__title {
  color: #ffffff;
}

.pb-category-bento--dark .pb-cb-item__count {
  color: #999999;
}

/* Preset 5: Minimal Border */
.pb-category-bento--minimal .pb-cb-item {
  background-color: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 12px;
}

/* 5. Responsive Breakpoints */
@media (max-width: 1024px) {
  .pb-cb-item--span-8 { grid-column: span 12; }
  .pb-cb-item--span-6 { grid-column: span 6; }
  .pb-cb-item--span-4 { grid-column: span 6; }
  .pb-cb-item--span-3 { grid-column: span 6; }
}

@media (max-width: 640px) {
  .pb-category-bento__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .pb-cb-item,
  .pb-cb-item--span-12,
  .pb-cb-item--span-8,
  .pb-cb-item--span-6,
  .pb-cb-item--span-4,
  .pb-cb-item--span-3 {
    grid-column: span 1;
    min-height: 200px;
  }

  .pb-cb-item__title {
    font-size: 1.15rem;
  }
}
