/* ==========================================================================
   BONEBANA BRAND - CORE DESIGN SYSTEM & UTILITIES (FIGMA MATCH)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Caveat:wght@500;600;700&family=Nothing+You+Could+Do&display=swap');

:root {
  /* Color Palette - Bonebana Editorial Brand */
  --im-color-bg: #F5F3EF;
  /* Organic linen canvas background */
  --im-color-surface: #FFFFFF;
  /* Pure white card surface */
  --im-color-text: #1C1B18;
  /* Charcoal black text */
  --im-color-muted: #6B6862;
  /* Muted body text */
  --im-color-subtle: #D8D4CC;
  /* Fine borders */
  --im-color-border: #E6E2DA;
  /* Divider borders */
  --im-color-brand-red: #825d63;
  /* Signature Bonebana Mauve/Rose Accent */
  --im-color-brand-red-hover: #714e53;
  --im-color-mustard: #C49A45;
  /* Warm mustard accent */
  --im-color-sage: #8A9A86;
  /* Soft sage green */

  /* Typography */
  --im-font-heading: 'Bricolage Grotesque', Georgia, serif;
  --im-font-body: 'Bricolage Grotesque', 'Inter', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --im-font-script: 'Nothing You Could Do', 'Caveat', handwriting, cursive;

  /* Spacing */
  --im-space-xs: 0.5rem;
  --im-space-sm: 1rem;
  --im-space-md: 1.5rem;
  --im-space-lg: 2.5rem;
  --im-space-xl: 4rem;
  --im-space-2xl: 6rem;

  /* Transitions */
  --im-transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --im-transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --im-transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

  /* Container */
  --im-container-max: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--im-color-bg);
  color: var(--im-color-text);
  font-family: var(--im-font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.im-heading {
  font-family: var(--im-font-heading);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--im-color-text);
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--im-transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.im-container {
  width: 100%;
  max-width: var(--im-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Announcement Top Bar */
.im-top-bar {
  background-color: var(--im-color-brand-red);
  color: #FFFFFF;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Site Header */
.im-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #FAF9F5;
  border-bottom: 0.5px solid var(--im-color-border);
  height: 80px;
}

/* Homepage Transparent Header */
.im-header-home {
  position: absolute !important;
  top: 35px !important;
  left: 0;
  width: 100%;
  background-color: transparent !important;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: none !important;
}

.im-header-home.scrolled {
  position: sticky !important;
  top: 0 !important;
  background-color: #FAF9F5 !important;
  border-bottom: 0.5px solid var(--im-color-border, #E6E2DA) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
  --im-header-nav-color: #1C1B18 !important;
}

/* Logo toggles based on homepage scroll state */
.im-logo-white {
  display: none;
}
.im-logo-black {
  display: block;
}

.im-header-home .im-logo-white {
  display: block;
}
.im-header-home .im-logo-black {
  display: none;
}

.im-header-home.scrolled .im-logo-white {
  display: none;
}
.im-header-home.scrolled .im-logo-black {
  display: block;
}

/* Mobile Icon Utilities */
.im-mobile-only-icon {
  display: none !important;
}

.im-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.im-logo {
  font-family: var(--im-font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--im-color-brand-red);
  display: inline-flex;
  align-items: center;
}

.im-nav {
  display: flex;
  align-items: center;
  gap: 3rem;
  list-style: none;
}

.im-nav a {
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--im-color-text);
  position: relative;
  padding: 0.4rem 0;
}

.im-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--im-color-brand-red);
  transition: width var(--im-transition-normal);
}

.im-nav a:hover::after,
.im-nav li.active a::after {
  width: 100%;
}

.im-header-icons {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.im-icon-btn {
  background: none;
  border: none;
  color: var(--im-color-text);
  cursor: pointer;
  font-size: 1.25rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.im-cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background-color: var(--im-color-brand-red);
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.im-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  font-family: var(--im-font-body);
  font-size: 0.785rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid var(--im-color-text);
  background: transparent;
  color: var(--im-color-text);
  cursor: pointer;
  transition: all var(--im-transition-normal);
}

.im-btn-red {
  background-color: var(--im-color-brand-red);
  border-color: var(--im-color-brand-red);
  color: #FFFFFF;
}

.im-btn-red:hover {
  background-color: var(--im-color-brand-red-hover);
  border-color: var(--im-color-brand-red-hover);
  color: #FFFFFF;
}

/* Photo Masking Tape Effect (Scrapbook Style) */
.im-tape-photo {
  position: relative;
}

.im-tape-photo::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 90px;
  height: 26px;
  background-color: rgba(220, 215, 200, 0.75);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
  backdrop-filter: blur(2px);
}

/* Editorial Badge Tags */
.im-tag-red {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--im-color-brand-red);
  margin-bottom: 0.35rem;
}

/* Product & Editorial Cards */
.im-card-title {
  font-family: var(--im-font-heading);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--im-color-text);
  line-height: 1.25;
}

.im-card-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--im-color-muted);
  margin-top: 0.25rem;
}

/* Scrapbook Script Text */
.im-script-heading {
  font-family: var(--im-font-script);
  font-size: 3.5rem;
  color: var(--im-color-text);
  line-height: 1;
}

.im-script-heading span {
  color: var(--im-color-brand-red);
}

/* Footer Styling */
.im-footer {
  background-color: #ECE9E2;
  border-top: 1px solid var(--im-color-border);
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.im-footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--im-color-subtle);
}

@media (max-width: 991px) {
  .im-footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

.im-footer-brand {
  font-family: var(--im-font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--im-color-brand-red);
  line-height: 1;
  margin-bottom: 1rem;
}

.im-footer-col h4 {
  font-family: var(--im-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--im-color-text);
  margin-bottom: 1.25rem;
}

.im-footer-ul {
  list-style: none;
}

.im-footer-ul li {
  margin-bottom: 0.6rem;
}

.im-footer-ul a {
  font-size: 0.8125rem;
  color: var(--im-color-muted);
}

.im-footer-ul a:hover {
  color: var(--im-color-brand-red);
}

.im-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  font-size: 0.75rem;
  color: var(--im-color-muted);
}

.im-footer-banner {
  width: 100%;
  height: 220px;
  object-fit: cover;
  margin-top: 3rem;
}

/* ==========================================================================
   Hero Slider Section Additions
   ========================================================================== */
.im-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;
  z-index: 1;
}

.im-hero-slide.active {
  opacity: 1 !important;
  z-index: 2 !important;
  pointer-events: auto;
}

.im-hero-slider-prev,
.im-hero-slider-next {
  transition: opacity 0.3s, transform 0.3s;
}

.im-hero-slider-prev:hover,
.im-hero-slider-next:hover {
  opacity: 1 !important;
  transform: scale(1.1);
}

.im-hero-slider-dot {
  transition: background-color 0.3s, transform 0.3s;
}

.im-hero-slider-dot:hover {
  background-color: rgba(255, 255, 255, 0.8) !important;
}

.im-hero-slider-dot.active {
  background-color: #FFFFFF !important;
  transform: scaleY(1.5);
}

@media (max-width: 768px) {
  .im-hero-left-text {
    left: 1.5rem !important;
    top: auto !important;
    bottom: 5.5rem !important;
    transform: none !important;
  }

  .im-hero-right-text {
    right: 1.5rem !important;
    top: auto !important;
    bottom: 5.5rem !important;
    transform: none !important;
  }

  .im-hero-slider-prev,
  .im-hero-slider-next {
    display: none !important;
  }

  .im-hero-slider-dots {
    bottom: 1.5rem !important;
  }
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Scroll margin for fixed header */
:target {
  scroll-margin-top: 100px;
}

/* --- Lazy Image Fade-In --- */
.bb-lazy-img {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.bb-lazy-img.loaded {
  opacity: 1;
}

/* --- Scroll Reveal Animations --- */
.bb-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.bb-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children with delay */
.bb-reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.bb-reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.00s; opacity: 1; transform: none; }
.bb-reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.10s; opacity: 1; transform: none; }
.bb-reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.20s; opacity: 1; transform: none; }
.bb-reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.30s; opacity: 1; transform: none; }
.bb-reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.40s; opacity: 1; transform: none; }
.bb-reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.50s; opacity: 1; transform: none; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .bb-reveal,
  .bb-reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .bb-lazy-img {
    opacity: 1;
    transition: none;
  }
}

/* --- Skeleton Loader (Shimmer) --- */
.bb-section-shell {
  min-height: auto;
  padding: 3rem 0;
  background: #FAF9F5;
  transition: opacity 0.4s ease;
}
.bb-skeleton-header {
  width: 220px;
  height: 12px;
  border-radius: 2px;
  margin-bottom: 3rem;
  background: linear-gradient(90deg, #ECE9E3 25%, #F5F3EF 50%, #ECE9E3 75%);
  background-size: 200% 100%;
  animation: bb-shimmer 1.4s ease-in-out infinite;
}
.bb-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 1024px) {
  .bb-skeleton-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .bb-skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}
.bb-skeleton-card {
  aspect-ratio: 3/4;
  border-radius: 2px;
  background: linear-gradient(90deg, #ECE9E3 25%, #F5F3EF 50%, #ECE9E3 75%);
  background-size: 200% 100%;
  animation: bb-shimmer 1.4s ease-in-out infinite;
}
.bb-skeleton-card:nth-child(2) { animation-delay: 0.1s; }
.bb-skeleton-card:nth-child(3) { animation-delay: 0.2s; }
.bb-skeleton-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes bb-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Section shell fade transition when AJAX content loads */
.bb-section-shell {
  transition: opacity 0.4s ease;
}

/* --- Product Grid & Carousel Base Styles ("WE PICKS FOR YOU" & "BEST SELLER") --- */
.picks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.picks-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 6px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}
.picks-carousel::-webkit-scrollbar {
  height: 4px;
}
.picks-carousel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
.picks-carousel::-webkit-scrollbar-thumb {
  background: rgba(28, 27, 24, 0.3);
  border-radius: 2px;
}
.picks-carousel .picks-product-item {
  flex: 0 0 calc(25% - 4.5px); /* Exactly 4 items fit viewport when gap is 6px */
  scroll-snap-align: start;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .picks-carousel .picks-product-item {
    flex: 0 0 calc(33.333% - 4px); /* 3 items on tablet */
  }
  .picks-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

/* --- "FIND YOU LIKE" Lookbook Masonry Base Styles --- */
.im-lookbook-masonry {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.lookbook-item-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background-color: #ECE9E3;
}
.lookbook-item-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.lookbook-item-wrap:hover img {
  transform: scale(1.05);
}
.lookbook-hover-card {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: calc(100% - 24px);
  background: #ffffff;
  padding: 1.25rem;
  box-sizing: border-box;
  z-index: 10;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.lookbook-item-wrap:hover .lookbook-hover-card {
  opacity: 1;
  transform: translateY(0);
}
.lookbook-hover-card ins {
  text-decoration: none;
  color: #825d63;
  margin-right: 8px;
  font-weight: 600;
}
.lookbook-hover-card del {
  color: #bbb;
  font-weight: 400;
  text-decoration: line-through;
}


