/*
Theme Name: Challotte & Sons
Template: woodmart
Version: 2.0.0
Description: Challotte & Sons Marketing child theme
Author: Challotte & Sons Estate LLC
*/
@import url('assets/css/challotte-sons-css-spec.css');

/* ── Utility bar 3-slide rotator (15s loop, 5s per slide, 0.5s crossfade) */
.cs-utility-bar__rotator {
  position: relative;
  display: inline-block;
  min-height: 1.4em;
  width: 100%;
  text-align: center;
}
.cs-utility-bar__rotator .cs-utility-bar__text {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  animation: cs-utility-fade 15s linear infinite;
}
.cs-utility-bar__rotator .cs-utility-bar__text--1 { animation-delay: 0s; }
.cs-utility-bar__rotator .cs-utility-bar__text--2 { animation-delay: 5s; }
.cs-utility-bar__rotator .cs-utility-bar__text--3 { animation-delay: 10s; }
@keyframes cs-utility-fade {
  0%, 30%   { opacity: 1; }
  33%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-utility-bar__rotator .cs-utility-bar__text { animation: none; opacity: 1; position: static; }
  .cs-utility-bar__rotator .cs-utility-bar__text--2,
  .cs-utility-bar__rotator .cs-utility-bar__text--3 { display: none; }
}

/* ── Hero 3-slide rotator (24s loop, 8s per slide, 1s crossfade) */
.cs-hero--rotator { position: relative; }
.cs-hero--rotator .cs-hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: cs-hero-fade 24s ease-in-out infinite;
}
.cs-hero--rotator .cs-hero__slide:first-child { position: relative; }
.cs-hero--rotator .cs-hero__slide--1 { animation-delay: 0s; }
.cs-hero--rotator .cs-hero__slide--2 { animation-delay: 8s; }
.cs-hero--rotator .cs-hero__slide--3 { animation-delay: 16s; }
@keyframes cs-hero-fade {
  0%, 30%   { opacity: 1; z-index: 2; }
  33%, 100% { opacity: 0; z-index: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-hero--rotator .cs-hero__slide { animation: none; opacity: 1; position: static; }
  .cs-hero--rotator .cs-hero__slide--2,
  .cs-hero--rotator .cs-hero__slide--3 { display: none; }
}

/* ── Header layout spacing — looser breathing room across nav, item gaps, icon cluster.
   Spec defaults pack everything tight on the same baseline; overrides separate the
   logo / nav / icons clusters so each item is visually individual. Mobile keeps the
   tighter spec defaults; overrides apply at the desktop breakpoint where the bar
   has the room. */
@media (min-width: 1024px) {
  /* gap between logo / main nav / header icons clusters */
  .cs-header__inner { gap: var(--cs-space-8); }

  /* 2px breathing room before AND after each menu link (4px total between adjacent items) */
  .cs-nav-main__list { gap: 0; }
  .cs-nav-item__link { margin-inline: 2px; }

  /* gap between header icons (search · wishlist · cart) */
  .cs-header-icons { gap: var(--cs-space-2); }
}


/* ── Footer legal links — clean horizontal list with middot separators.
   Replaces browser default bullets (which appear when <li> is orphaned).
   Items: Privacy · Terms · Returns · Shipping · Cookies · Accessibility · …
   Layout sequence (per item): [link][16px][·][16px][next link]
   Wrap to a second row gracefully on narrow viewports. */

.cs-footer__legal-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;                  /* spacing handled by ::after on non-last items */
  margin: 0;
  padding: 0;
  list-style: none;        /* defensive — beats any WoodMart override */
}
@media (min-width: 640px) {
  .cs-footer__legal-list { justify-content: flex-end; }
}

.cs-footer__legal-list > li {
  display: inline-flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-footer__legal-list > li:not(:last-child)::after {
  content: '·';
  display: inline-block;
  margin-inline: var(--cs-space-3);   /* 12px on each side of the middot */
  color: rgba(255,255,255,0.25);
  font-size: var(--cs-text-base);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.cs-footer__legal-list a,
.cs-footer__legal-list .cs-footer__legal-link {
  display: inline-block;
  padding-block: 4px;       /* slightly bigger click target without breaking the line */
  font-family: var(--cs-font-body);
  font-size: var(--cs-text-xs);
  color: rgba(255,255,255,0.4);
  transition: color var(--cs-duration-fast);
}
.cs-footer__legal-list a:hover,
.cs-footer__legal-list .cs-footer__legal-link:hover {
  color: var(--cs-gold-lt);
}


/* ── Header icon cluster — Login button + Wishlist + Cart.
   Login is icon-plus-text so it reads as a button, not a mystery icon.
   Wishlist + Cart stay icon-only (consistent square 40×40 buttons).
   A subtle vertical divider separates the login button from the icon pair. */
.cs-header-icon--login {
  width: auto;
  padding-inline: var(--cs-space-3);
  gap: var(--cs-space-2);
  font-family: var(--cs-font-body);
  font-size: var(--cs-text-xs);
  font-weight: 600;
  letter-spacing: var(--cs-tracking-wide);
  text-transform: uppercase;
  color: var(--cs-navy);
  white-space: nowrap;
  border-right: 1px solid var(--cs-border);
  border-radius: 0;          /* squared right edge so the divider lines up cleanly */
  margin-right: var(--cs-space-2);
}
.cs-header-icon--login:hover {
  color: var(--cs-gold);
  background-color: var(--cs-ivory);
}
.cs-header-icon--login.is-logged-in {
  color: var(--cs-gold);     /* visual cue when authenticated */
}
.cs-header-icon__label {
  display: inline-block;
  line-height: 1;
}
@media (max-width: 1023.98px) {
  /* On mobile the hamburger drawer covers nav — keep cluster compact: hide login text label there */
  .cs-header-icon--login .cs-header-icon__label { display: none; }
  .cs-header-icon--login {
    width: 40px;
    padding-inline: 0;
    border-right: none;
    margin-right: 0;
  }
}


/* ── Search bar — make the input permanently visible (no toggle button anymore). */
.cs-search-bar input.cs-search-bar__input,
.cs-search-bar input.cs-search-bar__input.is-open {
  width: 100% !important;
  max-width: 480px;
}


/* ── Search bar — fix icon overlap with placeholder/text.
   The header search bar sits below the main nav. Issue: WoodMart parent
   theme styles `input[type=search]` with its own padding (more-specific
   selector than ours), which overrides our left padding and shoves the
   placeholder text right under the absolutely-positioned magnifier icon.
   Force the icon to have a fixed visual lane on the left of the input. */

.cs-search-bar {
  align-items: center;
  position: relative;   /* spec already sets this; restated for clarity */
}

.cs-search-bar .cs-search-bar__icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 16px !important;
  height: 16px !important;
  color: var(--cs-navy);
  pointer-events: none;
  z-index: 2;            /* above the input fill */
}

/* Use a targeted, slightly more specific selector + !important to beat
   WoodMart parent styles like `body input[type=search]`. */
.cs-search-bar input.cs-search-bar__input,
.cs-search-bar input.cs-search-bar__input.is-open,
.cs-search-bar input[type="search"].cs-search-bar__input {
  padding-left:  40px !important;   /* clears 14+16 = 30px icon + 10px gutter */
  padding-right: 16px !important;
  text-indent: 0 !important;        /* WoodMart sometimes adds text-indent on inputs */
  background-image: none !important;/* WoodMart may inject its own search icon as bg */
}


/* ── Custom logo (wp_get_custom_logo) — constrain the_custom_logo() img to brand size */
.cs-logo .custom-logo-link,
.cs-logo a.custom-logo-link { display: block; line-height: 0; }
.cs-logo img.custom-logo,
.cs-logo .custom-logo {
  height: 40px;
  width: auto;
  max-height: 40px;
  display: block;
}
@media (min-width: 1024px) {
  .cs-logo img.custom-logo,
  .cs-logo .custom-logo { height: 52px; max-height: 52px; }
}
