﻿/* Keep general content aligned with the header; full-bleed grids opt out. */
@media (min-width: 1201px) {
  body:is(.dgp-shop-catalog:not(.home), .dgp-new-arrivals-page, .page-id-814) {
    --dgp-site-max-width: calc(var(--retail-header-width, 1400px) + var(--retail-header-gutter, 24px) * 2);
    --dgp-container-padding: var(--retail-header-gutter, 24px);
  }
}

body #main :is(
  .dgp-shop-hero__inner, .dgp-shop-category-rail__inner,
  .dgp-shop-featured-categories__carousel, .dgp-shop-toolbar__inner,
  .dgp-shop-shelf, .dgp-shop-layout, .dgp-shop-trust__inner,
  .dgp-shop-guides, .dgp-recently-viewed,
  .dgp-news__wrap, .dgp-special__wrap, .dgp-design__wrap,
  .dgp-container, .dgp-wrap, .story-wrap
),
body #main .elementor-top-section > .elementor-container,
body #footer :is(.dgp-site-footer__inner, .dgp-site-footer__consult-inner) {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: var(--dgp-site-max-width, 1300px) !important;
  margin-inline: auto !important;
  padding-inline: var(--dgp-container-padding, 15px) !important;
}

/* Outer Flatsome rows already have column gutters. Do not inset them twice. */
body #main > .page-wrapper > .row,
body #main > .row,
body #main .product-container .row {
  max-width: var(--dgp-site-max-width, 1300px) !important;
  width: 100% !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}
body #main .container > .row:not(.row-collapse) {
  width: calc(100% + 30px) !important;
  max-width: none !important;
  margin-inline: -15px !important;
  padding-inline: 0 !important;
}

/* Custom catalog grids own their gaps and must not inherit Flatsome row insets. */
body #main .dgp-shop-main .products.row,
body #main .dgp-product-card-component > .products.row,
body #main .dgp-shop-shelf .products.row {
  width: 100% !important;
  max-width: none !important;
  padding-inline: 0 !important;
  margin-inline: 0 !important;
}
body #main .dgp-shop-main .shop-container,
body #main .product-container {
  padding-inline: 0 !important;
}

@media (min-width: 1201px) {
  body.dgp-shop-catalog:not(.home) #main .dgp-shop-layout {
    box-sizing: border-box;
    width: calc(100% - var(--retail-header-gutter, 24px) * 2) !important;
    max-width: var(--retail-header-width, 1400px) !important;
    padding-inline: 0 !important;
  }
}

/* Secondary product pages share the header's content width and side gutters. */
body.page-id-814 #main .dgp-promotion-catalog > .col,
body.page-id-814 #main .dgp-promotion-products {
  padding-inline: 0 !important;
}
@media (min-width: 1201px) {
  body.dgp-new-arrivals-page #main .dgp-new-arrivals__main .products.row {
    box-sizing: border-box !important;
    width: calc(100% - var(--retail-header-gutter, 24px) * 2) !important;
    max-width: var(--retail-header-width, 1400px) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
  }
}
@media (max-width: 767px) {
  body.dgp-new-arrivals-page #main .dgp-new-arrivals__main .products.row {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
}
body #main .dgp-shop-featured-categories { padding-inline: 0 !important; }
body #main .dgp-shop-featured-categories__header { padding-inline: var(--dgp-container-padding, 15px); }

/* A photographic banner remains full bleed; its text follows the common grid. */
body #main :is(.elementor-element-dgpHero, .dgp-hero-section) > .elementor-container {
  max-width: var(--dgp-site-max-width, 1300px) !important;
  padding-inline: var(--dgp-container-padding, 15px) !important;
  margin-inline: auto !important;
}

/* Page-specific presentation shells share the same desktop reading width. */
body #main :is(
  .dgp-design__wrap,
  .dgp-shop-slide__inner,
  .dgp-visual-about-hero .elementor-container,
  .dgp-visual-about-statement > .elementor-container
) {
  max-width: var(--dgp-site-max-width, 1300px) !important;
}
body #main .dgp-shop-slider__controls {
  right: max(32px, calc((100vw - var(--dgp-site-max-width, 1300px)) / 2 + 32px)) !important;
}
body.page-id-476 #main :is(
  .dgp-about-v3 > .elementor-container,
  .dgp-story > .elementor-container,
  .ab-page > .elementor-container,
  .elementor-element-9200540 > .elementor-container,
  .dgp-about-chapter-rail
) {
  max-width: var(--dgp-site-max-width, 1300px) !important;
}
