/* ══════════════════════════════════════════════════════════════════
   SECURITPRO — Categories Showcase  v3.0
   Matches reference "Par secteur d'activité" design exactly
   ══════════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────────── */
.spmm-cs-wrap {
  --cs-yellow:      #FBBF24;
  --cs-yellow-mid:  #FEF3C7;
  --cs-yellow-dk:   #D97706;
  --cs-yellow-glow: rgba(251,191,36,.15);
  --cs-black:       #0F0F0F;
  --cs-gray-900:    #111827;
  --cs-gray-700:    #374151;
  --cs-gray-500:    #6B7280;
  --cs-gray-400:    #9CA3AF;
  --cs-gray-200:    #E5E7EB;
  --cs-gray-100:    #F9FAFB;
  --cs-white:       #FFFFFF;
  --cs-font:        'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --cs-head:        'Syne', 'Inter', system-ui, sans-serif;
  --cs-ease:        cubic-bezier(.22,.68,0,1.15);
  --cs-ease-out:    cubic-bezier(.22,1,.36,1);
  --cs-cols:        4;
  font-family: var(--cs-font);
  -webkit-font-smoothing: antialiased;
  color: var(--cs-gray-900);
}

/* ══════════════════════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════════════════════ */
.spmm-cs-header {
  margin-bottom: 72px;
}

.spmm-cs-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cs-yellow); color: var(--cs-black);
  font-family: var(--cs-font); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 100px;
  margin-bottom: 16px;
}

.spmm-cs-title {
  font-family: var(--cs-head);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
  color: var(--cs-gray-900); margin: 0 0 8px;
}
.spmm-cs-title em {
  font-style: italic; font-weight: 400;
  color: var(--cs-gray-400);
}

.spmm-cs-sub {
  font-size: 15px; font-weight: 400; color: var(--cs-gray-500);
  line-height: 1.6; margin: 0; max-width: 480px;
}

/* ══════════════════════════════════════════════════════
   SECTOR ROWS
══════════════════════════════════════════════════════ */
.spmm-cs-sector {
  margin-bottom: 64px;
}
.spmm-cs-sector:last-child { margin-bottom: 0; }

/* Sector header row */
.spmm-cs-sector-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cs-gray-200);
}

.spmm-cs-sector-left {
  display: flex; align-items: center; gap: 12px;
}

.spmm-cs-sector-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--cs-yellow-mid);
  border: 1px solid #FDE68A;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  line-height: 1;
}

.spmm-cs-sector-name {
  font-family: var(--cs-head);
  font-size: 18px; font-weight: 800;
  letter-spacing: -.02em; color: var(--cs-gray-900);
}

.spmm-cs-sector-desc {
  font-size: 12px; color: var(--cs-gray-400); margin-top: 2px;
}

.spmm-cs-sector-count {
  font-size: 12px; font-weight: 600; color: var(--cs-gray-400);
  flex-shrink: 0; white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   PRODUCT GRID
══════════════════════════════════════════════════════ */
.spmm-cs-grid {
  display: grid;
  grid-template-columns: repeat(var(--cs-cols, 4), 1fr);
  gap: 14px;
}

/* ══════════════════════════════════════════════════════
   CARD
══════════════════════════════════════════════════════ */
.spmm-cs-card {
  background: var(--cs-white);
  border: 1.5px solid var(--cs-gray-200);
  border-radius: 16px; overflow: hidden;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition:
    transform .28s var(--cs-ease),
    border-color .22s ease,
    box-shadow .28s ease;
}
.spmm-cs-card:hover {
  transform: translateY(-4px);
  border-color: var(--cs-yellow);
  box-shadow:
    0 12px 36px rgba(251,191,36,.15),
    0 2px 8px rgba(0,0,0,.04);
}

/* ── Image area ─── */
.spmm-cs-img {
  width: 100%; height: 160px; overflow: hidden;
  background: var(--cs-gray-100); position: relative; flex-shrink: 0;
}
.spmm-cs-img-el {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .45s ease;
}
.spmm-cs-card:hover .spmm-cs-img-el { transform: scale(1.05); }

/* SVG placeholder */
.spmm-cs-img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cs-gray-100);
}
.spmm-cs-img-placeholder svg { width: 100%; height: 100%; }

/* Arrow badge — top-right */
.spmm-cs-arrow {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--cs-gray-400);
  transition: background .2s, color .2s, transform .22s var(--cs-ease);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.spmm-cs-card:hover .spmm-cs-arrow {
  background: var(--cs-yellow); color: var(--cs-black);
  transform: rotate(-45deg);
}

/* Ribbon */
.spmm-cs-ribbon {
  position: absolute; top: 14px; left: -28px;
  background: #10B981; color: #fff;
  font-family: var(--cs-font); font-size: 9px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 36px; transform: rotate(-45deg);
}

/* ── Card body ─── */
.spmm-cs-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 0; flex: 1;
}

/* Tag */
.spmm-cs-tag {
  display: inline-block; align-self: flex-start;
  font-family: var(--cs-font); font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--cs-yellow-dk); background: var(--cs-yellow-mid);
  border: 1px solid #FDE68A;
  padding: 2px 7px; border-radius: 4px;
  margin-bottom: 8px; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

/* Title */
.spmm-cs-card-title {
  font-family: var(--cs-font);
  font-size: 13px; font-weight: 700;
  color: var(--cs-gray-900); line-height: 1.3;
  letter-spacing: -.01em; margin-bottom: 5px;
}

/* Description */
.spmm-cs-card-desc {
  font-family: var(--cs-font);
  font-size: 11.5px; color: var(--cs-gray-400);
  line-height: 1.55; flex: 1; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   FLAT GRID (no sector headers)
══════════════════════════════════════════════════════ */
.spmm-cs-mode--flat .spmm-cs-grid {
  margin-top: 32px;
}

/* ══════════════════════════════════════════════════════
   CAROUSEL
══════════════════════════════════════════════════════ */
.spmm-cs-swiper {
  position: relative; overflow: hidden;
  padding-bottom: 52px; margin-top: 32px;
}
.spmm-cs-swiper .swiper-wrapper { align-items: stretch; }
.spmm-cs-swiper .swiper-slide  { height: auto; }
.spmm-cs-swiper .swiper-slide .spmm-cs-card { height: 100%; }

.spmm-cs-prev, .spmm-cs-next {
  position: absolute; top: 40%; transform: translateY(-50%); z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cs-white); border: 1.5px solid var(--cs-gray-200);
  color: var(--cs-gray-900); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.1);
  transition: background .2s, border-color .2s, transform .2s;
  outline: none;
}
.spmm-cs-prev { left: -20px; }
.spmm-cs-next { right: -20px; }
.spmm-cs-prev:hover, .spmm-cs-next:hover {
  background: var(--cs-yellow); border-color: var(--cs-yellow);
  color: var(--cs-black);
}
.spmm-cs-prev.swiper-button-disabled,
.spmm-cs-next.swiper-button-disabled { opacity: .3; pointer-events: none; }

.spmm-cs-dots.swiper-pagination {
  bottom: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.spmm-cs-dots .swiper-pagination-bullet {
  width: 8px; height: 8px; border-radius: 4px;
  background: var(--cs-gray-200); opacity: 1;
  transition: width .3s, background .2s;
}
.spmm-cs-dots .swiper-pagination-bullet-active {
  width: 24px; background: var(--cs-yellow);
}

/* ══════════════════════════════════════════════════════
   STAGGER ANIMATION
══════════════════════════════════════════════════════ */
.spmm-cs-card--hidden {
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.22,1,.36,1);
}
.spmm-cs-card--visible {
  opacity: 1; transform: none;
}

/* ══════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════ */
.spmm-cs-empty {
  text-align: center; padding: 40px;
  color: var(--cs-gray-400); font-size: 14px;
}

/* ══════════════════════════════════════════════════════
   ACCESSIBILITY
══════════════════════════════════════════════════════ */
.spmm-cs-card:focus-visible {
  outline: 2px solid var(--cs-yellow); outline-offset: 3px; border-radius: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .spmm-cs-card, .spmm-cs-img-el,
  .spmm-cs-arrow, .spmm-cs-card--hidden {
    transition: none !important; animation: none !important;
  }
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .spmm-cs-grid    { grid-template-columns: repeat(3, 1fr) !important; }
  .spmm-cs-header  { margin-bottom: 48px; }
}
@media (max-width: 768px) {
  .spmm-cs-grid    { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .spmm-cs-sector  { margin-bottom: 44px; }
  .spmm-cs-header  { margin-bottom: 36px; }
  .spmm-cs-title   { font-size: clamp(22px, 6vw, 34px); }
  .spmm-cs-sub     { font-size: 14px; max-width: none; }
  .spmm-cs-sector-name { font-size: 16px; }
  .spmm-cs-img     { height: 130px; }
  .spmm-cs-prev    { left: -8px; }
  .spmm-cs-next    { right: -8px; }
}
@media (max-width: 480px) {
  .spmm-cs-grid    { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .spmm-cs-img     { height: 120px; }
  .spmm-cs-card-title { font-size: 12px; }
  .spmm-cs-card-desc  { font-size: 11px; }
  .spmm-cs-body    { padding: 11px 12px 13px; }
  .spmm-cs-sector-icon { width: 34px; height: 34px; font-size: 17px; }
  .spmm-cs-sector-desc { display: none; }
}

/* ── RTL ── */
[dir="rtl"] .spmm-cs-prev { left: auto; right: -20px; }
[dir="rtl"] .spmm-cs-next { right: auto; left: -20px; }
[dir="rtl"] .spmm-cs-ribbon { left: auto; right: -28px; transform: rotate(45deg); }
