/**
 * Elementor Stretch Container Styles
 *
 * Provides full-width container with boxed inner content
 *
 * @package AnpsThemePlugin
 * @since 1.0.0
 */

/* Stretch Container - Full Width Parent */
.anps-stretch-container {
  /* Break out of parent container constraints */
  /* This creates edge-to-edge full-width effect */
  width: 100vw;
  max-width: 100vw !important;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  /* Ensure content is above background layers */
  z-index: 1;
}

/* For sections with background overlays */
.anps-stretch-container > .elementor-background-overlay {
  width: 100%;
  left: 0;
  right: 0;
}

/* Boxed Inner Content - For Sections */
.anps-stretch-container .elementor-container {
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
  /* Default max-width (controlled via Elementor responsive controls) */
  max-width: 1140px;
}

/* Responsive breakpoints */
@media (max-width: 1199px) {
  .anps-stretch-container .elementor-container {
    max-width: 970px;
  }
}

@media (max-width: 991px) {
  .anps-stretch-container .elementor-container {
    max-width: 750px;
  }
}

@media (max-width: 767px) {
  .anps-stretch-container .elementor-container {
    max-width: 100%;
  }
}

/* Boxed Inner Content - For Containers (Flexbox Containers) */
.anps-stretch-container > .e-con-inner {
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  width: 100%;
  /* Default max-width (controlled via Elementor responsive controls) */
  max-width: 1140px;
}

/* Responsive breakpoints */
@media (max-width: 1199px) {
  .anps-stretch-container > .e-con-inner {
    max-width: 970px;
  }
}

@media (max-width: 991px) {
  .anps-stretch-container > .e-con-inner {
    max-width: 750px;
  }
}

@media (max-width: 767px) {
  .anps-stretch-container > .e-con-inner {
    max-width: 100%;
  }
}

/* For full-width containers without e-con-inner wrapper */
.anps-stretch-container.e-con-full {
  /* Create an inner wrapper effect */
  display: flex;
  justify-content: center;
}

.anps-stretch-container.e-con-full > .elementor-element {
  width: 100%;
  max-width: 1170px;
}

@media (max-width: 1199px) {
  .anps-stretch-container.e-con-full > .elementor-element {
    max-width: 970px;
  }
}

@media (max-width: 991px) {
  .anps-stretch-container.e-con-full > .elementor-element {
    max-width: 750px;
  }
}

@media (max-width: 767px) {
  .anps-stretch-container.e-con-full > .elementor-element {
    max-width: 100%;
  }
}

/* Ensure nested columns work properly */
.anps-stretch-container .elementor-column-gap-default > .elementor-column > .elementor-element-populated {
  padding: 10px;
}

/* Handle shape dividers properly in full-width context */
.anps-stretch-container .elementor-shape {
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
}

/* RTL Support */
.rtl .anps-stretch-container {
  left: auto;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Editor-specific styles (for Elementor preview) */
.elementor-editor-active .anps-stretch-container {
  /* Slightly different approach in editor to prevent overflow issues */
  overflow-x: visible;
}

/* Ensure proper rendering in editor */
.elementor-editor-active .anps-stretch-container .elementor-container,
.elementor-editor-active .anps-stretch-container > .e-con-inner {
  position: relative;
}

/* Print styles */
@media print {
  .anps-stretch-container {
    width: 100%;
    left: auto;
    right: auto;
    margin-left: 0;
    margin-right: 0;
  }
}
