@layer reset, base, layout, components, utilities;

@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    /* Primary colors */

    --blue-100: hsl(225, 100%, 94%);
    --blue-700: hsl(245, 75%, 52%);

    /* Neutral colors */

    --blue-50: hsl(225, 100%, 98%);
    --blue-950: hsl(223, 47%, 23%);
    --gray-600: hsl(224, 23%, 55%);

    /* Sizes */
    --size-8: 0.5rem;
    --size-12: 0.75rem;
    --size-16: 1rem;
    --size-24: 1.5rem;


    /* Font colors */
    --color-text-primary: var(--gray-600);
    --color-text-strong: var(--blue-950);
    --color-text-inverse: var(--blue-50);

    /* Font sizes */
    --font-size-sm: var(--size-12);
    --font-size-base: var(--size-16);
    --font-size-lg: var(--size-24);

    /* Font weights */
    --font-weight-regular: 500;
    --font-weight-bold: 700;
    --font-weight-xbold: 900;
}

@layer reset {
    body {
        line-height: 1.5;
    }

    * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    img {
        display: block;
        max-width: 100%;
    }

    p, h1, h2, h3, h4, h5, h6 {
        overflow-wrap: break-word;
    }

    p {
        text-wrap: pretty;
    }

    h1, h2, h3, h4, h5, h6 {
        text-wrap: balance;
    }

    button {
        font: inherit;
    }

    ul {
        list-style: none;
    }

}


@layer base {
    body {
        font-family: "Red Hat Display", sans-serif;
        text-align: center;
        background-color: var(--blue-100);
        background-image: url("./images/pattern-background-mobile.svg");
        background-repeat: repeat-x;
    }

    @media (min-width: 375px) {
        body {
            background-image: url("./images/pattern-background-desktop.svg");
        }
    }

    a {
        color: inherit;
    }

    a:hover {
        text-decoration: none;
    }

    button {
        cursor: pointer;
    }

}

@layer layout {
    main {
        min-height: 100vh;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

@layer components {
    .card {
        max-width: 18rem;
        width: 100%;
        background-color: var(--blue-50);
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0px 7px 40px 0px #B6BAC4;
    }

    @media (min-width: 768px) {
        .card {
            max-width: 22rem;
        }
    }

    .card__media {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .card__content {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: var(--size-24);
    }

    .card__order-plan {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .card__order-plan .left {
        display: flex;
        align-items: center;
        gap: var(--size-12);
        flex-grow: 3;
    }

    .card__order-plan .right {
        text-align: center;
        flex-grow: 1;
    }

    .card__icon {
        max-width: 3rem;
    }

    .card__btns {
        width: 100%;
    }

    .card__payment-btn {
        background-color: var(--blue-700);
        width: 100%;
        border-radius: 10px;
        border: 0;
        padding: var(--size-12);
        box-shadow: 0px 12px 8px 5px var(--blue-100);
    }

    .card__payment-btn:hover {
        opacity: 0.7;
    }

    .card__cancel-btn {
        background-color: transparent;
        border: 0;
    }

    .card__cancel-btn:hover {
        color: var(--blue-950);
    }

    .card__attribution {
        text-align: center; 
    }
}

@layer utilities {
    .text-primary {
        color: var(--color-text-primary);
    }

    .text-strong {
        color: var(--color-text-strong);
    }

    .text-inverse {
        color: var(--color-text-inverse);
    }

    .text-sm {
        font-size: var(--font-size-sm);
    }

    .text-base {
        font-size: var(--font-size-base);
    }

    .text-bold {
        font-weight: var(--font-weight-bold);
    }

    .text-xbold {
        font-weight: var(--font-weight-xbold);
    }


    .inter-space-nm > * + * {
        margin-top: var(--size-12);
    }

    .space-xl {
        margin-top: var(--size-24);
    }
}