body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

main {
    flex: 1;
}


header, footer {
    width: 100%;
    background-color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    position: relative;
    box-sizing: border-box;
}

footer {
    background-color: #333;
    color: #fff;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid #555;
    align-items: center;
    border-bottom: none;
    display: flex; /* Make footer a flex container */
    justify-content: center; /* Center content horizontally */
    text-align: center;
}

footer p {
    text-align: center;
    margin: 0;
}

header img {
    height: 50px;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 15px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.gadgets-content {
    width: 80%;
    max-width: 1200px;
    margin: 20px 0;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.gadgets-content h1 {
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
}

.gadget-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
}

.gadget-card {
    width: calc(33% - 20px);
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.gadget-card:hover {
    transform: translateY(-5px);
}

.gadget-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gadget-card h3 {
    font-size: 1.3em;
    margin: 15px;
}

.gadget-card p {
    font-size: 1em;
    margin: 0 15px 15px;
    line-height: 1.4;
    flex-grow: 1;
}

.gadget-card .read-more {
    display: block;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.2s ease-in-out;
}

.gadget-card .read-more:hover {
    background-color: #3e8e41;
}

@media (max-width: 992px) {
    .gadget-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .gadgets-content {
        width: 95%;
        padding: 15px;
    }

    .gadget-card {
        width: 100%;
    }

    .menu-toggle {
        display: block;
        z-index: 1001; 
        position: relative;
    }

    nav {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid #ddd;
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
        display: none;
        z-index: 1000; /* Поднимаем меню выше всех */
    }

    nav ul {
        list-style: none;
        padding: 10px;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    nav ul li {
        text-align: center;
    }

    nav ul li a {
        text-decoration: none;
        color: #333;
        font-weight: bold;
        display: block;
        padding: 10px;
    }

    nav.active {
        display: block;
    }
}
