:root {
    --header-sz: 40px;
    --top-button-h: 35px;
    --header-button-sz: calc(var(--header-sz) - 10px);
    --footer-sz: var(--header-sz);
    --cart-img-sz: 64px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

header {
    position: relative;
    height: calc(var(--header-sz) + var(--top-button-h));
    background: linear-gradient(to bottom, green, yellow);
    border-bottom: 5px solid olive;
    border-radius: 0 0 30px 30px;
    margin: 0 10px;
}

main {
    position: relative;
    height: calc(100vh - var(--header-sz) - var(--footer-sz) - var(--top-button-h));
    width: 100%;
    display: block;
    padding: 10px 25px 5px 25px;
    overflow-y: auto;
}

footer {
    height: var(--footer-sz);
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 5px solid olive;
    margin: 0 10px;
    background: linear-gradient(to top, green, yellow);
    border-radius: 30px 30px 0 0;
}

header>nav {
    width: 100%;
    display: flex;
    align-items: center;
}

.header-buttons>button {
    height: var(--header-button-sz);
    width: var(--header-button-sz);
    cursor: pointer;

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    border-style: none;
    border-bottom: solid 3px transparent;
    padding: 0;
}

.header-buttons>button:hover {
    border-bottom: solid 3px green;
}

#modern_dialog {
    position: absolute;
    top: 15vh;
    width: 90vw;
    height: 75vh;
    z-index: 998;
    border-style: none;
    border-radius: 30px;
    background: linear-gradient(to top, green, yellow);
}

#modern_content {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 20px 10px;
}

#koshyk {
    position: relative;
    background-image: url(img/korz.png);
}

.cart.empty {
    display: none;
}

.cart.full {
    display: block;
    position: absolute;
    right: -10px;
    top: -20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: green;
    color: white;
    font-size: medium;
}

dialog#koshyk_dialog {
    position: absolute;
    background-color: wheat;
    top: calc(var(--header-sz) + var(--top-button-h) + 5px);
    right: 10px;
    left: auto;

    min-width: 200px;
    width: fit-content;

    max-height: 50vh;

    z-index: 999;
    border: none;
    border-radius: 20px;
}

dialog#koshyk_dialog[open] {
    display: flex;
    flex-direction: column;
}

dialog#koshyk_dialog>nav {
    display: flex;
    align-items: center;
}

#koshyk_content {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.cart_table {
    border-spacing: 0 5px;
    width: 100%;
    height: 100%;
}

.cart_table img {
    width: var(--cart-img-sz);
    height: var(--cart-img-sz);
}

.cart_table td {
    padding: 0 7px;
    border-bottom: solid 2px black;
    margin-bottom: 5px;
    vertical-align: middle;
}

td.int_count {
    text-align: center;
}

td.float_cost {
    text-align: right;
}

td.float_cost::after,
#cart_sum::after,
.service_cart_price::after {
    content: " грн.";
}

.cart_table button {
    border-style: none;
    background: none;
    color: white;
    font-weight: bold;
    font-size: larger;
    cursor: pointer;
    margin: 0;
}

.koshyk_dialog_top {
    justify-content: space-between;
    font-size: larger;
    font-weight: bold;
    border-bottom: solid 2px black;
}

.koshyk_dialog_top button {
    border-style: none;
    font-size: inherit;
    background: none;
    color: red;
    cursor: pointer;
}

.koshyk_dialog_bottom a {
    border-style: none;
    font-size: x-large;
    text-align: center;
    background: linear-gradient(to top, yellow, green);
    color: white;
    width: 100%;
    cursor: pointer;
    border-radius: 20px;
    text-decoration: none;
    padding: 5px 0;
}

.header-buttons {
    justify-content: flex-end;
    background: transparent url(img/logo_4.png) left center / contain no-repeat;
    height: var(--header-sz);
    padding-right: 25px;
}

.top-menu-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;

    height: var(--top-button-h);
    width: 100%;
    padding-bottom: 5px;
}

.top-menu-buttons a {
    display: inline-block;
    text-decoration: none;
    font-weight: bold;
    font-style: italic;
    padding: 5px;
    color: olive;
}

.top-menu-buttons a:hover {
    border-top: solid 2px olive;
}

.linq-animation {
    position: relative;
    display: inline-block;
    color: olive;
    overflow: hidden;
    padding: 5px 35px !important;

    animation: textBreath 2.5s ease-in-out infinite;
}

/* сам відблиск */
.linq-animation::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -60%;
    width: 40%;
    height: 140%;

    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255,255,255,0.45) 50%,
        transparent 100%
    );

    transform: skewX(-20deg);
    animation: shineMove 2.3s ease-in-out infinite;
}

/* рух відблиску */
@keyframes shineMove {
    0% {
        left: -60%;
    }
    60% {
        left: 120%;
    }
    100% {
        left: 120%;
    }
}

/* легка “живість” тексту */
@keyframes textBreath {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.03);
        filter: brightness(1.15);
    }
}

@media screen and (max-width: 768px) {

    main {
        padding: 10px 20px;
    }

    dialog#koshyk_dialog {
        width: calc(100% - 20px);
        left: 10px;
        max-height: 100hv;
        height: calc(100hv - var(--header-sz) - var(--header-button-sz) - var(--footer-sz) - 30px);
        top: calc(var(--header-sz) + var(--header-button-sz) + 15px);
        right: 0;
        margin: 0;
    }
}