/*
Theme Name: Fibro Planet
Theme URI: https://fibroplanet.com/
Author: Curcuma
Description: Tema a medida para tienda WooCommerce de Fibro Planet.
Version: 0.2.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: fibroplanet
*/

/* Final QA corrections requested during project closeout. */

@media (max-width: 767px) {
  .home .fp-hero h1[data-fp-arc-title] {
    width: 100%;
    max-width: 100%;
    margin-bottom: 22px;
    padding-inline: 8px;
    font-size: clamp(1.72rem, 8vw, 2.3rem);
    white-space: nowrap;
  }

  .home .fp-hero__tagline {
    margin-top: 0;
  }

  .home .fp-main--catalogo-consultivo h2,
  .home .fp-main--catalogo-consultivo h3,
  .home .fp-main--catalogo-consultivo strong {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  .home .fp-main--catalogo-consultivo :is(
    .fp-trust-band__intro,
    .fp-section-heading,
    .fp-project-spotlight__heading,
    .fp-salons__content,
    .fp-buy-steps__heading,
    .fp-instagram-cta__content,
    .fp-about-strip
  ) h2 {
    width: 100%;
    max-width: min(100%, 18ch);
    padding-inline: 4px;
    font-size: clamp(1.9rem, 8.2vw, 2.55rem);
    line-height: 1.08;
    white-space: normal;
  }

  .home .fp-hero__stickers {
    display: block;
    overflow: hidden;
  }

  .home .fp-hero-sticker {
    width: clamp(82px, 24vw, 108px);
    padding: 4px;
    border-width: 3px;
    opacity: .72;
    box-shadow: 5px 6px 0 rgba(12, 75, 42, .58);
    animation: fp-mobile-sticker-float 3.4s ease-in-out infinite alternate;
  }

  .home .fp-hero-sticker--fire {
    top: 18%;
    left: -38px;
  }

  .home .fp-hero-sticker--sweet {
    top: 20%;
    right: -38px;
    animation-delay: -1.2s;
  }

  .home .fp-hero-sticker--rainbow {
    display: none;
  }
}

/* Purchase journey: center every Dashicon inside the rotated step badge. */
.home .fp-buy-steps .fp-steps--journey .fp-step-icon {
  position: relative;
  display: grid;
  align-content: center;
  align-items: center;
  justify-content: center;
  justify-items: center;
}

.home .fp-buy-steps .fp-steps--journey .fp-step-icon > i.dashicons {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  place-items: center;
  font-size: 32px;
  line-height: 1;
}

.home .fp-buy-steps .fp-steps--journey .fp-step-icon > i.dashicons::before {
  display: block;
  width: 1em;
  height: 1em;
  margin: 0;
  line-height: 1;
}

@media (max-width: 767px) {
  .home .fp-buy-steps .fp-steps--journey .fp-step-icon > i.dashicons {
    width: 54px;
    height: 54px;
    font-size: 38px;
  }
}

@keyframes fp-mobile-sticker-float {
  from { translate: 0 -4px; }
  to { translate: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .home .fp-hero-sticker {
    animation: none;
  }
}

.fp-project-spotlight__photo > a {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  color: inherit;
}

.fp-project-spotlight__photo > a::after {
  content: "Ampliar";
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  padding: 0.45rem 0.7rem;
  border: 2px solid var(--fp-forest);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.94);
  color: var(--fp-forest);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fp-project-spotlight__photo > a img {
  transition: transform 240ms ease, filter 240ms ease;
}

.fp-project-spotlight__photo > a:hover img,
.fp-project-spotlight__photo > a:focus-visible img {
  transform: scale(1.025);
  filter: saturate(1.08) contrast(1.03);
}

.fp-faq {
  position: relative;
  isolation: isolate;
  background-image:
    linear-gradient(rgba(236, 246, 225, 0.9), rgba(236, 246, 225, 0.94)),
    url("../images/hero-polo-market.webp");
  background-position: center;
  background-size: cover;
}

.fp-polo-collection__grid figure > a {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  color: inherit;
}

.fp-polo-collection__grid figure > a img {
  transition: transform 240ms ease, filter 240ms ease;
}

.fp-polo-collection__grid figure > a:hover img,
.fp-polo-collection__grid figure > a:focus-visible img {
  transform: scale(1.025);
  filter: saturate(1.08) contrast(1.03);
}


/*
 * Responsive typography contract:
 * words may wrap only between words. The theme JS turns display titles into
 * word spans, so those spans must remain indivisible at every breakpoint.
 */
body :is(
  .fp-main--catalogo-consultivo,
  .fp-site-header,
  .fp-site-footer,
  .fp-topbar
) :is(h1, h2, h3, h4, h5, h6, p, li, a, button, label, strong, em, small) {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

body .fp-main--catalogo-consultivo .fp-title-word {
  display: inline-block;
  white-space: nowrap;
}

body .fp-main--catalogo-consultivo .fp-title-letter {
  display: inline-block;
  white-space: pre;
}

body :is(.fp-main--catalogo-consultivo, .fp-site-header, .fp-site-footer) :is(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
}

body :is(.fp-main--catalogo-consultivo, .fp-site-footer) p {
  text-wrap: pretty;
}

/* Keep the mobile hierarchy readable without forcing words into narrow boxes. */
@media (max-width: 700px) {
  body .fp-main--catalogo-consultivo :is(
    .fp-section-heading h2,
    .fp-trust-band__intro h2,
    .fp-buy-steps__heading h2,
    .fp-project-spotlight__heading h2,
    .fp-polo-collection__heading h2,
    .fp-salons__content h2,
    .fp-instagram-cta__content h2,
    .fp-about-strip h2
  ) {
    width: auto;
    max-width: min(100%, 21ch);
    margin-inline: auto;
    padding-inline: 0;
  }

  body .fp-main--catalogo-consultivo .fp-category-grid--families .fp-category-card__body strong,
  body .fp-main--catalogo-consultivo .fp-faq .fp-faq-card h3,
  body .fp-main--catalogo-consultivo .fp-buy-steps .fp-steps--journey strong {
    width: auto;
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
  }

  body .fp-main--catalogo-consultivo .fp-catalog-card__body h3,
  body .fp-main--catalogo-consultivo .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: clamp(1.1rem, 5.4vw, 1.42rem);
    line-height: 1.14;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Closeout contract: one purchase path, complete product images and safe mobile UI. */
.fp-main--catalogo-consultivo :is(h1, h2, h3, h4, strong) {
  max-inline-size: 100%;
}

.fp-main--catalogo-consultivo .fp-title-letters {
  white-space: normal;
}

.fp-main--catalogo-consultivo .fp-title-word {
  max-width: 100%;
}

.home .fp-hero h1[data-fp-arc-title] {
  max-width: min(100%, 15ch);
  margin-inline: auto;
  letter-spacing: 0;
  line-height: .96;
}

.fp-catalog-card__image {
  aspect-ratio: 4 / 3;
  padding: 12px;
  background: #fffdf7;
}

.fp-catalog-card__image img {
  object-fit: contain;
  object-position: center;
}

.fp-catalog-card:hover .fp-catalog-card__image img {
  transform: scale(1.025);
}

.fp-catalog-card__body {
  min-height: 250px;
}

.fp-catalog-card__body h3 {
  font-size: clamp(1.3rem, 1.7vw, 1.7rem);
  line-height: 1.12;
  overflow-wrap: normal;
  word-break: normal;
}

.fp-catalog-card__actions {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.single-product .woocommerce-product-gallery__image {
  display: grid;
  min-height: min(620px, 70vh);
  place-items: center;
  padding: clamp(12px, 2vw, 24px);
  background: #fff;
}

.single-product .woocommerce-product-gallery__image img {
  width: 100%;
  max-height: min(620px, 70vh);
  object-fit: contain;
  object-position: center;
}

.fp-product-specs {
  margin: 22px 0;
  padding: 20px;
  border: 2px solid var(--fp-forest);
  border-radius: 14px;
  background: #fffdf7;
}

.fp-product-specs h2 {
  margin: 0 0 14px;
  color: var(--fp-forest-deep);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.15;
}

.fp-product-specs dl,
.fp-product-specs dd {
  margin: 0;
}

.fp-product-specs dl {
  display: grid;
  gap: 10px;
}

.fp-product-specs dl > div {
  display: grid;
  grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--fp-line);
}

.fp-product-specs dt {
  color: var(--fp-forest-deep);
  font-weight: 900;
}

/* Give the salons page its own editorial rhythm instead of repeating home cards. */
.fp-salons-page .fp-salons-audience {
  background: #f3d6e4;
}

.fp-salons-page .fp-salons-audience__grid {
  gap: 0;
  border-block: 3px solid var(--fp-forest-deep);
}

.fp-salons-page .fp-salons-audience__grid article {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.fp-salons-page .fp-salons-audience__grid article + article {
  border-left: 2px solid rgba(12, 75, 42, .35);
}

.fp-salons-page .fp-salons-process {
  background: #f4dca1;
}

.fp-salons-page .fp-project-steps {
  counter-reset: salon-step;
  gap: 0;
  border-top: 4px solid var(--fp-forest-deep);
}

.fp-salons-page .fp-project-steps li {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.fp-salons-page .fp-project-steps li + li {
  border-left: 2px dashed rgba(12, 75, 42, .42);
}

.fp-catalog-card__cart {
  flex-basis: auto;
}

@media (min-width: 701px) and (max-width: 820px) {
  .fp-instagram-cta__content h2 {
    max-width: 16ch;
    font-size: clamp(2.35rem, 6vw, 2.85rem);
  }
}

.fp-buy-steps .fp-steps--journey strong,
.fp-faq .fp-faq-card h3 {
  width: auto;
  max-width: min(100%, 22ch);
}

@media (max-width: 767px) {
  body {
    box-sizing: border-box;
    padding-right: 58px;
    padding-bottom: 0;
  }

  body::after {
    position: fixed;
    z-index: 998;
    top: 0;
    right: 0;
    bottom: 0;
    width: 58px;
    background: var(--fp-forest-deep);
    content: '';
    pointer-events: none;
  }

  .fp-floating-actions {
    right: 6px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: auto;
    display: grid;
    grid-auto-flow: row;
    gap: 8px;
    z-index: 999;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
  }

  .fp-floating-action,
  .fp-floating-action:hover {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-width: 2px;
    box-shadow: 0 6px 18px rgba(12, 75, 42, .2);
    transform: none;
  }

  .fp-floating-action img {
    width: 25px;
    height: 25px;
  }

  .fp-main--catalogo-consultivo :is(
    .fp-section-heading h2,
    .fp-project-spotlight__heading h2,
    .fp-salons__content h2,
    .fp-instagram-cta__content h2,
    .fp-about-strip h2
  ) {
    max-width: min(100%, 23ch);
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.08;
  }

  .fp-buy-steps .fp-steps--journey {
    padding-left: 0;
  }

  .fp-buy-steps .fp-steps--journey::before {
    display: none;
  }

  .fp-buy-steps .fp-steps--journey > li,
  .fp-faq .fp-faq-card {
    min-height: 0;
    gap: 18px;
    padding: 24px 18px;
  }

  .fp-buy-steps .fp-steps--journey strong,
  .fp-faq .fp-faq-card h3 {
    width: auto;
    max-width: min(100%, 21ch);
    font-size: clamp(1.35rem, 6.5vw, 1.75rem);
    line-height: 1.12;
  }

  .fp-catalog-grid {
    gap: 18px;
  }

  .fp-catalog-card__image {
    aspect-ratio: 16 / 11;
    padding: 10px;
  }

  .fp-catalog-card__body {
    min-height: 0;
    padding: 16px;
  }

  .fp-catalog-card__actions {
    grid-template-columns: 1fr;
  }

  .single-product .woocommerce-product-gallery__image {
    min-height: 340px;
  }

  .fp-product-specs dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .fp-salons-page .fp-salons-audience__grid article + article,
  .fp-salons-page .fp-project-steps li + li {
    border-left: 0;
    border-top: 2px dashed rgba(12, 75, 42, .42);
  }
}
