html {
  scroll-behavior: smooth;
}


/* ===== Page Layout ===== */
.sundries-page-wrapper {
  background-color: #fff;
  width: 100%;
  overflow-x: hidden;
}

.twc-inspired-sundries {
  display: flex;
  min-height: 100vh;
  padding: 40px 5%;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #333;
  max-width: 1800px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-top: 30px !important;
  padding-left: 0px !important;
}

/* ===== Sidebar ===== */
.twc-sidebar-wrapper {
  width: 220px;
  flex-shrink: 0;
  height: auto;
  font-family: 'ivyora-display', 'Times New Roman', serif !important;
  padding: 10px;
}

.twc-sidebar {
  transition: top 0.05s ease-out; /* optional, makes movement feel smoother */
}

.sidebar-title {
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 25px;
  color: #333;
  font-weight: 400;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 10px;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  margin-bottom: 12px;
}

.category-list a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.5px;
  display: block;
  padding: 4px 0;
  transition: color 0.3s;
  margin-bottom: 25px;
}

.category-list a:hover {
  color: #8a8a8a;
}

/* ===== Main Content ===== */
.twc-main-content {
  flex-grow: 1;
  padding-left: 20px;
}

/* ===== Product Grid (Used in Category View) ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding: 0 20px;
  width: 100%;
}

.product-card {
  background: white;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #e5e5e5;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-color: #d5d5d5;
}

.image-container {
  width: 100%;
  height: 300px;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .image-container img {
  transform: scale(1.03);
}

.product-name {
  display: block;
  text-align: center;
  font-size: 14px;
  padding: 20px 10px;
  line-height: 1.4;
  border-top: 1px solid #f0f0f0;
}

/* ===== Visual Category Grid (Default View) ===== */
.category-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:30px;
}

/* Support either structure: <a> direct child OR wrapper .category-cell */
.category-grid > .category-cell,
.category-grid > a.category-tile{
  width:100%;
  align-self:start;
  display:flex;
  flex-direction:column;
  gap:8px; /* space for header above image if used */
}

/* WIDE banners (1,4,7,8,11) */
.category-grid > .category-cell:nth-child(1),
.category-grid > .category-cell:nth-child(4),
.category-grid > .category-cell:nth-child(7),
.category-grid > .category-cell:nth-child(8),
.category-grid > .category-cell:nth-child(11),
.category-grid > a.category-tile:nth-child(1),
.category-grid > a.category-tile:nth-child(4),
.category-grid > a.category-tile:nth-child(7),
.category-grid > a.category-tile:nth-child(8),
.category-grid > a.category-tile:nth-child(11) {
  grid-column: 1 / -1;
}

/* Half-width items (2,3,5,6,9,10) */
.category-grid > .category-cell:nth-child(2),
.category-grid > .category-cell:nth-child(3),
.category-grid > .category-cell:nth-child(5),
.category-grid > .category-cell:nth-child(6),
.category-grid > .category-cell:nth-child(9),
.category-grid > .category-cell:nth-child(10),
.category-grid > a.category-tile:nth-child(2),
.category-grid > a.category-tile:nth-child(3),
.category-grid > a.category-tile:nth-child(5),
.category-grid > a.category-tile:nth-child(6),
.category-grid > a.category-tile:nth-child(9),
.category-grid > a.category-tile:nth-child(10) {
  grid-column: span 6;
}

/* ===== Tile (clickable area) ===== */
.category-tile{
  position:relative;
  text-decoration:none;
  color:#333;
  border:1px solid #e5e5e5;
  overflow:hidden;
  transition:all .3s ease;
  box-shadow:0 2px 10px rgba(0,0,0,.05);
  display:block;
}

.category-tile:hover{
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,.1);
}

/* Media wrappers – no fixed heights, use aspect ratios */
.tile-video,
.tile-image{
  position:relative;
  width:100%;
  overflow:hidden;
}

/* Default tiles: tall (exclude 1,4,7,8,11 which are wide banners) */
.category-grid > .category-cell:not(:nth-child(1)):not(:nth-child(4)):not(:nth-child(7)):not(:nth-child(8)):not(:nth-child(11)) .tile-video,
.category-grid > .category-cell:not(:nth-child(1)):not(:nth-child(4)):not(:nth-child(7)):not(:nth-child(8)):not(:nth-child(11)) .tile-image,
.category-grid > a.category-tile:not(:nth-child(1)):not(:nth-child(4)):not(:nth-child(7)):not(:nth-child(8)):not(:nth-child(11)) .tile-video,
.category-grid > a.category-tile:not(:nth-child(1)):not(:nth-child(4)):not(:nth-child(7)):not(:nth-child(8)):not(:nth-child(11)) .tile-image {
  height: 800px;
}

/* Wide banners: shorter height (1,4,7,8,11) */
.category-grid > .category-cell:nth-child(1) .tile-video,
.category-grid > .category-cell:nth-child(1) .tile-image,
.category-grid > .category-cell:nth-child(4) .tile-video,
.category-grid > .category-cell:nth-child(4) .tile-image,
.category-grid > .category-cell:nth-child(7) .tile-video,
.category-grid > .category-cell:nth-child(7) .tile-image,
.category-grid > .category-cell:nth-child(8) .tile-video,
.category-grid > .category-cell:nth-child(8) .tile-image,
.category-grid > .category-cell:nth-child(11) .tile-video,
.category-grid > .category-cell:nth-child(11) .tile-image,
.category-grid > a.category-tile:nth-child(1) .tile-video,
.category-grid > a.category-tile:nth-child(1) .tile-image,
.category-grid > a.category-tile:nth-child(4) .tile-video,
.category-grid > a.category-tile:nth-child(4) .tile-image,
.category-grid > a.category-tile:nth-child(7) .tile-video,
.category-grid > a.category-tile:nth-child(7) .tile-image,
.category-grid > a.category-tile:nth-child(8) .tile-video,
.category-grid > a.category-tile:nth-child(8) .tile-image,
.category-grid > a.category-tile:nth-child(11) .tile-video,
.category-grid > a.category-tile:nth-child(11) .tile-image {
  height: 450px;
}

/* Fill media */
.tile-image{
  background-size:cover;
  background-position:center;
  transition: transform .3s ease;
}
.tile-video video{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  transition: transform .3s ease;
}

.category-tile:hover .tile-image,
.category-tile:hover .tile-video video{
  transform: scale(1.03);
}

/* Optional soft gradient for label readability */
.tile-video::after,
.tile-image::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.35) 100%);
  pointer-events:none;
  z-index:1;
}

/* Label pill */
.tile-label{
  position:absolute; left:50%; bottom:12px; transform:translateX(-50%);
  z-index:2;
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 14px;
  background:#fff; color:#111;
  border-radius: 0;               /* keep your square style; change to 8px for rounded */
  font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  box-shadow:0 4px 10px rgba(0,0,0,.15);
  font-family:'ivyora-display','Times New Roman',serif !important;
}

/* Non-clickable header (kicker) above the image */
.product-tile-header{ margin:0 0 8px; }
.tile-kicker{
  margin:0;
  text-align:center;
  font-size:20px;
  color:#6b7280;
  background:#fff;
  border-radius:6px;
  margin-top: 20px;
}



/* ===== Responsive Adjustments ===== */
@media (max-width: 900px) {
  .twc-inspired-sundries {
    flex-direction: column;
    padding: 40px 20px;
  }
  .twc-sidebar-wrapper {
    width: 100%;
    margin-bottom: 30px;
  }
  .twc-main-content {
    padding-left: 0;
  }
}

.tile-video {
  width: 100%;
  height: 750px;
  overflow: hidden;
  position: relative;
}

.tile-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.category-tile:hover .tile-video video {
  transform: scale(1.03);
}




/* STRIP (horizontal, scrollable) */
.category-strip{
  display:flex;
  gap:16px;
  overflow-x:auto;
  margin:0 0 24px;
}

.category-strip::-webkit-scrollbar{ height:8px }
.category-strip::-webkit-scrollbar-thumb{ background:#d2d4d7; border-radius:8px }

/* CARD */
.strip-card{
  flex:0 0 160px;                /* don't shrink; base width */
  text-decoration:none;
  color:#111;
  scroll-snap-align:start;
}
@media (min-width:1200px){ .strip-card{ flex-basis:180px } }
@media (max-width:680px){  .strip-card{ flex-basis:45% } }  /* 2 per view on small */

/* MEDIA (portrait tile) */
.strip-card__media{
  position:relative;
  width:100%;
  aspect-ratio: 4 / 5;           /* consistent portrait ratio */
  overflow:hidden;
  background:#f6f7f8;
  box-shadow:0 1px 0 rgba(0,0,0,.06);
}
.strip-card__img,
.strip-card__video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .25s ease;
}
.strip-card:hover .strip-card__img,
.strip-card:hover .strip-card__video{ transform:scale(1.03) }

/* LABEL (like the example) */
.strip-card__label{
  position:absolute; left:0; right:0; bottom:0;
  padding:8px 10px;
  font-size:17px;
  text-align:center; letter-spacing:.02em;
  color:#fff;
  text-transform:none;           /* set to uppercase if you prefer */
  background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 75%);
  font-family: 'ivyora-display', 'Times New Roman', serif !important;
}

.page-title { 
  margin: 0 0 14px;
  padding-left: 40px;
  color: #202428;

  font-family: 'ivyora-display', 'Times New Roman', serif !important;
  font-size: 1.6rem;
  font-weight: var(--global-heading-font-weight, 400);
  letter-spacing: .05rem;
  line-height: 2.2rem;
  text-decoration: none;
  text-transform: none;
  font-style: normal;


}

.page-title h1 { 
  margin:0 0 6px; 
  font-size:clamp(22px,3vw,30px); 
  font-weight:400; 
  color:#202428; 
}

.page-title .page-subtitle {
   margin:0; 
   color:#6b7280; 
   font-size:clamp(14px,1.6vw,16px); 
}


/* Make the foam products block full-bleed (breaks out of theme's wrap) */
.sundries-page-wrapper{
  position: relative;
  width: 100vw;            /* span the viewport */
  left: 50%;
  right: 50%;
  margin-left: -50vw;      /* cancel the parent's max-width */
  margin-right: -50vw;
  max-width: none;         /* ignore theme container limits */
  background: #fff;        /* keep page background tidy */
}

/* Let inner container use all the width */
.twc-inspired-sundries{
  width: 100%;
  max-width: none;         /* remove any cap */
  margin: 0;
  padding: 40px clamp(16px,4vw,48px); /* responsive side padding */
  box-sizing: border-box;
}

/* Ensure the main column fills the space next to the sidebar */
.twc-main-content{
  flex: 1 1 auto;
  min-width: 0;            /* prevents flex item from shrinking oddly */
}

/* Grid should span the whole content column */
.category-grid{
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 30px;
}


/* ==== Marquee (ignore OS Reduced Motion via data-allow-motion) ==== */

.marquee{
  --scroll-speed: 45s;            /* slower = bigger number */
  overflow: hidden;
  margin: 0 0 24px;

  /* soft edge fade (optional) */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}

.marquee__track{
  display: inline-flex;
  gap: 16px;
  align-items: stretch;

  /* longhands + fallback (avoids Safari var() bug in shorthand) */
  animation-name: marquee-scroll;
  animation-duration: 45s;                 /* fallback */
  animation-duration: var(--scroll-speed, 45s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;

  will-change: transform;                  /* smoother on iOS/Safari */
}

.marquee:hover .marquee__track{
  animation-play-state: paused;            /* pause on hover */
}

/* Each card stays fixed width so loop distance is exact */
.strip-card{
  flex: 0 0 180px;
  text-decoration: none;
  color: #111;
}
@media (max-width: 680px){
  .strip-card{ flex-basis: 45vw; }
}

/* Loop motion: assumes two identical sets inside the track */
@keyframes marquee-scroll{
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-50%,0,0); } /* one full set width */
}

