@import url('https://fonts.googleapis.com/css2?family=Fira+Sans+Condensed:wght@500;600&family=Raleway:wght@300;500;600&display=swap');

/* || RESET */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

input,
button,
textarea {
    font: inherit;
}

/* || VARIABLES */

:root {
    /* FONTS */
    --FF: "Raleway", Arial, sans-serif;
    --FF-HEADINGS: "Fira Sans Condensed", sans-serif;

    /* COLORS */
    --BODY-BGCOLOR: #1F140D;
    --BODY-BGCOLOR-FADE: #473933;
    --BODY-BGIMAGE: linear-gradient(to bottom, var(--BODY-BGCOLOR), var(--BODY-BGCOLOR-FADE));

    --BUTTON-COLOR: #F9F6ED;
    --BUTTON-BGCOLOR: #F9F6ED;
    --BUTTON-HOVER: hsl(23, 35%, 45%);
    --BUTTON-ACTIVE: hsl(23, 35%, 35%);

    --CARD-COLOR: #101010;

    --FONT-COLOR: #F9F6ED;

    --HEADER-BGCOLOR: #1F140D;
    --HEADER-BGCOLOR-FADE-SM: #291D16;
    --HEADER-BGCOLOR-FADE-L: #32241C;
    --HEADER-BGIMAGE-SM: linear-gradient(to bottom, var(--HEADER-BGCOLOR), var(--HEADER-BGCOLOR-FADE-SM));
    --HEADER-BGIMAGE-L: linear-gradient(to bottom, var(--HEADER-BGCOLOR), var(--HEADER-BGCOLOR-FADE-L));

    --LINK-COLOR: #F9F6ED;
    --LINK-HOVER-SM: hsl(23, 35%, 30%);
    --LINK-HOVER-L: hsl(23, 35%, 75%);
    --LINK-ACTIVE: hsl(23, 35%, 35%);

    --NAV-BGCOLOR: #F9F6ED;
    --NAV-COLOR: #101010;
    --NAV-CLOSE-BUTTON-COLOR: #101010;
    --NAV-CLOSE-BUTTON-HOVER: hsl(23, 35%, 25%);

    /* BORDERS */
    --BORDER-RADIUS: 4px;

    /* TRANSITIONS */
    --TRANSITION-BASE: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    --TRANSITION-COLOR: color 0.3s ease-in-out, transform 0.3s ease-in-out;
    --TRANSITION-SHADOW: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    --TRANSITION-BG: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* || UTILITY CLASSES */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--BORDER-RADIUS);
    font-size: 1rem;
    font-weight: 500;
    background: var(--BUTTON-BGCOLOR);
    transition: var(--TRANSITION-SHADOW), var(--TRANSITION-BG);
    cursor: pointer;
}

.btn:hover,
.btn:focus-visible {
    color: var(--BUTTON-COLOR);
    background: var(--BUTTON-HOVER);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
}

.btn:active {
    background-color: var(--BUTTON-ACTIVE);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* || GENERAL STYLES */
html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--FF);
    line-height: 1.5;
    color: var(--FONT-COLOR);
    background: var(--BODY-BGIMAGE);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
}

a:any-link {
    color: var(--LINK-COLOR);
    text-decoration: none;
}

img {
    border-radius: var(--BORDER-RADIUS);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid hsl(23, 35%, 52%);
    outline-offset: 4px;
    border-radius: var(--BORDER-RADIUS);
}

/* || HEADER */
.header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    padding: 0.625rem 1.25rem;
    background: var(--HEADER-BGIMAGE-SM);
}

.logo-container {
    display: flex;
    align-items: center;
}

.header__img {
    max-width: 45px;
    width: 45px;
    height: auto;
    margin-right: 10px;
}

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

.header__h1 {
    font-family: var(--FF-HEADINGS);
    font-size: 1.5rem;
    font-weight: 500;
}

.header__ul {
    position: fixed;
    top: 0;
    right: -100%;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 80%;
    height: 100vh;
    padding: 4.5rem 2.5rem 0;
    list-style: none;
    background-color: var(--NAV-BGCOLOR);
    transition: right 0.15s ease-in-out;
}

.show-mobile-menu::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

.show-mobile-menu .header__ul {
    right: 0;
}

.show-mobile-menu .header__ul {
    will-change: right;
    transition: right 0.3s ease-in-out;
}

.header__nav a {
    display: block;
    font-weight: 600;
    color: var(--NAV-COLOR);
    text-decoration: none;
    transition: var(--TRANSITION-COLOR);
}

.header__nav a:hover,
.header__nav a:focus-visible {
    color: var(--LINK-HOVER-SM);
}

.header__nav a:active {
    color: var(--LINK-ACTIVE);
    transform: scale(0.97);
}

#menu-btn,
#close-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-family: "Material Symbols Outlined";
    font-size: 2rem;
    line-height: 1;
    color: inherit;
    border-radius: 0;
    cursor: pointer;
    transition: var(--TRANSITION-COLOR);
}

#menu-btn {
    color: var(--BUTTON-COLOR);
}

#close-menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1002;
    display: none;
    visibility: hidden;
    color: var(--NAV-CLOSE-BUTTON-COLOR);
}

.show-mobile-menu #close-menu-btn {
    display: block;
    visibility: visible;
}

#menu-btn:hover {
    color: var(--BUTTON-HOVER);
}

#close-menu-btn:hover {
    color: var(--NAV-CLOSE-BUTTON-HOVER);
}

#menu-btn:focus-visible,
#close-menu-btn:focus-visible {
    padding: 0.25rem;
    outline-offset: 6px;
}

#close-menu-btn:focus-visible {
    border-radius: 50%;
}

#menu-btn:active,
#close-menu-btn:active {
    transform: scale(0.9);
}

/* || MAIN */
.main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 0 2.5rem;
    opacity: 1;
    margin: 3.75rem auto 2rem;
}

.main__article {
    width: 100%;
    height: auto;
    text-align: center;
    color: #F9F6ED;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease-out forwards;
}

.main__article:nth-child(1) {
    animation-delay: 0.1s;
}

.main__article:nth-child(2) {
    animation-delay: 0.3s;
}

.main__article:nth-child(3) {
    animation-delay: 0.5s;
}

.main__article:nth-child(4) {
    animation-delay: 0.7s;
}

.main__article h2,
.main__article p {
    max-width: 100%;
}

.article__div {
    min-height: 300px;
}

.article__img {
    width: 260px;
    height: auto;
    margin: 2rem auto 0;
    border-radius: var(--BORDER-RADIUS);
}

.article__h2 {
    margin: 1rem 0;
    font-size: 2rem;
    line-height: 1.5;
}

.article__p {
    margin-bottom: 1rem;
    font-weight: 300;
    text-align: justify;
}

.article__button {
    margin-top: 1rem;
}

/* || MENU */
.menu {
    display: flex;
    flex-direction: column;
}

.menu__div {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.container__div {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    max-width: 240px;
    width: 100%;
    margin: 1rem;
    border-radius: var(--BORDER-RADIUS);
    background-color: #F9F6ED;
    transition: var(--TRANSITION-SHADOW);
}

.container__div:hover,
.container__div:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.card__div {
    display: flex;
    flex-direction: column;
    color: var(--CARD-COLOR);
}

.product {
    display: flex;
    justify-content: center;
    border-radius: 4px 4px 0 0;
    background-color: hsl(23, 35%, 50%);
}

.product__img {
    aspect-ratio: 1 / 1;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
    border-radius: 4px 4px 0 0;
}

.item {
    display: grid;
    grid-template-rows: 40px 1fr 100px;
    height: 100%;
    padding: 1rem;
}

.item__h3 {
    align-self: center;
    font-family: var(--FF-HEADINGS);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.item__p {
    align-self: start;
    max-height: 6rem;
    font-size: 0.9rem;
    text-align: justify;
}

.item__p.price {
    align-self: center;
    margin-top: 4rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: hsl(23, 35%, 20%);
}

/* || ABOUT */
.main__img {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

/* || CONTACT */
.contact-info,
.contact {
    align-self: stretch;
    width: 100%;
}

.location {
    margin-bottom: 1rem;
}

.location__h2,
.contact__h2 {
    margin: 1rem;
}

.contact__fieldset {
    border: none;
}

.contact__p {
    margin: 1em 0;
}

.contact__label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-align: left;
}

.contact__input,
.contact__textarea {
    width: 100%;
    padding: 0.5em;
    border-width: 2px;
    border-radius: var(--BORDER-RADIUS);
}

.button-container {
    display: flex;
    gap: 1rem;
}

.contact__button {
    width: 100%;
    letter-spacing: 0.05em;
}

.contact__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* BACK TO TOP BUTTON */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border: none;
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #fff;
    background: #333;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
    cursor: pointer;
}

#backToTop svg {
    display: block;
    width: 24px;
    height: 24px;
    margin: 0 auto;
    fill: currentColor;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:focus-visible {
    border-radius: 50%;
    background-color: rgba(249, 246, 237, 0.2);
    outline-offset: 4px;
}

#backToTop:hover {
    background: #555;
}

/* || ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* || REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    /* Specific overrides */
    #backToTop {
        transition: none;
    }

    .main__article {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* || MEDIA QUERIES */

/* LARGER SCREENS */
@media screen and (min-width: 768px) {
    body {
        padding: 0 4rem;
    }

    .header {
        padding: 1rem 6rem;
        background: var(--HEADER-BGIMAGE-L);
    }

    .header__nav {
        max-width: 1400px;
        margin: 0 auto;
    }

    .header__ul {
        position: static;
        left: auto;
        flex-direction: row;
        width: auto;
        height: auto;
        padding: 0;
        background: none;
    }

    #menu-btn,
    #close-menu-btn {
        display: none;
    }

    .header__nav a {
        color: var(--LINK-COLOR);
    }

    .header__nav a:hover,
    .header__nav a:focus-visible {
        color: var(--LINK-HOVER-L);
        transform: scale(1.1);
    }

    .header__nav a:active {
        transform: scale(0.97);
    }

    .main {
        align-items: stretch;
        min-height: auto;
    }

    .home .main__article {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "txt img";
        align-items: center;
        gap: 2rem;
        max-width: 1024px;
    }

    .article__p {
        text-align: left;
    }

    .home .article__h2,
    .home .article__p,
    .home .article__button {
        grid-area: txt;
        justify-self: start;
    }

    .home .article__figure {
        grid-area: img;
        justify-self: end;
    }

    .article__img {
        max-width: 375px;
        width: 100%;
    }

    .article__button {
        padding: 0.75rem 2rem;
    }

    .about {
        display: flex;
        flex-direction: column;
    }

    .contact-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .location {
        display: flex;
        flex-direction: column;
    }

    .contact {
        display: flex;
        flex-direction: column;
        max-width: 668px;
        width: 100%;
        margin: 1rem auto auto;
    }

    .location__h2 {
        margin: 1rem;
    }
}

/* EXTRA LARGE SCREENS */
@media screen and (min-width: 1024px) {
    .home .main__article {
        gap: 0;
    }

    .main__article .article__p {
        max-width: 816px;
        margin-left: auto;
        margin-right: auto;
    }

    .menu__div {
        gap: 1rem;
    }

    .container__div {
        margin: 0 1rem;
    }
}