/* Rosaifa 4.14.2 — section-by-section layout harmony. */

/* Shared section heading rhythm and safe alignment. */
.rf-home-p4 .rf-section-head,
.rf-home-p4 .rf-section-head-wide{
  align-items:end;
  column-gap:24px;
}
.rf-home-p4 .rf-section-head .rf-display{margin-block:0;min-width:0}
.rf-home-p4 .rf-section-head>.rf-arrow-link{
  align-self:end;
  justify-self:end;
  margin-bottom:4px;
  white-space:nowrap;
}

/* Ten homepage categories become two balanced rows on wide screens. */
@media(min-width:1181px){
  .rf-front-page .rf-category-grid-v2{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
  .rf-front-page .rf-category-art-v2{aspect-ratio:1.22/1}
  .rf-front-page .rf-category-card-copy{padding:15px 15px 17px}
}

/* Keep category cards and their content aligned within every row. */
.rf-category-grid-v2{align-items:stretch}
.rf-category-grid-v2>.rf-category-card-v2{height:100%;grid-template-rows:auto 1fr}
.rf-category-card-copy{align-content:start}
.rf-category-card-copy em{align-self:end}

/* Homepage product cards keep image, title, price and actions on common rows. */
.rf-products-section .rf-product-grid{align-items:stretch}
.rf-products-section .rf-product-card{display:flex;flex-direction:column;height:100%;min-width:0}
.rf-products-section .rf-product-card>.rf-product-meta{display:flex;flex:1 1 auto;flex-direction:column}
.rf-products-section .rf-product-card .rf-price{margin-top:auto}
.rf-products-section .rf-product-card .rf-quick-add,
.rf-products-section .rf-product-card .button{margin-top:12px}

/* Top-level Shop discovery has exactly five cards: one calm, complete row. */
@media(min-width:1101px){
  .woocommerce-shop .rf-archive-subcats{
    grid-template-columns:repeat(5,minmax(0,1fr));
  }
}
.rf-archive-subcats{align-items:stretch}
.rf-archive-subcat{height:100%;min-width:0}

/* Archive cards remain vertically aligned even with long product names. */
.post-type-archive-product .woocommerce ul.products li.product,
.tax-product_cat .woocommerce ul.products li.product,
.tax-product_tag .woocommerce ul.products li.product{height:100%}
.post-type-archive-product .woocommerce ul.products li.product>.button,
.tax-product_cat .woocommerce ul.products li.product>.button,
.tax-product_tag .woocommerce ul.products li.product>.button{width:100%}

/* PDP: stable gallery plane and balanced commerce column. */
.single-product .woocommerce-product-gallery__wrapper{min-height:clamp(420px,48vw,660px)}
.single-product .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery__image>a{display:block;height:100%;min-height:inherit}
.single-product .woocommerce-product-gallery__image img{display:block;margin:auto;min-height:inherit}
.single-product div.product .summary{align-self:start}
.single-product .summary form.cart{width:100%}

/* Cart, checkout and account headings share the storefront content edge. */
.woocommerce-cart .rf-woocommerce-main,
.woocommerce-checkout .rf-woocommerce-main,
.woocommerce-account .rf-woocommerce-main{min-width:0}
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-account .woocommerce{min-width:0}

/* Footer columns align from the same top line without changing disclosure logic. */
.rf-site-footer .rf-footer-grid{align-items:start}
.rf-site-footer .rf-footer-col,
.rf-site-footer .rf-footer-brand{min-width:0}

@media(max-width:1180px) and (min-width:821px){
  .rf-front-page .rf-category-grid-v2{grid-template-columns:repeat(3,minmax(0,1fr))}
  .woocommerce-shop .rf-archive-subcats{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:820px){
  .rf-home-p4 .rf-p4-section{padding-block:36px}
  .rf-home-p4 .rf-section-head,
  .rf-home-p4 .rf-section-head-wide{
    align-items:end;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
  }
  .rf-home-p4 .rf-section-head>.rf-arrow-link{font-size:12px;margin-bottom:3px}
  .rf-front-page .rf-category-grid-v2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rf-p4-campaign .rf-editorial-split-grid{grid-template-columns:1fr}
  .rf-p4-campaign .rf-editorial-image{border-radius:22px 22px 0 0;min-height:300px}
  .rf-p4-campaign .rf-editorial-copy{border-radius:0 0 22px 22px;padding:30px 24px}
  .rf-authenticity-grid{align-items:start}
  .single-product .woocommerce-product-gallery__wrapper{min-height:auto}
  .single-product .woocommerce-product-gallery__image,
  .single-product .woocommerce-product-gallery__image>a,
  .single-product .woocommerce-product-gallery__image img{min-height:0}
}

@media(max-width:520px){
  .rf-home-p4 .rf-section-head .rf-display{font-size:32px;line-height:1.04}
  .rf-home-p4 .rf-section-head>.rf-arrow-link{font-size:11px;white-space:normal;text-align:right}
  .rf-category-card-copy strong{font-size:16px;overflow-wrap:anywhere}
  .rf-category-card-copy em{font-size:10px;margin-top:10px}
  .rf-products-section .rf-product-card .rf-quick-add,
  .rf-products-section .rf-product-card .button{min-height:42px}
  .rf-p4-concern-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .rf-p4-campaign .rf-editorial-image{min-height:250px}
  .rf-p4-campaign .rf-editorial-copy{padding:26px 20px}
  .rf-p4-campaign .rf-editorial-copy h2{font-size:40px;line-height:1.02}
  .single-product .summary form.cart:not(.variations_form),
  .single-product .summary .woocommerce-variation-add-to-cart{
    grid-template-columns:76px minmax(0,1fr)!important;
  }
  .single-product .summary form.cart .rf-v4139-buy-now{grid-column:1/-1}
  .rf-site-footer .rf-footer-signature{padding-block:34px 28px}
}

@media(max-width:370px){
  .rf-home-p4 .rf-section-head,
  .rf-home-p4 .rf-section-head-wide{display:block}
  .rf-home-p4 .rf-section-head>.rf-arrow-link{display:inline-flex;margin-top:10px;text-align:left}
}
