@font-face {
    font-family: 'cabinregular';
    src: url('/assets/fonts/cabinwdthwght-webfont.woff2') format('woff2'),
         url('/assets/fonts/cabinwdthwght-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'montserrat';
    src: url('/assets/fonts/montserrat-bold-webfont.woff2') format('woff2'),
         url('/assets/fonts/montserrat-bold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'montserrat';
    src: url('/assets/fonts/montserrat-medium-webfont.woff2') format('woff2'),
         url('/assets/fonts/montserrat-medium-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}


/* -> Box-sizing */

html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}


/* -> Variables */

:root {
    /* --> Colors */

    --blue: rgb(50,80,210);
    --blue-dark: rgb(32, 52, 143);
    --blue-darker: rgb(21, 34, 92);
    --white: #f6f6f6;
    --gray: rgb(88, 88, 88);
    --gray-light: rgb(221, 221, 221);
    --gray-dark: rgb(56, 56, 56);
    --black: rgb(36, 36, 36);
    --red: #ff0625;
    --red-dark: #b9051a;
    --red-darker: #7e0311;
    
    /* --> Sizes */

    --max-width: 75rem;
    --grid-gap: 3px;
}


/* -> Initial sizes */

body {
    margin: 0;
}


/* -> Fonts and Background Color*/

html body {
    font-family: 'cabinregular', Helvetica, sans-serif;
}

html body h1,
html body h2 {
    font-family: 'montserrat', Helvetica, sans-serif;
    font-weight: bold;
}

html body h3 {
    font-family: 'montserrat', Helvetica, sans-serif;
}

main {
    background-color: var(--white);
}


/* -> Main Layout */

/* --> Pushes footer to bottom */
body {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
}

/* --> Main section grid (uses flex to simulate a flexible grid) */

main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

main > * {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    border-left: var(--grid-gap) solid var(--gray-light);
    border-right: var(--grid-gap) solid var(--gray-light);
}

main > *:not( :last-child ) {
    border-bottom: var(--grid-gap) solid var(--gray-light);
}

main > *:last-child {
    flex-grow: 1;
}


/* --> Hidden sections or items */

.hidden {
    display: none;
}

/* --> Spacers */

.spacer {
    height: 2.5rem;
}

@media (min-width: 32rem) {
    .spacer {
        height: 5rem;
    }
}

/* --> Catalog iframe Desoutter */

iframe.desoutter-catalog {
    min-height: 97vh;
}


/* -> Text */

/* --> Titles */

main h4,
main h3,
main h2,
main h1 {
    padding: 1rem;
    margin-bottom: 0;
    font-family: 'montserrat';
}

main h2 {
    font-size: 1.65rem;
}

/* --> Product grid titles */

.grid-4 h3 {
    padding: 0;
}

/* --> Paragraphs */

main p {
    margin: 1rem;
}

p.small {
    font-size: 0.75em;
}

p.small a {
    text-decoration: none;
    color: var(--black);
}

p.small a:hover,
p.small a:active,
p.small a:focus {
    text-decoration: underline;
}

.extra-margin {
    margin: 1rem;
}

/* --> Span */

.text-bold {
    font-weight: bold;
}


/* -> Body Grid */


/* --> Grid-2 */

.grid-2 {
    display: grid;
    grid-template-columns: 3fr 5fr;
    grid-auto-rows: max-content;
}

.grid-2.inverted {
    grid-template-columns: 5fr 3fr;
}

@media (max-width: 32rem) {
    .grid-2,
    .grid-2.inverted {
        grid-template-columns: 1fr;
    }
}

/* ---> Text and img align */

h2.inverted {
    text-align: right;
}

.grid-2 > .picture-wrapper {
    width: 100%;
}

@media (max-width: 32rem) {
    .grid-2 > .picture-wrapper {
        max-height: 12rem;
    }
}

main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ----> Image cover anchor */

img.anchor-r {
    object-position: 75% top;
}

img.anchor-l {
    object-position: 25% top;
}

/* --> Grid-4 */

.grid-4 {
    width: 100vw;
    display: grid;
    gap: var(--grid-gap);
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    background-color: var(--gray-light);
}

.grid-4 > a {
    min-width: 10rem;
    background-color: var(--white);
    color: var(--black);
    text-decoration: none;
    text-align: center;
}

/* ---> Grid Items */

.product {
    display: grid;
    grid-template-rows: 8rem 3rem 2rem auto;
}

.product > * {
    margin: 0 auto;
}

.product picture,
.product img {
    object-fit: contain;
    width: 10rem;
    max-height: 10rem;
}

#service img {
    max-width: 7rem;
}

.product > *:first-child {
    margin-top: 1rem;
}
.product > *:last-child {
    margin-bottom: 1rem;
}

/* ----> Logo under product */

.product > div:nth-child(2) img {
    max-height: 3rem;
}

/* ----> Link behavior */

a.product-wrapper {
    transition: all ease-out 200ms;
}

/* ----> Service product span */

#service {
    grid-row: 1 / span 2;
    padding: 5%;
}

a.product-wrapper:hover,
a.product-wrapper:focus,
a.product-wrapper:active {
    background-color: var(--gray-light);
    color: var(--blue);
}

/* --> Grid Clients */

.clients-wrapper {
    width: 100vw;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    grid-auto-rows: 1fr;
    gap: 1rem;
    background-color: var(--gray-light);
}

.clients-item {
    padding: 1rem;
}

@media (pointer: fine) {
    .clients-item {
        filter: grayscale(100%);
        transition: all linear 200ms;
    }
    
    .clients-item:hover,
    .clients-item:focus,
    .clients-item:active {
        filter: grayscale(0);
    }
}

.clients-item > img {
    object-fit: contain;
}


/* -> Buttons */

/* --> Div buttons */

.button-grid {
    background-color: var(--blue);
    color: var(--white);
    text-decoration: none;
    text-align: center;
    padding: 0.75rem;
}

.button-grid:hover,
.button-grid:focus {
    background-color: var(--blue-dark);
    color: var(--white);
}

.button-grid:active {
    background-color: var(--blue-darker);
}

/* ---> Div button in red */

.button-grid.red {
    background-color: var(--red);
}

.button-grid.red:hover,
.button-grid.red:focus {
    background-color: var(--red-dark);
}

.button-grid.red:active {
    background-color: var(--red-darker);
}

/* --> HTML buttons */

.button-inline {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    background-color: var(--blue);
    color: var(--white);
    border: none;
    padding: 0.75rem;
    max-width: 14rem;
    width: 50%;
}

.button-inline:hover,
.button-inline:focus {
    background-color: var(--blue-dark);
    color: var(--white);
}

.button-inline:active {
    background-color: var(--blue-darker);
}

/* ---> Button inline red */

.button-inline.red {
    background-color: var(--red);
}

.button-inline.red:hover,
.button-inline.red:focus {
    background-color: var(--red-dark);
}

.button-inline.red:active {
    background-color: var(--red-darker);
}

/* --> Icons for buttons */

img.icon {
    width: 1rem;
    object-fit: contain;
}


/* -> Form Contact */

form {
    padding: 1rem;
    max-width: calc(100vw - 2 * var(--grid-gap));
}

form ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-inline-size: 35rem;
    display: grid;
    gap: 1rem;
}

form .small {
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

form .wide {
    grid-template-columns: 1fr;
}

form ul + ul {
    margin-block-start: 1rem;
}

/* --> Label and input display */

form label,
form input,
form textarea,
form button {
    display: block;
}

label {
    font-weight: bold;
}

input,
textarea {
    inline-size: 100%;
    background-color: var(--white);
    border: solid var(--grid-gap) var(--gray-light);
    padding: 0.25rem;
    font-family: sans-serif;
    font-size: 1rem;
    color: var(--black);
}

input {
    block-size: 2rem;
}

textarea {
    block-size: 6rem;
    resize: vertical;
}

/* --> Button position */

form > ul:last-child > li:last-child {
    display: flex;
    justify-content: center;
}

/* -> Form Product Search by Product Number */

form > div.product-search {
    margin: 0 auto;
    display: grid;
    grid-template-columns: 6fr 2.5rem;
    grid-template-rows: 2.5rem;
    max-width: 15rem;
}

form > div.product-search > input {
    width: 100%;
    height: 100%;
}

button.single-input {
    margin: 0;
    width: 100%;
    padding: 0;
}
/* -> Header */

header {
    background-color: var(--blue);
    border-top: var(--grid-gap) solid var(--white);
    border-bottom: var(--grid-gap) solid var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* --> Red */

header.red {
    background-color: var(--red);
}

/* --> Layout */

.header-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--grid-gap);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--grid-gap);
    background-color: var(--white);
}

#nav-button {
    display: none;
}

@media (max-width: 43.75rem) {
    nav {
        display: none;
        background-color: var(--white);
    }

    nav.active {
        display: block;
        grid-column: 1 / -1;
    }

    nav.active ul {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    nav.active ul a {
        font-size: 1.5rem;
    }

    nav.active li {
        padding: 0.5rem;
    }

    #nav-button {
        display: block;
        background-color: var(--blue);
    }

    /* nav-button RED */

    header.red #nav-button {
        background-color: var(--red);
    }

    .header-wrapper {
        grid-template-columns: 1fr auto;
    }

    div.header-logo {
        width: 100%;
    }

    /* See button above for nav menu info */
}

/* --> Nav Menu Button */

#nav-button img {
    width: 2rem;
    padding: 2px;
}

#nav-button button {
    border: none;
    background: none;
}

#nav-button:hover {
    background-color: var(--blue-dark);
}

#nav-button:active {
    background-color: var(--blue-darker);
}

/* ---> Nav menu button red */

header.red #nav-button:hover {
    background-color: var(--red-dark);
}

header.red #nav-button:active {
    background-color: var(--red-darker);
}

/* --> Logo */

.header-logo {
    display: inline-block;
    width: 6rem;
}

.header-logo a {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

header img{
    display: block;
    width: 4rem;
    margin: 0 auto;
}

/* --> Navigation */

header ul {
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
}

header a {
    padding: 0.2rem;
    color: var(--white);
    background-color: var(--blue);
    text-decoration: none;
    text-align: center;
    position: relative;
}

header a:hover,
header a:focus {
    background-color: var(--blue-dark);
    color: var(--white);
}

header a:active {
    background-color: var(--blue-darker);
    color: var(--white);
}

/* header a RED */

header.red a {
    background-color: var(--red);
}

header.red a:hover,
header.red a:focus {
    background-color: var(--red-dark);
}

header.red a:active {
    background-color: var(--red-darker);
}

header.red li {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

/* --> Fonts */

header a {
    font-weight: bold;
}

/* -> Footer */

footer {
    background-color: var(--gray-light);
    color: var(--gray);
    padding: 1rem;
}

.footer-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

footer h2,
footer h3 {
    color: var(--black);
}

footer .small a,
footer a {
    color: var(--gray);
    text-decoration: none;
}

footer p {
    margin-left: 0;
    margin-right: 0;
}

footer a:hover:not(.button-inline),
footer a:focus:not(.button-inline),
footer a:active:not(.button-inline) {
    color: var(--gray-dark);
    text-decoration: underline;
}

footer ul {
    list-style: none;
    padding: 0;
}

hr {
    color: var(--gray);
}

footer h3 {
    font-size: 1.3rem
}
