/*
Theme Name: S2H Custom Themes
Description: S2HCYCLE storefront layouts for staging.
Template: twentytwentyfive
Version: 0.1.21
Requires at least: 6.7
Requires PHP: 7.2
Text Domain: s2hcycle-twenty-twenty-five
*/

:root {
  --s2h-ink: #202326;
  --s2h-deep: #102752;
  --s2h-blue: #004bd8;
  --s2h-pale: #eaf4ff;
  --s2h-line: #dbe2eb;
}

.s2h-wrap { max-width: 1180px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 52px); }
.s2h-header {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(140px, 360px) minmax(max-content, 1fr);
  grid-template-areas: "logo search actions" "nav nav nav";
  align-items: center;
  gap: 8px 16px;
  padding-block: 12px 0;
}
.s2h-header > .s2h-logo,
.s2h-header > .s2h-search,
.s2h-header > .s2h-actions,
.s2h-header > .s2h-nav { margin: 0; }
.s2h-header .s2h-logo { grid-area: logo; }
.s2h-header .s2h-logo img { width: 115px; height: auto; }
.s2h-actions { grid-area: actions; display: flex; gap: 4px; align-items: center; justify-self: end; }
.s2h-actions > p { margin: 0; }
.s2h-actions > p > a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; color: var(--s2h-ink); }
.s2h-header .s2h-search { grid-area: search; min-width: 0; }
.s2h-header .s2h-nav { grid-area: nav; color: var(--s2h-ink); }
.s2h-category-menu { display: none; }
header .s2h-category-menu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 2px 8px;
  background: transparent;
  color: var(--s2h-blue);
  border: 1px solid var(--s2h-line);
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: .84rem;
}
header .s2h-category-menu:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 4px 0 6px 12px;
}
header .s2h-category-menu li { margin: 0; min-width: 0; }
header .s2h-category-menu a {
  display: block;
  padding: 7px 4px;
  font-size: .9rem;
  overflow-wrap: anywhere;
}

@media (min-width: 600px) and (any-hover: hover) and (any-pointer: fine) {
  header .s2h-category-menu-toggle { display: none; }
  header .s2h-category-nav-item { position: relative; }
  header .s2h-category-menu:not([hidden]) {
    position: absolute;
    z-index: 20;
    inset-block-start: 100%;
    inset-inline-start: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 8px;
    box-sizing: border-box;
    width: min(32rem, calc(100vw - 28px));
    max-height: min(56vh, 27rem);
    overflow: auto;
    margin: 0;
    padding: 8px;
    list-style: none;
    border: 1px solid var(--s2h-line);
    border-radius: 4px;
    background: #fff;
    color: var(--s2h-deep);
    box-shadow: 0 6px 20px rgb(16 39 82 / 14%);
    transform: translateX(var(--s2h-category-menu-offset, 0px));
  }
  header .s2h-category-menu li { min-width: 0; margin: 0; }
  header .s2h-category-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 3px;
    font-size: .9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }
  header .s2h-category-menu a:is(:hover, :focus-visible) {
    background: var(--s2h-pale);
    color: var(--s2h-blue);
  }
}

.s2h-header .s2h-search .wp-block-search__inside-wrapper { width: 100%; align-items: center; gap: 6px; }
.s2h-header .s2h-search .wp-block-search__input { min-width: 0; }
.s2h-header .s2h-search .wp-block-search__button {
  display: inline-flex; justify-content: center; align-items: center; flex: 0 0 44px;
  min-height: 44px; margin: 0; padding: 0; background: transparent; color: var(--s2h-ink); border-radius: 4px;
}
.s2h-header .s2h-search .wp-block-search__button:hover { background: var(--s2h-pale); }
.s2h-account a { position: relative; }
.s2h-account a::before, .s2h-account a::after { content: ""; position: absolute; border: 1.5px solid currentColor; }
.s2h-account a::before { top: 12px; width: 7px; height: 7px; border-radius: 50%; }
.s2h-account a::after { bottom: 12px; width: 16px; height: 7px; border-radius: 8px 8px 2px 2px; }
.s2h-hero { background-color: var(--s2h-pale); padding-block: clamp(32px, 6vw, 66px); }
.s2h-hero h1 { color: var(--s2h-deep); font-size: clamp(35px, 6vw, 64px); line-height: 1.08; margin: 0 0 20px; }
.s2h-main h2 { color: var(--s2h-deep); }
.s2h-main .wp-block-button__link { color: #fff; background-color: var(--s2h-blue); border-radius: 4px; }
.s2h-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-bottom: 1px solid var(--s2h-line); padding-block: 16px; }
.s2h-services p { margin: 0; }
.s2h-services a { color: var(--s2h-deep); font-weight: 600; }
.s2h-shelf, .s2h-guide { border-top: 1px solid var(--s2h-line); padding-block: 18px; }
.s2h-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.s2h-products-full { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s2h-products > .wp-block-image { min-width: 0; aspect-ratio: 1; margin: 0; border: 1px solid var(--s2h-line); border-radius: 4px; background: #fff; }
.s2h-products .wp-block-image a { display: block; height: 100%; }
.s2h-products .wp-block-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.s2h-products .wp-block-image:focus-within { outline: 2px solid var(--s2h-blue); outline-offset: 2px; }
.s2h-list-toggle > summary { color: var(--s2h-blue); cursor: pointer; padding-block: 10px; font-weight: 600; }
.s2h-rolling { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 52px); align-items: center; }
.s2h-rolling > .wp-block-image { width: 100%; max-width: 520px; margin: 0; }
.s2h-rolling > .wp-block-image img { display: block; width: 100%; height: auto; }
.s2h-category-page { padding-block: clamp(28px, 5vw, 64px); }
.s2h-category-page > .wp-block-post-title {
  margin: 0;
  color: var(--s2h-deep);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
}
.s2h-category-page > .s2h-category-intro { max-width: 55ch; margin-block: 12px 24px; }
.s2h-category-page > .s2h-category-directory { margin-block: 24px clamp(24px, 4vw, 40px); }
.s2h-category-directory > h2 { margin-block: 0 14px; }
.s2h-category-cards,
.s2h-category-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.s2h-category-cards { grid-template-columns: repeat(auto-fill, minmax(min(185px, 100%), 1fr)); gap: 14px; }
.s2h-category-cards > li,
.s2h-category-links > li { min-width: 0; margin: 0; }
.s2h-category-cards a,
.s2h-category-links a {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--s2h-line);
  border-radius: 4px;
  background: #fff;
  color: var(--s2h-deep);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.s2h-category-cards a { flex-direction: column; align-items: stretch; padding: 0; text-decoration: none; }
.s2h-category-card-art { display: block; border-radius: 3px 3px 0 0; }
.s2h-category-card-name { padding: 10px 12px; line-height: 1.35; }
.s2h-category-cards a:hover,
.s2h-category-cards a:focus-visible,
.s2h-category-links a:hover,
.s2h-category-links a:focus-visible { background: var(--s2h-pale); color: var(--s2h-blue); }
.s2h-category-cards a:focus-visible,
.s2h-category-links a:focus-visible { outline: 2px solid var(--s2h-blue); outline-offset: 2px; }
.s2h-category-page > .s2h-category-system {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  margin: 0;
  padding-block: clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--s2h-line);
}
.s2h-category-page > .s2h-category-system-with-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.s2h-category-system > .wp-block-image,
.s2h-category-system > .s2h-category-copy,
.s2h-category-copy > h2 { margin: 0; }
.s2h-category-system > .wp-block-image img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.s2h-category-card-art,
.s2h-category-system-branded > .wp-block-image {
  position: relative;
  aspect-ratio: 1;
  background: url("assets/ridelogic-product-frame.webp") center / contain no-repeat;
}
.s2h-category-card-art > img,
.s2h-category-system-branded > .wp-block-image img {
  position: absolute;
  top: 18%;
  left: 6%;
  width: 88%;
  height: 71%;
  aspect-ratio: auto;
  object-fit: contain;
}
.s2h-category-copy > :is(p, ul, .wp-block-buttons) { margin-block: 12px 0; }

@media (max-width: 540px) {
  .s2h-category-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

@media (max-width: 720px) {
  .s2h-category-page > .s2h-category-system-with-photo { grid-template-columns: 1fr; }
}
.s2h-preview-note { color: #505d6e; font-size: .85rem; }
.s2h-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; padding-block: 16px; border-top: 1px solid var(--s2h-line); font-size: .875rem; }
.s2h-footer > p, .s2h-footer > .s2h-whatsapp, .s2h-footer .s2h-whatsapp > * { margin: 0; }
.s2h-footer .s2h-whatsapp img { display: block; width: 18px; height: 18px; }
.s2h-whatsapp { display: flex; align-items: center; gap: 6px; }
.s2h-footer .s2h-footer-credit { flex-basis: 100%; padding-top: 10px; border-top: 1px solid var(--s2h-line); color: #505d6e; }
.s2h-footer-credit a { color: var(--s2h-deep); text-underline-offset: .15em; }

.s2h-whatsapp-button {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 54px;
  height: 54px;
  border: 1px solid #12843d;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}
.s2h-whatsapp-button img { display: block; width: 26px; height: 26px; }
.s2h-whatsapp-button:hover { background: #effaf2; }
.s2h-whatsapp-button:focus-visible { outline: 2px solid #12843d; outline-offset: 3px; }

@media (min-width: 600px) {
  .s2h-header > .s2h-nav { border-top: 1px solid var(--s2h-line); font-size: .9375rem; }
  .s2h-header .s2h-nav .wp-block-navigation__container { column-gap: clamp(12px, 3vw, 32px); }
  .s2h-header .s2h-nav .wp-block-navigation-item__content { display: inline-flex; align-items: center; min-height: 42px; }
  .s2h-header .s2h-nav .wp-block-navigation-item__content:hover { text-decoration: underline; text-underline-offset: .2em; }
}

@media (width < 600px) {
  .s2h-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "logo actions nav" "search search search";
    gap: 8px 4px;
    padding-block-end: 12px;
  }
  .s2h-header .s2h-logo img { width: 94px; }
  .s2h-header .s2h-nav .wp-block-navigation__responsive-container-open {
    min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
  }
}

@media (max-width: 630px) {
  .s2h-services { grid-template-columns: 1fr; }
  .s2h-products-full { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s2h-rolling { grid-template-columns: 1fr; }
  .s2h-footer { justify-content: flex-start; }
  .single-product .s2h-whatsapp-button { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}


.single-product :is(
  .product_title, .wp-block-post-title, .woocommerce-product-details__short-description,
  .woocommerce-Tabs-panel--description, .wp-block-post-content,
  .wp-block-woocommerce-product-summary, .wp-block-woocommerce-product-details
) {
  font-family: var(--wp--preset--font-family--manrope, system-ui), "Apple Color Emoji",
    "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
}
.single-product :is(img.emoji, img.wp-smiley, img.s2h-product-icon) {
  display: inline;
  width: 1em;
  height: 1em;
  object-fit: contain;
  vertical-align: -0.12em;
}


/* Compact catalogue: reuse the original card system, no extra font/script. */
.s2h-category-page .s2h-category-directory { margin-block: 24px 32px; }
.s2h-compact-path { margin-block: 12px; font-size: .92rem; }
.s2h-compact-path > ol { display: flex; flex-wrap: wrap; gap: .3em .6em; margin: 0; padding: 0; list-style: none; }
.s2h-compact-path li { overflow-wrap: anywhere; }
.s2h-compact-path li + li::before { content: "→"; margin-inline-end: .55em; color: #505d6e; }
.s2h-compact-path a { text-decoration: underline; text-underline-offset: .15em; }
.s2h-compact-actions { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-block: 18px 28px; }
.s2h-compact-node-products { margin-block: 28px 0; }
.s2h-compact-guides { margin-block-start: 28px; }
.s2h-compact-guides > .s2h-category-system { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 48px); padding-block: clamp(20px, 4vw, 40px); border-top: 1px solid var(--s2h-line); }
.s2h-compact-guides > .s2h-category-system-with-photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.s2h-compact-guides > .s2h-category-intro { max-width: 55ch; }
@media (max-width: 720px) {
  .s2h-compact-guides > .s2h-category-system-with-photo { grid-template-columns: 1fr; }
}

/* Preserve Advanced Woo Search in the same responsive header grid. */
.s2h-header .s2h-search-aws .aws-container { width: 100%; min-width: 0; }
.s2h-header .s2h-search-aws .aws-search-field { min-width: 0; }
