// 1) Définis tes breakpoints une fois pour toutes
$breakpoints: (
    mobile: (max: 599.98px),
    // < 600
    tablet: (min: 600px, max: 1023.98px),
    // 600–1023
    desktop: (min: 1024px, max: 1439.98px),
    // 1024–1439
    wide: (min: 1440px) // >= 1440
);

// 2) Mixin générique : @include respond(tablet, $strict: true) { ... }
@mixin respond($bp, $strict: false, $orientation: null) {
    $def: map-get($breakpoints, $bp);

    @if $def ==null {
        @error "Breakpoint `#{$bp}` introuvable. Définis-le dans $breakpoints.";
    }

    $min: map-get($def, min);
    $max: map-get($def, max);

    // Construit la requête media
    $query: "";

    @if $strict ==true {
        @if $min !=null {
            $query: "(min-width: #{$min})";
        }

        @if $max !=null {
            $query: if($query !="", "#{$query} and (max-width: #{$max})", "(max-width: #{$max})");
        }
    }

    @else {

        // Mode non strict : on se contente du min si dispo (ou du max sinon)
        @if $min !=null {
            $query: "(min-width: #{$min})";
        }

        @else if $max !=null {
            $query: "(max-width: #{$max})";
        }
    }

    // Option : orientation (portrait|landscape)
    @if $orientation !=null and $orientation !="" {
        $query: if($query !="", "#{$query} and (orientation: #{$orientation})", "(orientation: #{$orientation})");
    }

    @media #{$query} {
        @content;
    }
}

// 3) Alias « parlants » qui appellent respond()
//    => tu obtiens exactement la syntaxe que tu veux : tablette_format($strict: true) { ... }

@mixin mobile_format($strict: false, $orientation: null) {
    @include respond(mobile, $strict, $orientation) {
        @content;
    }
}

@mixin tablette_format($strict: false, $orientation: null) {
    @include respond(tablet, $strict, $orientation) {
        @content;
    }
}

@mixin desktop_format($strict: false, $orientation: null) {
    @include respond(desktop, $strict, $orientation) {
        @content;
    }
}

@mixin wide_format($strict: false, $orientation: null) {
    @include respond(wide, $strict, $orientation) {
        @content;
    }
}