:root {
    --header-height: 53.14px;
}

.hidden {
    display: none !important;
}

.container {
    padding-inline: 0.5rem;
    margin-inline: auto;
}

/* HEADER */

header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 0.5rem;
    color: #ffffff;
    background-color: #dc2626;
}

#header-content {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;

    position: relative;
}

#header-content-main {
    display: flex;
    flex: 1 1 0%;
    gap: 0.75rem;
}

.logo {
    padding: 0.25rem;
    border-radius: 0.5rem;
    border-width: 1px;
    border-color: #ffffff;
    font-size: 1.25rem;
    line-height: 1.75rem;
}

#logo-sm {
    display: block;
}

#logo-md {
    display: none;
}

#search-bar {
    display: flex;
    padding: 0.25rem 0.5rem;
    gap: 0.5rem;
    align-items: center;
    border-radius: 0.5rem;
    width: auto;
    color: #6b7280;
    background-color: #ffffff;
}

#search {
    width: 100%;
    background-color: transparent;
}

#search:focus-within {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

#cart {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: #ef4444;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#profile {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

#profile > div {
    display: none;
}

#profile-menu {
    position: absolute;
    top: calc(var(--header-height) - 0.5rem);
    right: 0;

    border: 1px solid gray;
    border-radius: 0.25rem;

    font-size: 0.875rem;
    line-height: 1.25rem;

    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);

    color: #000;
    background-color: #ffffff;
    width: 150px;
}

#profile-menu > a {
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#profile-menu > a:hover {
    background-color: #ccd4e6;
}

/* MAIN */

main {
    padding: 1rem 0;
}

/* LOADING */

#loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100svh - calc(var(--header-height) + 2rem));
}

#loading-icon {
    margin-top: -3.5rem;
    border-radius: 100%;
    border-top-width: 0.3rem;
    width: 2em;
    height: 2em;

    animation: spin 0.5s ease-in infinite 0.3s;
}

/* FLOATING ZALO & EMAIL */

#floating-zalo,
#floating-email {
    aspect-ratio: 1 / 1;
    position: fixed;
    right: 0.5rem;
    z-index: 20;
    height: 2.5rem;
}

#floating-zalo {
    bottom: 1rem;
}

#floating-email {
    bottom: 4rem;
}

#floating-zalo::before,
#floating-email::before {
    content: "";
    position: absolute;
    border-radius: 100%;
    width: 100%;
    height: 100%;
    opacity: 0.75;

    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

#floating-zalo::before {
    background-color: rgb(56 189 248);
}

#floating-email::before {
    background-color: rgb(246, 59, 59);
}

#zalo-icon,
#email-icon {
    aspect-ratio: 1 / 1;
    position: relative;
    height: 2.5rem;
}

/* FOOTER */

footer {
    background-color: rgb(241, 245, 249);
    padding: 1rem 0.5rem;
    font-size: 0.625rem;
}

#footer-content {
    margin-inline: auto;
}

#footer-content > div:first-child {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

#footer-content > div:first-child > div {
    margin-top: 1rem;
}

#footer-content > div:first-child > div:first-child {
    margin-top: 0;
}

#footer-content > hr {
    border-top-width: 2px;
    border-color: rgb(148, 163, 184);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

#footer-content > div:nth-child(3) > img {
    aspect-ratio: 1 / 1;
    width: 3rem;
}
#footer-content > div:nth-child(3) > div {
    margin-top: 1rem;
}

#footer-content > div:first-child > div > h3 {
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
}

#footer-content > div:first-child > div > div {
    margin-top: 0.5rem;
}

#footer-content > div:first-child > div:nth-child(2) > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
#footer-content > div:first-child > div:nth-child(4) > div {
    display: flex;
    margin-left: 0.5rem;
    gap: 0.5rem;
    flex-direction: column;
}

#footer-content > div:first-child > div > div > ul {
    margin-left: 0.5rem;
}
#footer-content > div:first-child > div > div > img {
    border-width: 1px;
    border-radius: 0.375rem;
}
#footer-content > div:first-child > div > div > a {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    align-items: center;
}

/* RESPONSIVE */

@media (min-width: 425px) {
    #profile > div {
        display: block;
    }

    footer {
        font-size: 0.75rem;
        line-height: 1rem;
    }
}

@media (min-width: 768px) {
    #logo-sm {
        display: none;
    }

    #logo-md {
        display: block;
    }

    #logo-md > div {
        display: inline-block;
    }

    #search-bar {
        margin-left: 1.25rem;
    }

    footer {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    #footer-content > div:first-child {
        flex-direction: row;
    }

    #footer-content > div:first-child > div {
        width: 50%;
    }

    #footer-content > div:first-child > div:nth-child(2) {
        margin-top: 0;
    }

    #footer-content > div:first-child > div:nth-child(3),
    #footer-content > div:first-child > div:nth-child(4) {
        margin-top: 0.5rem;
    }

    #footer-content > div:first-child > div > h3 {
        font-size: 1rem;
        line-height: 1.5rem;
    }
}

@media (min-width: 1024px) {
    #footer-content > div:first-child {
        flex-wrap: nowrap;
    }

    #footer-content > div:first-child > div {
        width: auto;
    }

    #footer-content > div:first-child > div:nth-child(3),
    #footer-content > div:first-child > div:nth-child(4) {
        margin-top: 0;
    }
}

@media (min-width: 1280px) {
    .container {
        width: 1200px;
    }

    #floating-zalo,
    #floating-email {
        height: 3rem;
        right: calc(50% - 600px + 8px);
    }

    #floating-zalo {
        bottom: 1.5rem;
    }

    #floating-email {
        bottom: 5.25rem;
    }

    #zalo-icon,
    #email-icon {
        height: 3rem;
    }

    #footer-content {
        width: 1200px;
    }
}

/* KEYFRAMES */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ping {
    75%,
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}
