/**
 * FitMaster Grid System
 * Standalone flexbox-based layout system replacing Divi's et_pb_* classes
 * 12-column grid with responsive breakpoints
 */

/* ==========================================================================
   Container
   ========================================================================== */

.fm-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

.fm-container-fluid {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* ==========================================================================
   Section (replaces .et_pb_section)
   ========================================================================== */

.fm-section {
    padding: 4% 0;
    position: relative;
    background-size: cover;
    background-position: center;
}

.fm-section--fullwidth {
    padding-left: 0;
    padding-right: 0;
}

.fm-section--specialty {
    padding: 2% 0;
}

/* ==========================================================================
   Row (replaces .et_pb_row)
   ========================================================================== */

.fm-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 1170px;
    gap: 20px;
}

.fm-row--no-gutters {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

.fm-row--no-gutters > [class*="fm-col"] {
    padding-left: 0;
    padding-right: 0;
}

.fm-row--center {
    justify-content: center;
}

.fm-row--end {
    justify-content: flex-end;
}

.fm-row--between {
    justify-content: space-between;
}

.fm-row--around {
    justify-content: space-around;
}

/* ==========================================================================
   Columns (replaces .et_pb_column_*)
   ========================================================================== */

/* Base column styles */
[class*="fm-col"] {
    position: relative;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* 12-column grid classes */
.fm-col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.fm-col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.fm-col-3 { flex: 0 0 25%; max-width: 25%; }
.fm-col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.fm-col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.fm-col-6 { flex: 0 0 50%; max-width: 50%; }
.fm-col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.fm-col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.fm-col-9 { flex: 0 0 75%; max-width: 75%; }
.fm-col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.fm-col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.fm-col-12 { flex: 0 0 100%; max-width: 100%; }

/* Divi-style fraction naming (for compatibility) */
.fm-col-1-2 { flex: 0 0 50%; max-width: 50%; }                /* 1/2 */
.fm-col-1-3 { flex: 0 0 33.333333%; max-width: 33.333333%; }  /* 1/3 */
.fm-col-2-3 { flex: 0 0 66.666667%; max-width: 66.666667%; }  /* 2/3 */
.fm-col-1-4 { flex: 0 0 25%; max-width: 25%; }                /* 1/4 */
.fm-col-3-4 { flex: 0 0 75%; max-width: 75%; }                /* 3/4 */
.fm-col-1-5 { flex: 0 0 20%; max-width: 20%; }                /* 1/5 */
.fm-col-2-5 { flex: 0 0 40%; max-width: 40%; }                /* 2/5 */
.fm-col-3-5 { flex: 0 0 60%; max-width: 60%; }                /* 3/5 */
.fm-col-4-5 { flex: 0 0 80%; max-width: 80%; }                /* 4/5 */
.fm-col-4-4 { flex: 0 0 100%; max-width: 100%; }              /* 4/4 = full */

/* Auto-width column */
.fm-col-auto {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

/* ==========================================================================
   Module Wrappers (replaces .et_pb_module)
   ========================================================================== */

.fm-module {
    margin-bottom: 30px;
}

.fm-text {
    margin-bottom: 30px;
}

.fm-image {
    margin-bottom: 30px;
}

.fm-image img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Button (replaces .et_pb_button)
   ========================================================================== */

.fm-button {
    display: inline-block;
    padding: 0.5em 1.5em;
    font-size: var(--font-size-medium);
    font-weight: 600;
    line-height: 1.7em;
    text-align: center;
    text-decoration: none;
    color: var(--button-text-color, #ffffff);
    background-color: var(--button-bg-color, #0073aa);
    border: 2px solid transparent;
    border-radius: var(--button-radius, 4px);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fm-button:hover {
    background-color: var(--button-hover-bg, #005177);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fm-button--outline {
    background-color: transparent;
    border-color: var(--button-bg-color, #0073aa);
    color: var(--button-bg-color, #0073aa);
}

.fm-button--outline:hover {
    background-color: var(--button-bg-color, #0073aa);
    color: #ffffff;
}

/* ==========================================================================
   Icons (replaces .et-pb-icon)
   ========================================================================== */

.fm-icon {
    display: inline-block;
    font-family: "ETmodules", "FontAwesome", sans-serif;
    font-size: var(--font-size-medium);
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    speak: none;
}

.fm-icon--large {
    font-size: var(--font-size-xl);
}

.fm-icon--xlarge {
    font-size: var(--font-size-xxl);
}

/* ==========================================================================
   Visibility & Display
   ========================================================================== */

.fm-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.fm-mobile-center {
    /* Will be applied via media query */
}

.fm-hide-mobile {
    /* Will be hidden on mobile via media query */
}

.fm-hide-desktop {
    display: none;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet (max-width: 980px) */
@media only screen and (max-width: 980px) {
    .fm-container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    .fm-row {
        margin-right: 0;
    }

    /* Tablet column overrides */
    .fm-col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .fm-col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .fm-col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .fm-col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .fm-col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .fm-col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .fm-col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .fm-col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .fm-col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .fm-col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .fm-col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .fm-col-md-12 { flex: 0 0 100%; max-width: 100%; }

    .fm-hide-tablet {
        display: none !important;
    }
}

/* Mobile (max-width: 768px) */
@media only screen and (max-width: 768px) {
    .fm-section {
        padding: 6% 0;
    }

    /* Stack all columns by default on mobile */
    [class*="fm-col"]:not([class*="fm-col-sm-"]) {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Force all grid containers to single column on mobile */
    .rss-product-grid,
    .bc-product-grid,
    .fm-grid,
    [class*="-grid"] {
        grid-template-columns: 1fr !important;
    }

    /* Mobile column overrides */
    .fm-col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .fm-col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .fm-col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .fm-col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .fm-col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .fm-col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .fm-col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .fm-col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .fm-col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .fm-col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .fm-col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .fm-col-sm-12 { flex: 0 0 100%; max-width: 100%; }

    .fm-mobile-center {
        text-align: center;
    }

    .fm-hide-mobile {
        display: none !important;
    }

    .fm-hide-desktop {
        display: block;
    }

    /* Prevent row math from causing horizontal overflow on mobile */
    .fm-row {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media only screen and (max-width: 900px) {
    .fm-container,
    .fm-container-fluid {
        padding-left: 8px;
        padding-right: 8px;
        box-sizing: border-box;
    }
}

/* Small Mobile (max-width: 480px) */
@media only screen and (max-width: 480px) {
    .fm-container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .fm-section {
        padding: 8% 0;
    }

    .fm-button {
        display: block;
        width: 100%;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Text alignment */
.fm-text-left { text-align: left; }
.fm-text-center { text-align: center; }
.fm-text-right { text-align: right; }

/* Margin utilities */
.fm-mb-0 { margin-bottom: 0; }
.fm-mb-1 { margin-bottom: 10px; }
.fm-mb-2 { margin-bottom: 20px; }
.fm-mb-3 { margin-bottom: 30px; }
.fm-mb-4 { margin-bottom: 40px; }

.fm-mt-0 { margin-top: 0; }
.fm-mt-1 { margin-top: 10px; }
.fm-mt-2 { margin-top: 20px; }
.fm-mt-3 { margin-top: 30px; }
.fm-mt-4 { margin-top: 40px; }

/* Padding utilities */
.fm-p-0 { padding: 0; }
.fm-p-1 { padding: 10px; }
.fm-p-2 { padding: 20px; }
.fm-p-3 { padding: 30px; }
.fm-p-4 { padding: 40px; }
