/**
 * ENR-OCCITANIE - Clean CSS Fixes
 * Only specific fixes, no aggressive global styles
 */

/* ========================================
   SOLAR SOLUTION CARDS ALIGNMENT FIX
   ======================================== */

/* Target the specific grid row containing the 3 solar solution cards */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 20px !important;
    grid-auto-flow: column !important;
}

/* Force all columns to align at top and same row with equal width */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b > .grid-column-root {
    align-self: start !important;
    grid-column: auto !important;
    position: relative !important;
    top: 0 !important;
    max-width: none !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
}

/* Override any responsive column sizing */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b > .grid-column-large-4,
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b > .grid-column-medium-6,
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b > .grid-column-small-12 {
    max-width: none !important;
    width: 100% !important;
    flex-basis: 0 !important;
}

/* Remove only TOP padding/margins from nested content */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b .grid-row-root {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Align all content modules at top - remove only top spacing */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b .module-container-root,
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b .heading-root,
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b .text-root {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Keep image container spacing but align at top */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b .image-container {
    margin-top: 0 !important;
}

/* Force first child of each column to have no top margin/padding */
.grid-row-a69f3dc8-0b6f-4535-8315-1c0023ecd79b > .grid-column-root > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ========================================
   PRICING TABLE SPACING FIX
   ======================================== */

/* Remove excessive spacing after pricing tables */
table {
    margin-bottom: 0 !important;
}

/* Target specific pricing containers on espace-particulier.html */
.pricing-section {
    margin-bottom: 0 !important;
}

.pricing-tables-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide empty image wrappers after pricing table that create unwanted spacing */
.pricing-section ~ .module-container-root .image-wrapper:empty,
.pricing-section ~ .module-container-root .image-wrapper:not(:has(*)) {
    display: none !important;
    padding-bottom: 0 !important;
    height: 0 !important;
}

/* Also target the module containers with empty images */
.pricing-section ~ .module-container-root:has(.image-wrapper:empty) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reduce spacing in sections containing tables */
.section-root:has(table) {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Reduce spacing after table containers */
.module-container-root:has(table) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Target table wrapper divs */
div:has(> table) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove spacing from grid rows containing tables */
.grid-row-root:has(table) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove spacing from grid columns containing tables */
.grid-column-root:has(table) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
