body {
    text-align: center;
    font-family: 'Happy Monkey', cursive;
    background: linear-gradient(#f2f2f2, #d9c0a3);
    color: #0d0d0d;
}


h1, h2, h3, h4, p {
    text-shadow: 0 0 1px black;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

#header-logo {
    width: 150px;
    max-width: 100%;
    border-radius: 50%;
    border: 2px solid #a67b56;
    opacity: 0.75;
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 1; /* allow shrinkage */
    min-width: 0; /* no overflow */
}


.store-title {
    font-size: 1em;
    margin: 0;
}

#greeting {
    font-size: 2em;
    max-width: 600px;
    width: 100%;
    
}


.username-div {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    align-items: center;
}

#username-label {
    margin-bottom: 5px;
}

#username {
    width: 200px;
    padding: 8px;
    border-radius: 6px;
}

.gift-section {
    margin-top: 50px;
}

.gift-img {
    margin: 20px auto;
    max-width: 560px;
    width: 100%;
    height: 320px;
    border: 1.5px solid #593c22;
    border-radius: 10px;
    background-size: cover;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.8); 
}

.reviews {
    margin: 100px auto 200px auto;
    background-color: #f2f2f2;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    color: black;
    max-width: 900px;
    
}

#review-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
   
}

#review-list {
    margin-top: 20px;
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

#footer {
    font-style: italic;
    width: 400px;
    margin: 40px auto 20px;
}


.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;

}

.modal-content {
    position: absolute;
    background-color: #fff;
    top: 50%;
    left: 50%;
    padding: 20px;
    border: 1px solid #888;
    width: 400px;
    max-width: 500px;
    border-radius: 8px;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    text-align: center;
}

.error-message {
    font-size: small;
    padding-right: 5px;
}

input, textarea, button {
    font-family: inherit
}

button {
    margin: 5px 0;
    padding: 5px;
    width: 45px 100%;
    background-color: #d9c0a3;
    color: black;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.3s ease, transform 0.2s ease;
}

#start-btn {
    width: 70px;
    margin-top: 10px;
    padding: 8px;
}

#q-btn {
    margin: 0 10px;
    padding: 6px;
    width: 35px;
    height: 65x;
    
}

.rvw-btn {
    width: 70px;
    margin-top: 10px;
    padding: 8px;
}

#checkout-btn {
    margin-top: 25px;
    padding: 10px;
    width: 85px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

#pay-btn {
    width: 80px;
    height: 50px;
}

button:hover, button:focus {
    background-color: #a67b56;
}

.close-btn:hover, .close-btn:focus {
    color: red;
    text-decoration: none;
    cursor: pointer;
}

#checkout-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

input, textarea {
    margin: 5px 0;
    padding: 5px;
    width: 175px;
    border-radius: 6px;
    border: 1px solid #a67b56;
}

textarea {
    width: 300px;
    height: 100px;
}

#expiration-error {
    color: red;
}

::placeholder {
    color: #aaaaaa;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: end;
        gap: 10px;
    }

    .header-left,
    .header-right {
        flex-direction: row; /* Keep the left and right headers in a single line */
        justify-content: space-between;
        width: 100%; /* Ensure both headers take up the full width */
        align-items: center;
    }

    #header-logo {
        width: 80px;
        border: .75px solid #a67b56;
    }

    header label {
        font-size: .75em;
        margin-top: -10px;
    }

    .header-right {
        gap: 1px;
    }

    .store-title {
        font-size: .75em; /* Reduce title size */
        margin-top: -125px;
        padding-top: 15px;
    }
    
    .username-div {
        width: 125px;
    }

    #username {
        width: 125px;
        height: 25px;
    }


    #greeting {
        margin-top: 15px; /* space between headers and greeting */
        font-size: 1.25em;
        order: 3; /* header moved below */
    }

    #start-btn {
        width: 60px;
        margin-top: 4px;
        padding: 6px;
    }

    .gifts {
        flex-direction: column;
        align-items: center;
        padding: 0 25px;
    }

    .reviews {
        padding: 25px 0 0;
        margin: 50px;
    }

    .modal {
        width: 90%;
        padding: 30px;  
    }

    ::placeholder {
        font-size: .75em;
    }
}