/* ============================================================
   FDD Category Showcase Widget — Stylesheet
   flowerdeliverydubai.io
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --fdd-pink:      #ff6987;
  --fdd-pink-dark: #e04b6a;
  --fdd-text:      #2d2d2d;
  --fdd-muted:     #888888;
  --fdd-radius:    16px;
  --fdd-shadow:    0 4px 20px rgba(0,0,0,0.08);
  --fdd-shadow-hover: 0 12px 40px rgba(255,105,135,0.22);
  --fdd-transition: 0.38s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ---------- Wrapper ---------- */
.fdd-category-showcase {
  width: 100%;
}

/* ---------- Section (Hierarchical) ---------- */
.fdd-cat-section {
  margin-bottom: 56px;
}

.fdd-cat-section__header {
  margin-bottom: 20px;
}

.fdd-cat-section__title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 2px solid #f0f0f0;
  position: relative;
}

.fdd-cat-section__title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  position: relative;
  padding-bottom: 4px;
}

.fdd-cat-section__title::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--fdd-pink);
  border-radius: 2px;
}

.fdd-cat-section__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--fdd-transition);
}
.fdd-cat-section__title a:hover {
  color: var(--fdd-pink);
}

.fdd-cat-section__count {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--fdd-muted);
  margin-left: 4px;
}

.fdd-cat-section__desc {
  font-size: 0.88rem;
  color: var(--fdd-muted);
  margin: 0;
  max-width: 520px;
}

.fdd-cat-section__view-all {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fdd-pink);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--fdd-transition), transform var(--fdd-transition);
  display: inline-flex;
  align-items: center;
}
.fdd-cat-section__view-all:hover {
  color: var(--fdd-pink-dark);
  transform: translateX(3px);
}

/* ---------- Grid ---------- */
.fdd-cat-grid {
  display: grid;
  gap: 20px;
}

/* Columns set via JS (inline style) — fallback defaults */
.fdd-cat-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .fdd-cat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .fdd-cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile always minimum 2 columns — controlled by widget setting */

/* ---------- Card ---------- */
.fdd-cat-card {
  background: #fff;
  border-radius: var(--fdd-radius);
  box-shadow: var(--fdd-shadow);
  overflow: hidden;
  transition: transform var(--fdd-transition), box-shadow var(--fdd-transition);
  will-change: transform;
  animation: fdd-fade-in 0.55s ease both;
}

.fdd-cat-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--fdd-shadow-hover);
}

/* Staggered entrance animation */
.fdd-cat-card:nth-child(1)  { animation-delay: 0.04s; }
.fdd-cat-card:nth-child(2)  { animation-delay: 0.08s; }
.fdd-cat-card:nth-child(3)  { animation-delay: 0.12s; }
.fdd-cat-card:nth-child(4)  { animation-delay: 0.16s; }
.fdd-cat-card:nth-child(5)  { animation-delay: 0.20s; }
.fdd-cat-card:nth-child(6)  { animation-delay: 0.24s; }
.fdd-cat-card:nth-child(7)  { animation-delay: 0.28s; }
.fdd-cat-card:nth-child(8)  { animation-delay: 0.32s; }
.fdd-cat-card:nth-child(9)  { animation-delay: 0.36s; }
.fdd-cat-card:nth-child(10) { animation-delay: 0.40s; }
.fdd-cat-card:nth-child(11) { animation-delay: 0.44s; }
.fdd-cat-card:nth-child(12) { animation-delay: 0.48s; }

@keyframes fdd-fade-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Card Link ---------- */
.fdd-cat-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

/* ---------- Image Wrap ---------- */
.fdd-cat-card__image-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #fdf0f3;
}

.fdd-cat-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--fdd-transition);
  display: block;
}

.fdd-cat-card:hover .fdd-cat-card__image {
  transform: scale(1.08);
}

/* ---------- Placeholder ---------- */
.fdd-cat-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff5f7 0%, #ffe8ed 100%);
  gap: 8px;
  transition: background var(--fdd-transition);
}

.fdd-cat-card:hover .fdd-cat-card__image-placeholder {
  background: linear-gradient(135deg, #ffe8ed 0%, #ffd0d8 100%);
}

.fdd-placeholder-icon {
  width: 56px;
  height: 56px;
  transition: transform var(--fdd-transition);
}

.fdd-cat-card:hover .fdd-placeholder-icon {
  transform: scale(1.15) rotate(-5deg);
}

.fdd-placeholder-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fdd-pink);
  text-align: center;
  letter-spacing: 0.03em;
  padding: 0 12px;
}

/* ---------- Hover Overlay ---------- */
.fdd-cat-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 105, 135, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--fdd-transition);
}

.fdd-cat-card:hover .fdd-cat-card__overlay {
  opacity: 1;
}

.fdd-cat-card__overlay-text {
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.18);
  padding: 8px 18px;
  border-radius: 30px;
  border: 2px solid rgba(255,255,255,0.6);
  transform: translateY(8px);
  transition: transform var(--fdd-transition);
}

.fdd-cat-card:hover .fdd-cat-card__overlay-text {
  transform: translateY(0);
}

/* ---------- Card Body ---------- */
.fdd-cat-card__body {
  padding: 14px 16px 16px;
}

.fdd-cat-card__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--fdd-text);
  margin: 0 0 4px;
  line-height: 1.3;
  transition: color var(--fdd-transition);
}

.fdd-cat-card:hover .fdd-cat-card__title {
  color: var(--fdd-pink);
}

.fdd-cat-card__count {
  font-size: 0.78rem;
  color: var(--fdd-muted);
  display: block;
  margin-bottom: 4px;
}

.fdd-cat-card__desc {
  font-size: 0.8rem;
  color: var(--fdd-muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ---------- Solo / Parent card (no children) ---------- */
.fdd-cat-grid--solo {
  grid-template-columns: 1fr !important;
}

.fdd-cat-grid--solo .fdd-cat-card {
  display: flex;
}

.fdd-cat-grid--solo .fdd-cat-card__link {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.fdd-cat-grid--solo .fdd-cat-card__image-wrap {
  width: 280px;
  min-width: 220px;
  height: auto;
  min-height: 160px;
}

.fdd-cat-grid--solo .fdd-cat-card__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fdd-cat-grid--solo .fdd-cat-card__title {
  font-size: 1.15rem;
}

@media (max-width: 600px) {
  .fdd-cat-grid--solo .fdd-cat-card__link {
    flex-direction: column;
  }
  .fdd-cat-grid--solo .fdd-cat-card__image-wrap {
    width: 100%;
    height: 180px;
  }
}

/* ---------- No Categories ---------- */
.fdd-no-categories {
  padding: 40px;
  text-align: center;
  color: var(--fdd-muted);
  font-style: italic;
}

/* ---------- Elementor Editor Notice ---------- */
.elementor-editor-active .fdd-cat-card__overlay {
  opacity: 0 !important;
}
