/* ═══════════════════════════════════════════════════════════════
   discovery.css  –  URVI Search & Discovery Grid
   Vibrant category grid and neo-brutalist pill search bar.
   ═══════════════════════════════════════════════════════════════ */

.discovery-section {
  background-color: var(--color-primary); /* Mustard yellow base matching homepage hero */
  padding: var(--space-20) var(--space-8);
  border-bottom: var(--border-lg);
  position: relative;
  overflow: hidden;
}

/* Layer 1 - Halftone print overlay */
.discovery-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.06) 1.5px,
    transparent 1.5px
  );
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 1;
}

/* Layer 2 - Radial glow and diagonal sunburst lines overlay */
.discovery-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(
      ellipse 72% 60% at 50% 28%,
      rgba(255, 255, 255, 0.45) 0%,
      rgba(255, 105, 180, 0.15) 60%,
      transparent 100%
    ),
    repeating-linear-gradient(
      105deg,
      transparent 0px,
      transparent 20px,
      rgba(255, 105, 180, 0.06) 20px,
      rgba(255, 105, 180, 0.06) 22px
    );
  pointer-events: none;
  z-index: 0;
}

.discovery-container {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2; /* Sits on top of background overlays */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-12);
}

/* ── HEADING ─────────────────────────────────────────────────── */

.discovery-header {
  text-align: center;
  max-width: 800px;
}

.discovery-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.75rem); /* Massive bold Anton font */
  line-height: var(--leading-tight);
  color: var(--color-ink);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
}

.discovery-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-ink);
}

/* ── SEARCH BAR ──────────────────────────────────────────────── */

.search-container {
  width: 100%;
  max-width: 600px;
  position: relative;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: var(--border-lg);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  padding: 0 var(--space-6);
  height: 64px;
  position: relative;
  transition: transform var(--duration-fast) var(--ease-snap),
              box-shadow var(--duration-fast) var(--ease-snap);
}

.search-wrapper:focus-within {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent-pink);
}

.search-icon {
  flex-shrink: 0;
  color: var(--color-ink);
  margin-right: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-ink-soft);
  opacity: 0.7;
}

/* Dynamic clear button inside search */
.search-clear {
  background: none;
  border: none;
  padding: var(--space-1);
  color: var(--color-ink-soft);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) ease;
}

.search-clear:hover {
  color: var(--color-accent-red);
}

/* ── CATEGORY GRID ───────────────────────────────────────────── */

.discovery-grid {
  width: 100%;
  max-width: 900px;
  margin: var(--space-4) auto 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
}

.discovery-item {
  flex: 1 1 250px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  border: var(--border-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  text-align: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-snap),
              box-shadow var(--duration-fast) var(--ease-snap),
              border-color var(--duration-fast) ease;
}

/* Unique pedestal accents per card */
.discovery-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: var(--pedestal-color, var(--color-primary));
  transition: height var(--duration-base) var(--ease-snap);
}

.discovery-item:hover {
  transform: translate(3px, 3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--pedestal-color, var(--color-ink));
}

.discovery-item:hover::after {
  height: 14px;
}

/* Pedestal background shape */
.discovery-pedestal {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--pedestal-bg, var(--color-bg-cream));
  border: 3px solid var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: var(--space-4);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}

.discovery-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(4px 8px 0 rgba(0,0,0,0.15));
  transition: transform var(--duration-slow) var(--ease-bounce);
  z-index: 2;
}

/* 3D Float Hover Effect */
.discovery-item:hover .discovery-img {
  transform: translateY(-16px) scale(1.08) rotate(3deg);
  filter: drop-shadow(4px 16px 0 rgba(0,0,0,0.18));
}

.discovery-label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-ink);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  z-index: 2;
  margin-top: var(--space-2);
}

/* ── RESPONSIVE RESPONSIVENESS ────────────────────────────────── */

/* Tablet / Small Laptops (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .discovery-grid {
    gap: var(--space-6);
  }
}

/* Large Phones & Mobile Viewports (max-width: 767px) */
@media (max-width: 767px) {
  .discovery-grid {
    display: flex !important;
    flex-direction: row !important; /* Force single horizontal row */
    flex-wrap: nowrap !important;   /* Do not wrap onto multiple lines */
    justify-content: center !important;
    gap: 12px !important;           /* Tight spacing to fit on small screens */
    width: 100% !important;
    max-width: 100% !important;
    margin: var(--space-4) auto 0 auto !important;
    padding-bottom: 35px !important; /* Extra spacing at the bottom to prevent label overlap */
    overflow: visible !important;
  }
  
  .discovery-section {
    padding: var(--space-8) var(--space-2) !important;
  }
  
  .discovery-item {
    flex: 0 0 90px !important;     /* Fixed square size: 90px width */
    width: 90px !important;
    height: 90px !important;        /* Fixed square height */
    padding: 8px !important;       /* Tight internal padding */
    border-radius: var(--radius-md) !important; /* Square card border radius */
    box-shadow: 3px 3px 0 var(--color-ink) !important; /* Brutalist shadow scaled down */
    position: relative !important;
    overflow: visible !important;   /* Let label overflow outside at the bottom */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .discovery-item::after {
    height: 4px !important;         /* Smaller bottom border decoration */
  }

  .discovery-item:hover::after {
    height: 6px !important;
  }
  
  .discovery-pedestal {
    width: 66px !important;         /* Circular container inside the square */
    height: 66px !important;
    border: 2px solid var(--color-ink) !important; /* Inner circle border */
    margin-bottom: 0 !important;   /* No bottom margin since label is absolute */
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .discovery-img {
    width: 50px !important;         /* Smaller image to fit inside the inner circle */
    height: 50px !important;
    filter: drop-shadow(2px 4px 0 rgba(0,0,0,0.12)) !important;
  }

  /* 3D Float Hover Effect scaled down */
  .discovery-item:hover .discovery-img {
    transform: translateY(-8px) scale(1.05) rotate(2deg) !important;
  }

  .discovery-label {
    position: absolute !important;
    bottom: -32px !important;       /* Position name completely outside the square card */
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 11px !important;     /* Compact font size */
    font-weight: 700 !important;
    color: var(--color-ink) !important;
    margin-top: 0 !important;
    white-space: nowrap !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
  }
}
