@import url(base.css);

main {
    background-color: var(--primary-color);
}

picture img, picture source {
    width: 100%;
}

.categoriesProducts {
    display: grid;
    row-gap: 20px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 30px 8px 40px 8px;
}

.categoriesProducts h2 {
    font-size: 25px;
    font-weight: 500;
    color: var(--secondary-color);
    text-transform: uppercase;
    text-align: center;
}

.category {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 15px;
    column-gap: 15px;
    padding-bottom: 20px;
}

.category img {
    width: 180px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(242, 242, 242, 0.2);
}

.category img.active {
    border: 1px solid var(--secondary-color);
    transform: scale(1.1);
}

.hidden {
    display: none;
}

.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 15px;
}

.products {
    margin: 10px;
    text-align: center;
}

.products img {
    width: 170px;
}

.products p {
    text-transform: uppercase;
    margin-top: 5px;
    font-size: 14px;
    color: var(--secondary-color);
}

#products div div {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.3);
    padding: 8px;
}

#products div div p {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.6;
}

::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

dialog button {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    position: absolute;
    top: 18px;
    right: 20px;
    padding: 0.3rem 0.3rem;
    border: none;
    background: none;
    align-self: center;
    cursor: pointer;
}

.modal {
    display: none; 
    position: fixed; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%; 
    max-width: 600px; 
    background-color: white; 
    color: var(--primary-color); 
    border-radius: 8px; 
    padding: 20px; 
    z-index: 1000; 
    opacity: 0; 
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
    font-weight: 600;
    row-gap: 10px;
    border: none;
    line-height: 1.6;
}

.modal[open] {
    display: grid; 
    justify-items: center;
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1.05);
}

.modal h2 {
    text-align: center; 
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary-color);
}

#modal-image {
    width: 300px;
}

#currency-converter {
    width: 320px;
    height: 400px;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(242, 242, 242, 0.2);
    background-color: var(--accent1-color);
    color: var(--secondary-color);
    font-family: "Montserrat", sans-serif;
    align-content: center;
}

#currency-converter h3 {
    text-align: center;
    text-transform: uppercase;
    font-size: 1.2em;
    margin-bottom: 10px;
}

#currency-converter label {
    display: block;
    margin-top: 10px;
}

#currency-converter input,
#currency-converter select,
#currency-converter button {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
}

#currency-converter button {
    background-color: var(--secondary-color);
    color: var(--accent1-color);
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

#result {
    margin-top: 20px;
    font-weight: bold;
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .category {
        grid-template-columns: 1fr 1fr 1fr;
        row-gap: 30px;
        column-gap: 30px;
    }
    
    .category img {
        width: 190px;
    }
    
    .products {
        display: grid;
        width: 80%;
        padding: 20px 0;
        justify-items: center;
    }

    .product img {
        width: 250px;
    }

    .product p {
        font-size: 18px;
    }

    #products div div {
        width: 300px;
        padding: 15px;
    }

    #currency-converter {
        width: 500px;
    }
}

@media screen and (min-width: 1025px) and (max-width: 1920px) {
    .categoriesProducts {
        row-gap: 30px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr auto auto auto;
        align-items: center;
    }

    .categoriesProducts h2 {
        font-size: 30px;
    }

    .categoryTitle {
        grid-column: 1/3;
        grid-row: 1/2;
        text-align: center;
    }

    .category {
        display: flex;
        flex-wrap: wrap;
        grid-column: 1/3;
        grid-row: 2/3;
        justify-content: space-around;
        align-content: center;
        width: 90%;
    }

    .category img {
        width: 250px;
        cursor: pointer;
        transform: scale(1);
        transition: transform 0.6s;
    }

    .category img:hover {
        transform: scale(1.05);
    }

    #product-title {
        grid-column: 1/3;
        grid-row: 3/4;
    }

    #products {
        grid-column: 1/3;
        grid-row: 4/5;
        height: 350px;
        margin-bottom: 30px ;
    }

    #products div {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        column-gap: 50px;
    }

    #products div div {
        padding: 15px;
    }

    #products div div p {
        font-size: 18px;
        line-height: 1.8;
    }

    #products div div img {
        width: 230px;
        cursor: pointer;
        transform: scale(1);
        transition: transform 0.6s;
    }

    #products div div img:hover {
        transform: scale(1.05);
    }

    dialog button {
        font-size: 22px;
        top: 20px;
        right: 25px;
    }

    .modal h2 {
        font-size: 22px;
    }
    
    #modal-image {
        width: 400px;
    }

    #currency-converter {
        grid-column: 1/3;
        grid-row: 5/6;
        width: 800px;
        height: 400px;
        align-items: start;
    }
}
