@import url("./variables.css");

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

body {
    margin: 0 auto;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100dvh;
}

main {
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999;
    width: 34px;
    height: 34px;
    border: 2px solid var(--secondary-clr-light);
    border-bottom: 2px solid var(--sec-clr-blue);
    border-radius: 50%;
    animation: spin 2.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/*    navigation    */

nav {
    border-bottom: 1px solid var(--secondary-color);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.sign-in-btn {
    border: none;
    background-color: var(--light-color);
    padding: 0;
    cursor: pointer;
    justify-self: start;
    margin-left: 1em;
}

.avatar img {
    width: 30px;
    display: block;
    transition: var(--smooth-transition);
}

.avatar img:hover {
    width: 38px;
}

.logo img {
    display: block;
    width: 80px;
}

.logo {
    grid-column: 2;
    justify-self: center;
    padding: 1em;
}

.cart {
    position: relative;
    display: inline-block;
    line-height: 0;
    grid-column: 3;
    justify-self: end;
}

.shopping-bag {
    width: 28px;
    margin-right: 1em;
    transition: var(--smooth-transition);
}

.shopping-bag:hover {
    width: 33px;
}

.badge {
    position: absolute;
    top: 12px;
    right: 32px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--button-buy-bg);
    color: var(--light-color);
    border-radius: 50px;
    font: 700 12px/18px system-ui, sans-serif;
    text-align: center;
}

.badge[hidden] {
    display: none;
}

/*   Modal   */

.modal[hidden] {
    display: none
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(14, 56, 66, 0.7);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-radius: 0.5em;
    width: 90vw;
    height: 300px;
    max-width: 20em;
    padding: 1.5em;
    margin: 0 auto;
}

.sign-in-title {
    color: #ffffff;
    text-shadow: 0px 0px 1px #0A3641;
    margin-bottom: 1em;

}

.btn-close {
    display: block;
    font-size: 1.5rem;
    background-color: transparent;
    border: none;
    color: #ffffff;
    justify-self: right;
}

.btn-close:hover,
.btn-close:active {
    color: #d0d1ce;
}

.login-btn {
    display: inline-flex;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    padding: .4em 1.5em;
    border-radius: 8px;
    border: none;
    color: #ffff;
    background: none;
}

.login-btn:hover {
    color: #c50909;
}

form input {
    border: 1px solid #0A3641;
    margin: .5em 0;
}

label {
    color: #ffffff;
    font-size: .8rem;
}

/*    Hero image    */

.hero-content {
    margin: 0 auto;
    position: relative;
    height: 85vh;
    overflow: hidden;
    width: 100vw;
}

.hero-img {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-img img {
    width: var(--img-width);
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-text {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1em;
}

.hero-main-text {
    margin-top: 8em;
    font-family: "Roboto", sans-serif;
    color: var(--light-color);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    text-align: center;
    font-size: 3.5rem;
    font-weight: 800;
    padding: .2em;  
}

.hero-sub-text {
    color: var(--light-color);
    margin-top: 0.3em;
    margin-bottom: 0.5em;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    letter-spacing: 1px;
    padding: .5em;   
}

.text-bg {
    display: inline;
    background: rgba(0,0,0,.18);
    padding: .25em .5em;
    border-radius: 10px;
    box-decoration-break: clone;
}

@supports ((backdrop-filter: blur(3px)) or (-webkit-backdrop-filter: blur(3px))) {
    .text-bg {
        background: rgba(0, 0, 0, .18);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
    }
}

/*   Gender filter buttons   */

.products-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.toolbar-font {
    font-size: 2rem;
    font-weight: 600;
    margin: 2em;
    color: var(--primary-color);
}

.gender-filter {
    display: flex;
    gap: 1rem;
    margin-right: 4em;
}

.gf-btn {
    padding: .45rem .8rem;
    border: 1px solid var(--secondary-clr-light);
    border-radius: 5px;
    background: var(--light-color);
    cursor: pointer;
    transition: 0.5s;
}

.gf-btn:hover {
    color: var(--light-color);
    background-color: var(--button-buy-bg);
    border: var(--button-buy-bg);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .1);
}

.gf-btn[aria-pressed="true"] {
    color: var(--light-color);
    background-color: var(--button-buy-bg);
    border: 1px solid var(--button-buy-bg);
}

#products-container[data-filter="male"] a:not([data-gender="male"]) {
    display: none;
}

#products-container[data-filter="female"] a:not([data-gender="female"]) {
    display: none;
}



/*    Product cards    */


.products {
    margin: 0 2em;
    display: grid;
    gap: 2em;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.product-card {
    display: block;
    background: var(--light-color);
    border: 1px solid var(--secondary-clr-light);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .1);
    overflow: hidden;
    max-width: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.8s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px rgb(10, 54, 65, 0.5);
}

.pc-img {
    width: var(--img-width);
    aspect-ratio: 4 / 3;
    object-fit: contain;
    display: block;
    padding: 1.5em 0;
}

.pc-title {
    margin: .6rem .75rem 0;
    font-size: 1.2rem;
}

.pc-price {
    margin: 1em .8em 1.5em;
    font-weight: 700;
    font-size: 1.2rem;
}

/*    Product page    */

.product-container {
    margin: 5em 1.5em;
}

.product-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    justify-content: center;
    gap: 1em;
}

.product-img img {
    width: var(--img-width);
}

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 1em;
}

.product-info h2 {
    margin: 1em 0 1em 0;
}

legend {
    padding: .8em 0;
    color: #999b9d;
}

.sizes {
    border: none;
    padding-left: 0;
}

.size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    justify-content: flex-start;
}

.size-grid input[type="radio"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

.size-option {
    width: 50px;
    height: 50px;
    border: 1.5px solid var(--secondary-clr-light);
    border-radius: 3px;
    background: var(--light-color);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .02em;
    cursor: pointer;
    transition: 0.5s;
}

.size-option:hover {
    transform: translateY(-3px);
    background-color: var(--light-color);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    box-shadow: 0 8px 15px rgba(0, 0, 0, .08);
}

.size-grid input[type="radio"]:checked+.size-option {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--light-color);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.description {
    margin-top: 1em;
}

.cta-btn,
.cta-purchased {
    border: none;
    color: var(--light-color);
    font-size: 1.25rem;
    padding: .5em 1.6em;
    border-radius: 8px;
    margin-top: 2em;
    transition: 0.5s;
}

.cta-btn {
    background-color: var(--button-buy-bg);
}

.cta-btn:hover,
.cta-purchased:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.cta-purchased {
    background-color: #679436;
    text-shadow: 0px 0px 1px #4d4c4c;
}

.back-button {
    color: #999b9d;
    transition: var(--smooth-transition);
}

.back-button a {
    color: #999b9d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button:hover {
    font-size: 1.3rem;
}

.arrow {
    color: #b4b5b6;
    margin-right: 1em;
}

/*   Checkout page   */

.cart-empty {
    padding: 2rem 0;
    font-size: 1.1rem;
    color: #6b7280;
    text-align: center;
}

.cart-layout {
    margin: 0 1em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5em;
}

.purchased-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5em;
}

.page-title {
    margin: 2em 0 1em 0;
}

.cart-items {
    padding: .5em 0;
    display: grid;
    grid-template-columns: 1fr auto;
}

.cart-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2em;
    align-items: center;
}

.qbtn {
    height: 40px;
    border: 0;
    background-color: var(--light-color);
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 18px;
}

.qbtn:hover {
    color: var(--primary-color);
}

.qty {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    height: 40px;
}

.qinput {
    height: 40px;
    font-weight: 600;
    width: 2.5rem;
    text-align: center;
    border: 0;
    appearance: textfield;
    -moz-appearance: textfield;
}

.qinput::-webkit-outer-spin-button,
.qinput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.thumb {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
}

.title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1 1 auto;
}

.remove {
    margin-left: 2em;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
}

.remove:hover {
    border: 0.8px solid var(--button-buy-bg);
    border-radius: 3px;
}

.remove img {
    width: var(--img-width);
    height: 100%;
    object-fit: contain;
    display: block;
}

.summary {
    padding-left: 2em;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.summary h3 {
    color: var(--button-buy-bg);
    display: block;
    margin: 1em 0;
}

.row {
    display: flex;
    justify-content: flex-end;
    margin: .3em 0;
}

.row span {
    margin-left: 1em;
}

.summary hr {
    align-self: stretch;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--secondary-color);
    margin-top: 1em;
}

.total {
    padding: 1em 0;
}

.checkout {
    background-color: var(--button-buy-bg);
    border: none;
    letter-spacing: 1px;
    font-weight: 600;
    border-radius: 5px;
    color: var(--light-color);
    padding: .5em 1.8em;
    transition: var(--smooth-transition);
}

.checkout:hover {
    transform: translateY(-3px);
    font-size: 1.2em;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

/*     Confirmation page    */

.check img {
    max-width: 100px;
    margin: 4em 3em;
}

.lead {
    max-width: 400px;
    margin: 2em 0 1em 0;
}

.order-box {
    margin-bottom: 2em;
}

.hp-return {
    font-weight: 600;
    transition-duration: 0.5s;
}

.hp-return:hover {
    color: var(--sec-clr-blue);
    font-size: 1.3rem;
    text-decoration: underline;
}

/*    Profile page    */

.profile-page {
    margin-top: 2em;
    display: grid;
    gap: 1.5em;
    max-width: 1000px;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "hello   profile"
        "security addresses"
        "payments orders";
}

.welcome {
    grid-area: hello;
    align-self: center;
    text-align: left;
    justify-self: start;
}

.welcome h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.card {
    border: 1px solid #e6e7ea;
    border-radius: 10px;
    padding: 1.5em;
    display: grid;
}

.card h2 {
    margin: 0 0 1.2em;
    font-size: 1.2rem;
}

.row {
    display: grid;
    grid-template-columns: 10em 1fr;
    gap: .6em;
    align-items: center;
    white-space: nowrap;
}

label {
    color: #6f747a;
    justify-self: flex-start;
}

input, select {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--secondary-color);
    border-radius: 6px;
}

.actions {
    display: flex;
    gap: .5rem;
    margin-top: 1em;
    justify-content: flex-end;
}

.btn {
    padding: .6rem .9rem;
    border-radius: 8px;
    border: 1px solid #f4e3b0;
    background: var(--light-color);
    cursor: pointer;
    transition: var(--smooth-transition);
}

.btn:hover {
    background-color: #f4e3b0;
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.primary {
    width: auto;
    inline-size: max-content;
    background: #c1ee79;
    border-radius: 8px;
    border: 1px solid #e6e7ea;
    color: black;
    justify-self: flex-end;
    padding: .6rem .9rem;
    transition: var(--smooth-transition);
}

.primary[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.primary:hover {
    background-color: var(--light-color);
    border: 1px solid #89a856;
    color: #5f7836;
}

.list {
    display: grid;
    gap: 1em;
}

.address-details {
    position: relative;
    margin-bottom: 1em;
    display: flex;
    justify-content: space-around;
}

.payment-details {
    margin-top: 2em;
    display: flex;
    gap: 3em;
}

.item {
    position: relative;
    border: 1px solid #e6e7ea;
    border-radius: 6px;
    padding: 1em;
    display: grid;
    justify-items: end;
}

.tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: .5rem;
    padding: .2rem .5rem;
    border: 1px solid #f4a460;
    border-radius: 10px;
    color: #a0522d;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: .7rem;
    border-top: 1px solid skyblue;
    text-align: left;
}

th {
    background: #f7f7f8;
    font-weight: 600;
}

.right {
    text-align: right;
}

.empty {
    border: 1px dashed var(--secondary-color);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

@media (max-width:720px) {

    .row {
        grid-template-columns: 1fr;
    }
}

/*    Footer    */

.wide-footer-bg {
    width: 100%;
}

footer {
    background-color: var(--primary-color);
    margin-top: 6em;
}

.footer-content {
    padding: 2em 0 1em 0;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

.mountains-top img {
    width: var(--img-width);
    height: 50px;
    align-self: flex-start;
    object-fit: contain;
}

footer a {
    color: var(--light-color);
    font-weight: 200;
}

.footer-links {
    display: flex;
    gap: 2em;
    align-self: center;
}

.copyright {
    font-size: .8rem;
    padding-bottom: 1em;
    color: var(--light-color);
}