@import "colors.css";

/*=============== BASE ===============*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
    text-decoration: none;
    font-family: var(--body-font);
}

html {
    scroll-behavior: smooth;
}

body {
    font-size: var(--normal-font-size);
    background: var(--body-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Prevent scroll while the loader is on screen (toggled from JS, fail-safe) */
body.no-scroll {
    overflow: hidden;
}

h1, h2, h3 {
    color: var(--title-color);
    font-weight: var(--font-bold);
}

h1, h2, h3, p {
    line-height: 140%;
}

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

button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: var(--body-font);
}

input {
    font-family: var(--body-font);
}

/* Visible keyboard focus for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--first-color);
    outline-offset: 3px;
}

/*=============== REUSABLE LAYOUT ===============*/
.container {
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 1.5rem;
    width: 100%;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.section {
    padding: 4.5rem 0 2rem;
}

.section__title {
    position: relative;
    font-size: var(--h1-font-size);
    padding-left: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 30ch;
}

.section__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 3px;
    height: 20px;
    background: var(--first-color);
}

/*=============== HEADER & NAV ===============*/
.header {
    width: 100%;
    background: transparent;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
}

.nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo,
.nav__toggle {
    color: #fff;
}

.nav__logo {
    display: flex;
    align-items: center;
    column-gap: .5rem;
    font-weight: var(--font-bold);
}

.nav__logo-img {
    width: .75rem;
}

.nav__toggle {
    display: inline-flex;
    font-size: 1.25rem;
    cursor: pointer;
}

.nav__list {
    display: flex;
    flex-direction: column;
    text-align: center;
    row-gap: 3rem;
    padding-top: 9rem;
}

.nav__link {
    text-transform: uppercase;
    color: var(--text-color-light);
    font-size: var(--h2-font-size);
    transition: color .3s ease;
}

.nav__link:hover {
    color: #fff;
}

.nav__close {
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    color: #fff;
    font-size: 2rem;
}

/* Mobile menu panel */
@media screen and (max-width: 767px) {
    .nav__menu {
        position: fixed;
        background: var(--black-color);
        top: 0;
        right: -100%;
        width: 100%;
        height: 100%;
        transition: right .35s ease;
        z-index: var(--z-fixed);
    }
}

/* Show menu */
.show-menu {
    right: 0;
}

/* Change background header on scroll */
.scroll-header {
    background: var(--body-color);
    box-shadow: var(--shadow-small);
}

.scroll-header .nav__logo,
.scroll-header .nav__toggle {
    color: var(--title-color);
}

.scroll-header .nav__logo-img {
    mix-blend-mode: difference;
}

/* Active link */
.active-link {
    color: #fff;
}

/*=============== HOME ===============*/
.home {
    gap: 0;
}

.home__container {
    padding: 7rem 0 2.5rem;
    background: var(--hero-gradient);
}

.home__content {
    position: relative;
}

.home__title,
.home__data-title {
    color: #fff;
}

.home__title {
    font-size: var(--biggest-font-size);
    margin-bottom: 1.5rem;
    max-width: 18ch;
}

.home__title span {
    color: var(--first-color);
}

.home__description {
    margin-bottom: 2rem;
    color: var(--text-color-light);
    max-width: 45ch;
}

.home__data {
    border-top: 1px solid var(--text-color);
    padding-top: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1.5rem;
}

.home__data-number {
    color: var(--first-color);
    font-size: var(--h1-font-size);
    margin-bottom: 1rem;
}

.home__data-title {
    font-size: var(--h3-font-size);
    margin-bottom: .5rem;
}

.home__data-description {
    color: var(--text-color-light);
}

.home__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    min-height: 320px;
}

.home__scroll {
    position: absolute;
    width: 100px;
    bottom: -7rem;
    left: 0;
    right: 0;
    margin: 0 auto;
    animation: scroll 3s infinite;
}

@keyframes scroll {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-.5rem); }
}

/*=============== BUTTON ===============*/
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--black-color);
    color: #fff;
    padding: 1rem 1.75rem;
    border-radius: .25rem;
    font-size: var(--normal-font-size);
    text-transform: uppercase;
    font-weight: var(--font-semi-bold);
    transition: background .3s ease, transform .3s ease;
}

.button:hover {
    background: var(--black-color-light);
    transform: translateY(-.15rem);
}

/*=============== FEATURES (new) ===============*/
.features__container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1rem;
}

.features__item {
    background: var(--container-color);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-small);
    transition: transform .3s ease, box-shadow .3s ease;
}

.features__item:hover {
    transform: translateY(-.35rem);
    box-shadow: var(--shadow-medium);
}

.features__icon {
    display: inline-flex;
    font-size: 2.25rem;
    color: var(--first-color);
    margin-bottom: 1rem;
}

.features__title {
    font-size: var(--h3-font-size);
    margin-bottom: .5rem;
}

.features__description {
    font-size: var(--small-font-size);
}

/*=============== SPECIALTY ===============*/
.specialty_button {
    margin-left: 1.25rem;
}

.specialty__category {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: 200px;
    justify-content: center;
    row-gap: 2.5rem;
}

.specialty__img {
    width: clamp(60px, 5vw, 90px);
    margin-bottom: 1rem;
    margin-inline: auto;
    transition: transform .4s ease;
}

.specialty__group {
    text-align: center;
    transition: transform .4s ease;
}

.specialty__title {
    font-size: var(--h2-font-size);
    margin-bottom: .25rem;
}

.specialty__group:hover .specialty__img {
    transform: translateY(-.25rem);
}

/*=============== PRODUCTS ===============*/
.products__filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 2rem;
    margin-bottom: 3.5rem;
}

.products_line {
    position: relative;
}

.products_line::before {
    content: '';
    position: absolute;
    width: 1px;
    height: 40px;
    background: var(--text-color-light);
    right: 0;
    top: 0;
    margin: auto 0;
}

.products__item {
    cursor: pointer;
}

.products__title {
    font-size: var(--h3-font-size);
    color: var(--text-color);
    margin-bottom: .5rem;
    transition: color .3s ease;
}

.products__stock {
    font-size: var(--smaller-font-size);
}

.products__content {
    justify-content: center;
    grid-template-columns: 200px;
}

.products__card {
    background: var(--container-color);
    border-radius: var(--radius);
    transition: transform .3s ease, box-shadow .3s ease;
}

.products__card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-.25rem);
}

.products__img {
    transition: transform .5s ease;
    width: clamp(150px, 14vw, 220px);
    margin-inline: auto;
}

.products__shape {
    background: var(--card-color);
    border-radius: var(--radius) var(--radius) 0 0;
    text-align: center;
    padding: .5rem 0;
}

.products_data {
    padding: 1rem 0 1.25rem 1rem;
    position: relative;
}

.products__Price {
    font-size: var(--h2-font-size);
}

.products__name {
    font-size: var(--normal-font-size);
}

.products__button {
    background: var(--black-color);
    color: #fff;
    border-radius: 50%;
    padding: .625rem;
    display: inline-flex;
    font-size: 1.25rem;
    position: absolute;
    top: -1.25rem;
    right: 1rem;
    box-shadow: 0 4px 12px hsla(206, 4%, 4%, .2);
    transition: background .3s ease;
}

.products__button:hover {
    background: var(--first-color);
}

.products__card:hover .products__img {
    transform: translateY(-.25rem);
}

/* Active link product */
.active-product .products__title {
    color: var(--title-color);
}

/*=============== QUALITY ===============*/
.quality {
    background: #fff;
}

.quality__content {
    row-gap: 2.5rem;
}

.quality__images {
    position: relative;
    justify-self: center;
}

.quality__img-big,
.quality__img-small {
    border-radius: var(--radius);
}

.quality__img-big {
    width: clamp(260px, 34vw, 480px);
}

.quality__img-small {
    position: absolute;
    width: clamp(90px, 12vw, 170px);
    top: 0;
    bottom: 0;
    margin: auto 0;
    transform: translateX(-5rem);
}

.quality__title,
.quality__price {
    font-size: var(--h1-font-size);
}

.quality__title {
    margin-bottom: .75rem;
}

.quality__price {
    margin-bottom: .25rem;
}

.quality__special {
    display: block;
    font-size: var(--small-font-size);
    color: var(--first-color);
    font-weight: var(--font-semi-bold);
    margin-bottom: .75rem;
}

.quality__description {
    margin-bottom: 2.5rem;
    max-width: 50ch;
}

.quality__buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem 2rem;
}

.quality__button {
    font-size: var(--normal-font-size);
    text-transform: uppercase;
    color: var(--title-color);
    font-weight: var(--font-semi-bold);
    display: inline-flex;
    align-items: center;
    column-gap: .75rem;
}

.quality__button i {
    font-size: 1.25rem;
    transition: transform .4s ease;
}

.quality__button:hover i {
    transform: translateX(.25rem);
}

/*=============== LOGOS ===============*/
.logo {
    background: #fff;
}

.logo__container {
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    align-items: center;
    gap: 2.5rem 2rem;
    border-top: 1px solid var(--text-color-light);
    padding-top: 2.5rem;
}

.logo__img {
    width: clamp(80px, 7vw, 130px);
    mix-blend-mode: luminosity;
    opacity: .4;
    transition: opacity .4s ease, transform .4s ease;
}

.logo__img:hover {
    opacity: .8;
    transform: scale(1.1);
}

/*=============== BLOG ===============*/
.blog__container {
    padding-bottom: 2rem;
}

.blog__content {
    row-gap: 3rem;
}

.blog__card {
    transition: transform .3s ease;
}

.blog__card:hover {
    transform: translateY(-.35rem);
}

.blog__image {
    position: relative;
    margin-bottom: 1.5rem;
}

.blog__img {
    border-radius: var(--radius);
    width: 100%;
}

.blog__button {
    display: inline-flex;
    background: #fff;
    padding: 1.15rem;
    border-radius: var(--radius) 0 var(--radius) 0;
    color: var(--title-color);
    position: absolute;
    right: 0;
    bottom: 0;
}

.blog__button i {
    transform: rotate(-35deg);
    transition: transform .4s ease;
}

.blog__button:hover i {
    transform: rotate(-35deg) translateX(.25rem);
}

.blog__title {
    font-size: var(--h2-font-size);
    margin-bottom: .75rem;
}

.blog__description {
    margin-bottom: 1.5rem;
}

.blog__footer,
.blog__reaction {
    display: flex;
    align-items: center;
}

.blog__footer {
    column-gap: 1.5rem;
}

.blog__reaction {
    column-gap: .25rem;
}

.blog__reaction i {
    font-size: 1.25rem;
}

.blog__reaction span {
    font-size: var(--small-font-size);
}

/*=============== TESTIMONIALS (new) ===============*/
.testimonial {
    background: #fff;
}

.testimonial__container {
    grid-template-columns: 1fr;
    gap: 1.75rem;
}

.testimonial__card {
    background: var(--body-color);
    border-radius: var(--radius);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-small);
    transition: transform .3s ease, box-shadow .3s ease;
}

.testimonial__card:hover {
    transform: translateY(-.35rem);
    box-shadow: var(--shadow-medium);
}

.testimonial__quote {
    display: inline-flex;
    font-size: 2.5rem;
    color: var(--first-color);
    line-height: 1;
    margin-bottom: .5rem;
}

.testimonial__text {
    margin-bottom: 1.5rem;
    font-size: var(--normal-font-size);
}

.testimonial__rating {
    display: flex;
    column-gap: .15rem;
    color: var(--first-color);
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.testimonial__profile {
    display: flex;
    align-items: center;
    column-gap: 1rem;
}

.testimonial__avatar {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--hero-gradient);
    color: #fff;
    font-weight: var(--font-bold);
    font-size: var(--normal-font-size);
}

.testimonial__name {
    font-size: var(--h3-font-size);
    margin-bottom: .1rem;
}

.testimonial__role {
    font-size: var(--small-font-size);
}

/*=============== FOOTER ===============*/
.footer {
    background: var(--black-color);
    padding: 4rem 0 2.5rem;
}

.footer__title {
    color: #fff;
    font-size: var(--h1-font-size);
    margin-bottom: 2rem;
}

.footer__description {
    margin-bottom: .75rem;
    color: var(--text-color-light);
}

.footer__newsletter {
    display: flex;
    column-gap: .5rem;
    max-width: 400px;
}

.footer__input {
    border: none;
    outline: none;
    flex: 1;
}

.footer__input #email__address {
    width: 100%;
    padding: 1.25rem 1rem;
    border-radius: .25rem;
    color: var(--text-color);
    border: none;
    outline: none;
}

.footer__button {
    padding: .75rem;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    border-radius: .25rem;
    background: var(--first-color);
    transition: background .3s ease;
}

.footer__button:hover {
    background: var(--first-color-alt);
}

.footer__button i {
    transform: rotate(-35deg);
    transition: transform .4s ease;
}

.footer__button:hover i {
    transform: rotate(-35deg) translateX(.25rem);
}

.footer__content {
    row-gap: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--text-color);
}

.footer__subtitle {
    color: #fff;
    font-size: var(--h2-font-size);
    margin-bottom: .75rem;
}

.footer__information {
    color: var(--text-color-light);
}

.footer__flag {
    width: 1rem;
    display: inline-block;
}

.footer__group {
    display: flex;
    flex-direction: column;
    text-align: center;
    margin-top: 1.5rem;
    row-gap: 1.5rem;
}

.footer__social {
    display: flex;
    justify-content: center;
    column-gap: 1.5rem;
    font-size: 1.25rem;
}

.footer__social-link {
    color: #fff;
    transition: color .4s ease, transform .4s ease;
}

.footer__social-link:hover {
    color: var(--first-color);
    transform: translateY(-.15rem);
}

.footer__copy {
    font-size: var(--smaller-font-size);
    color: var(--text-color-light);
}

/*=============== SCROLL BAR ===============*/
::-webkit-scrollbar {
    width: .6rem;
    background: hsl(206, 4%, 80%);
}

::-webkit-scrollbar-thumb {
    background: hsl(206, 4%, 64%);
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(206, 4%, 48%);
}

/*=============== SCROLL UP ===============*/
.scrollup {
    position: fixed;
    right: 1rem;
    bottom: -30%;
    background: #fff;
    box-shadow: 0 4px 12px hsla(206, 4%, 20%, .1);
    color: var(--title-color);
    font-size: 1.25rem;
    padding: .45rem;
    border-radius: .25rem;
    display: inline-flex;
    z-index: var(--z-tooltip);
    opacity: .9;
    transition: bottom .4s ease, transform .4s ease, opacity .4s ease;
}

.scrollup:hover {
    transform: translateY(-.25rem);
    opacity: 1;
}

/* Show scroll up */
.show-scroll {
    bottom: 3rem;
}

/*=============== LOADER ===============*/
.load {
    position: fixed;
    inset: 0;
    background: hsl(0, 0%, 99%);
    display: grid;
    place-items: center;
    z-index: 1000;
    transition: opacity .5s ease, visibility .5s ease;
}

.load.load--hidden {
    opacity: 0;
    visibility: hidden;
}

.load__gif {
    width: clamp(160px, 30vw, 240px);
}

/*=============== SCROLL REVEAL (new, progressive enhancement) ===============*/
.reveal {
    opacity: 0;
    transform: translateY(2rem);
    transition: opacity .7s ease, transform .7s ease;
    will-change: opacity, transform;
}

.reveal.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/*=============== BREAKPOINTS ===============*/

/* Small phones */
@media screen and (max-width: 350px) {
    .container {
        padding-inline: 1rem;
    }

    .home__data {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
    }

    .quality__img-small {
        transform: translateX(-4.5rem);
    }

    .quality__buttons {
        flex-direction: column;
        align-items: flex-start;
        row-gap: 1rem;
    }

    .specialty_button {
        margin-left: 0;
    }
}

/* Medium phones / large phones */
@media screen and (min-width: 480px) {
    .features__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (portrait) */
@media screen and (min-width: 576px) {
    .specialty__category {
        grid-template-columns: repeat(2, 200px);
        column-gap: 3rem;
    }

    .products__content {
        grid-template-columns: repeat(2, 200px);
        padding-bottom: 3rem;
    }

    .blog__content {
        justify-content: center;
        grid-template-columns: 450px;
    }

    .testimonial__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (landscape) / small laptops */
@media screen and (min-width: 767px) {
    .section {
        padding: 7rem 0 2rem;
    }

    .nav {
        height: calc(var(--header-height) + 1.5rem);
    }

    .nav__toggle,
    .nav__close {
        display: none;
    }

    .nav__list {
        padding-top: 0;
        flex-direction: row;
        column-gap: 4rem;
    }

    .nav__link {
        position: relative;
        font-size: var(--normal-font-size);
        text-transform: initial;
    }

    .nav__link::after {
        content: '';
        position: absolute;
        width: 1px;
        height: 12px;
        background: var(--text-color-light);
        transform: translateX(1.25rem);
        bottom: 0;
        top: 0;
        margin: auto 0;
    }

    .scroll-header .nav__link {
        color: var(--text-color);
    }

    .scroll-header .active-link {
        color: var(--title-color);
    }

    .scroll-header .active-link::after {
        background: var(--title-color);
    }

    .home {
        grid-template-columns: repeat(2, 1fr);
        align-items: stretch;
        position: relative;
    }

    .home__content {
        position: initial;
    }

    .home__scroll {
        top: 0;
        bottom: 0;
        margin: auto;
    }

    .products__filters {
        grid-template-columns: repeat(3, 200px);
    }

    .features__container {
        grid-template-columns: repeat(4, 1fr);
    }

    .quality__content,
    .footer__content {
        grid-template-columns: repeat(2, 1fr);
        align-items: center;
    }

    .testimonial__container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large laptops / desktops */
@media screen and (min-width: 1040px) {
    .home__content {
        max-width: 460px;
        margin-left: auto;
        margin-right: 7rem;
        padding-block: 0;
    }

    .section__title {
        padding-right: 8rem;
        padding-left: 1.75rem;
    }

    .section__title::before {
        height: 28px;
        width: 4px;
        top: 12px;
    }

    .specialty__box {
        display: grid;
        grid-template-columns: 2fr .5fr;
        align-items: center;
    }

    .specialty__group {
        text-align: initial;
    }

    .specialty__img {
        margin-inline: 0;
    }

    .specialty__category {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 8rem;
    }

    .specialty__line {
        position: relative;
    }

    .specialty__line::before {
        content: '';
        width: 1px;
        height: 120px;
        background: var(--text-color-light);
        position: absolute;
        top: 0;
        bottom: 0;
        margin: auto;
        right: -4rem;
    }

    .products__filters {
        margin: 4rem 0 5.5rem;
    }

    .products__content {
        grid-template-columns: repeat(3, 1fr);
        justify-content: initial;
        column-gap: 4rem;
        row-gap: 3rem;
    }

    .products__card {
        border-radius: .75rem;
    }

    .products__shape {
        padding: 2rem 0;
        border-radius: .75rem .75rem 0 0;
    }

    .products_data {
        padding: 1rem 0 1.5rem 1.5rem;
    }

    .products__name {
        font-size: var(--h3-font-size);
    }

    .products__button {
        font-size: 1.5rem;
        padding: .75rem;
        right: 1.5rem;
        top: -1.7rem;
    }

    .quality__content {
        column-gap: 6rem;
    }

    .quality__images {
        margin-top: 2rem;
    }

    .quality__img-small {
        transform: translateX(-7rem);
    }

    .quality__title {
        margin-bottom: 1.5rem;
    }

    .quality__special {
        margin-bottom: 1rem;
    }

    .logo__container {
        grid-template-columns: repeat(5, 1fr);
        padding: 3.5rem 0;
    }

    .blog__container {
        padding-bottom: 5rem;
    }

    .blog__content {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 5rem;
        padding-top: 2rem;
    }

    .footer__content {
        grid-template-columns: repeat(4, max-content);
        column-gap: 4rem;
        padding-bottom: 5.5rem;
    }

    .footer__group {
        margin-top: 3rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .footer__title {
        font-size: var(--h2-font-size);
    }

    .footer__social {
        column-gap: 2rem;
    }

    .footer__social-link {
        font-size: 1.5rem;
    }

    .scrollup {
        right: 3rem;
    }
}

/* Extra large desktops */
@media screen and (min-width: 1200px) {
    .home__container {
        padding-top: 10rem;
    }

    .home__data {
        padding-top: 3rem;
    }

    .home__title {
        margin-bottom: 2rem;
    }

    .home__description {
        margin-bottom: 3rem;
    }

    .home__scroll {
        width: 130px;
    }
}

/*
 * QHD / 4K — keep the design centred & generously spaced instead of stretched.
 * The :root token overrides in colors.css already scale type & container width;
 * here we add breathing room and let media fill its columns.
 */
@media screen and (min-width: 2200px) {
    .section {
        padding: 10rem 0 4rem;
    }

    .home__content {
        max-width: 640px;
        margin-right: 12rem;
    }

    .grid {
        gap: 3rem;
    }

    .specialty__category {
        column-gap: 12rem;
    }

    .products__content,
    .blog__content {
        column-gap: 7rem;
    }

    .quality__img-small {
        transform: translateX(-11rem);
    }

    .scrollup {
        font-size: 1.75rem;
        right: 4rem;
    }
}

/*=============== REDUCED MOTION ===============*/
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .home__scroll {
        animation: none;
    }
}
