/* Cottonia - Global Content Card Wrapper */

.cottonia-content-card{
  width: 100%;
  margin: 24px auto;
}

.cottonia-content-card__inner{
  /* Wider desktop card so Cart/Checkout columns have enough space */
  max-width: min(94vw, 1400px);
  margin: 0 auto;
  padding: 18px 18px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 20px;
  box-shadow: 0 18px 45px rgba(0,0,0,.08);
}

/* Card Title (WordPress page title) */
.cottonia-content-card__header{
  margin: 0 0 14px 0;
}
.cottonia-content-card__title{
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 800;
}
@media (max-width: 768px){
  .cottonia-content-card__title{ font-size: 20px; }
}

@media (max-width: 768px){
  .cottonia-content-card__inner{
    max-width: 100%;
    padding: 14px 14px;
    border-radius: 18px;
  }
}

body.cottonia-content-card-enabled .cottonia-content-card{
  padding: 18px 12px;
}

@media (max-width: 768px){
  body.cottonia-content-card-enabled .cottonia-content-card{
    padding: 14px 10px;
  }
}

/* If a theme header is tight, ensure there's breathing room */
body.cottonia-content-card-enabled .site-content,
body.cottonia-content-card-enabled .content-area{
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Cart: reduce space between header and the card (requested) */
body.woocommerce-cart.cottonia-content-card-enabled .site-content,
body.woocommerce-cart.cottonia-content-card-enabled .content-area{
  padding-top: 0 !important;
}
body.woocommerce-cart .cottonia-content-card{ margin-top: 8px !important; }
body.woocommerce-cart.cottonia-content-card-enabled .cottonia-content-card{ padding-top: 8px !important; }

/* Checkout: keep the same tight spacing */
body.woocommerce-checkout.cottonia-content-card-enabled .site-content,
body.woocommerce-checkout.cottonia-content-card-enabled .content-area{
  padding-top: 0 !important;
}
body.woocommerce-checkout .cottonia-content-card{ margin-top: 8px !important; }

/* =========================
   Page titles
   =========================
   We show the WP page title INSIDE the card.
   To avoid duplicates, hide common theme title outputs when the card is enabled.
*/
body.page.cottonia-content-card-enabled .entry-header,
body.page.cottonia-content-card-enabled .wp-block-post-title,
body.page.cottonia-content-card-enabled .entry-title,
body.page.cottonia-content-card-enabled h1.entry-title,
body.page.cottonia-content-card-enabled .page-header{
  display:none !important;
}


/* Respect hidden page title states from common themes/page builders */
body.no-page-title .cottonia-content-card__header,
body.hide-page-title .cottonia-content-card__header,
body.page-title-disabled .cottonia-content-card__header,
body.title-bar-disabled .cottonia-content-card__header,
body.ast-title-bar-disabled .cottonia-content-card__header,
body.ast-title-bar-hidden .cottonia-content-card__header,
body.elementor-page-title-disable .cottonia-content-card__header,
body.disable-page-title .cottonia-content-card__header,
body.page-template-elementor_header_footer .cottonia-content-card__header{
  display:none !important;
}

/* Woo Blocks headings: keep only WP page title */
body.woocommerce-cart .wc-block-cart__heading,
body.woocommerce-cart .wc-block-cart__title,
body.woocommerce-checkout .wc-block-checkout__heading,
body.woocommerce-checkout .wc-block-checkout__title,
body.woocommerce-checkout .wc-block-components-checkout-step__title{
  display:none !important;
}

/* =========================
   WooCommerce archives (Shop / Category / Tag)
   ========================= */

/* Hide Woo breadcrumb on archives (requested: Home / Services) */
body.post-type-archive-product .woocommerce-breadcrumb,
body.tax-product_cat .woocommerce-breadcrumb,
body.tax-product_tag .woocommerce-breadcrumb{
  display: none !important;
}

/* Archive card: make the inner spacing tighter (especially top). */
body.post-type-archive-product .cottonia-content-card--wc .cottonia-content-card__inner,
body.tax-product_cat .cottonia-content-card--wc .cottonia-content-card__inner,
body.tax-product_tag .cottonia-content-card--wc .cottonia-content-card__inner{
  padding-top: 0 !important;
  padding-bottom: 12px !important;
}

/* Archive: reduce the outer gap (card too far from header/footer) */
body.post-type-archive-product .cottonia-content-card--wc,
body.tax-product_cat .cottonia-content-card--wc,
body.tax-product_tag .cottonia-content-card--wc{
  /* Slightly more breathing room outside the card (requested). */
  margin-top: 33px !important;
  margin-bottom: 37px !important;
}

/* Archive: reduce header/title gaps inside the card */
body.post-type-archive-product .cottonia-content-card--wc .woocommerce-products-header,
body.tax-product_cat .cottonia-content-card--wc .woocommerce-products-header,
body.tax-product_tag .cottonia-content-card--wc .woocommerce-products-header{
  padding-top: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

body.post-type-archive-product .cottonia-content-card--wc .woocommerce-products-header .woocommerce-products-header__title,
body.tax-product_cat .cottonia-content-card--wc .woocommerce-products-header .woocommerce-products-header__title,
body.tax-product_tag .cottonia-content-card--wc .woocommerce-products-header .woocommerce-products-header__title{
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

/* =========================
   WooCommerce single product
   ========================= */

/* Single product: tighten outer gap from header/footer */
body.single-product .cottonia-content-card--product{
  /* Reduce gap from header, but keep a small top margin. */
  margin-top: 6px !important;
  margin-bottom: 12px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Single product: add inner top breathing space */
body.single-product .cottonia-content-card--product .cottonia-content-card__inner{
  /* Keep product header compact while leaving a small breathing space */
  padding-top: 20px !important;
}

/* Breadcrumbs spacing inside the product card (avoid sticking to the product image) */
body.single-product .cottonia-content-card--product .ast-breadcrumbs{
  margin-bottom: 6px !important;
}

/* Some themes add extra padding above product area; reduce it */
body.single-product .site-content,
body.single-product .content-area{
  padding-top: 0 !important;
}


/* Lightbox */
.cottonia-aui-lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 24px;
}
.cottonia-aui-lightbox.is-open{ display:flex; }
.cottonia-aui-lightbox__img{
  max-width: min(92vw, 980px);
  max-height: 85vh;
  border-radius: 16px;
  background: #fff;
}
.cottonia-aui-lightbox__close{
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}



/* Homepage: optional tighter inner padding (when enabled) */
body.cottonia-content-card-enabled .cottonia-content-card--home .cottonia-content-card__inner{
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
