@font-face {
    font-family: 'Stolzl-Book';
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    src: url(../fonts/Stolzl-Book.otf) format('opentype');
}
@font-face {
    font-family: 'Stolzl-Bold';
    font-weight: bold;
    font-style: normal;
    font-display: swap;
    src: url(../fonts/Stolzl-Bold.otf) format('opentype');
}
@font-face {
    font-family: 'Romul';
    font-style:normal;
    src: url(../fonts/Romul.ttf) format("truetype");
}

@font-face {
	font-family: 'VAG World Bold';
	src: url('../fonts/vag_world_bold.eot'); /* IE 9 Compatibility Mode */
	src: url('../fonts/vag_world_bold.eot?#iefix') format('embedded-opentype'), /* IE < 9 */
		url('../fonts/vag_world_bold.woff2') format('woff2'), /* Super Modern Browsers */
		url('../fonts/vag_world_bold.woff') format('woff'), /* Firefox >= 3.6, any other modern browser */
		url('../fonts/vag_world_bold.ttf') format('truetype'), /* Safari, Android, iOS */
		url('../fonts/vag_world_bold.svg#vag_world_bold') format('svg'); /* Chrome < 4, Legacy iOS */
}

html {
    --c-black: #1a1a1a;
    --c-black-40: rgba(26,26,26,.4);
    --c-gray-1: #828282;
    --c-gray-2: #b6b6b6;
    --c-gray-3: #e5e5e5;
    --c-gray-4: #efefef;
    --c-gray-5: #f5f5f5;
    --c-gray-6: #f2f2f2;
    --c-gray-8: #f7f7f7;
    --c-white: #fff;
    --c-white-15: hsla(0,0%,100%,.15);
    --c-white-60: hsla(0,0%,100%,.6);
    --c-white-70: hsla(0,0%,100%,.7);
    --c-white-80: hsla(0,0%,100%,.8);
    --c-elements-gray-dark: #888f97;
    --c-red: #fd1517;
    --c-red-10: #ffe8e8;
    --c-red-50: #fe8a8b;
    --c-red-dark: #d11819;
    --c-green: #70bf46;
    --c-green-10: #f0f7ec;
    --c-green-dekor: #7ec558;
    --c-red-decor: #dc1719;
    --s-overlay: 0px 22px 32px -16px rgba(0,0,0,.059);
    --s-button: 0px 0px 40px 0px rgba(0,0,0,.071);
    --s-dropdown: 0px 6px 40px 0px rgba(0,0,0,.122);

    --arrow-width: 20%;

    * {
        font-family: 'Stolzl-Book';
        user-select: none;
    }
}
/* Применение шрифта ко всему документу */
body {
    font-family: 'Stolzl-Book';
    color: var(--c-black);
    margin: 0;
    padding: 0;
    cursor: default;
    overflow: hidden;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
}

h1, h2, h3, h4, h5, h6 {
    align-content: center;
    text-align: center;
}

header {
    background-color: var(--c-red);
    margin: 0;
    height: 60px;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;

    h1 {
        margin: 0.25em 0;
        color: var(--c-gray-4);
        font-size: 40px;
    }

    svg {
        height: 75%;

        path:first-child {
            fill: var(--c-gray-3);
        }
    }

    div:last-child {
        width: 131.25px;
        height: 100%;
        align-content: center;
    }

    button {
        border: none;
        background-color: var(--c-gray-3);
        border-radius: 10px;
        height: calc(100% - 10px);
        box-shadow: 0px 0px 10px 2px var(--c-red-dark);
    }
}

main:has(.wines.grid) {
    grid-template-columns: 0 1fr 0;

    .swipy-arrow {
        display: none;
    }
}

main {
    padding: 5px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    grid-template-columns: var(--arrow-width) 1fr var(--arrow-width);
    align-items: normal;

    * {
        scrollbar-width: none;
    }

    .swipy-arrow {
        font-family: "VAG World Bold", "Comic Sans", cursive;
        align-content: center;
        text-align: center;
        height: 100%;
        color: var(--c-gray-2);
        background: transparent;
        border: none;
        font-size: 100px;
        grid-row: 2/3;
        z-index: 2;
    }

    .swipy-arrow.left {
        grid-column: 1/2;
        text-align: left;
    }

    .swipy-arrow.right {
        grid-column: 3/4;
        text-align: right;
    }

    section {
        overflow: hidden;
    }

    #mainFiltersTags {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1em;
        grid-column: 1/4;
    }
}

.view-btn {
    z-index: 3;
    height: 100px;
    width: 100px;
    border-radius: 50%;
    border: none;
    position: relative;
    left: calc(100% - 80px);
    font-size: 18px;
    top: 10px;
    background-color: var(--c-red-50);
    box-shadow: 0px 0px 10px 2px var(--c-red-50);
    grid-row: 2/3;
    grid-column: 2/3;

    &:hover {
        box-shadow: 0px 0px 10px 7px var(--c-red-50);
    }
}

.view-btn:has(~ .wines.swipe) {
    left: calc(100% + 20dvw - 102px)
}

.wines {
    overflow: hidden;
    grid-row: 2/3;
    grid-column: 1/4;
    margin-top: 10px;

    input {
        display: none;
    }

    > label > div:first-child {
        overflow: hidden;
        width: 100%;
        text-align: center;
    }

    .fast-props {
        flex-shrink: 0;
        margin: 10px 0;
        padding: 0 0.5em;
        color: #594747;
    }
}

.wines.swipe {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px;
    overflow: hidden;
    justify-content: center;
    align-items: center;

    > label {
        font-size: 1.25rem;
        overflow: hidden;
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        flex-wrap: nowrap;
        justify-content: space-around;
        cursor: pointer;

        h3 {
            font-size: 30px;
            margin: 0;
        }
    }

    img {
        max-width: 100%;
        max-height: 100%;
        position: relative;
        left: 2px;
    }
}

.wines.grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    overflow: hidden;
    overflow-y: auto;
    align-content: baseline;
    justify-content: flex-start;
    scrollbar-width: thin;
    container-type: size;

    > label {
        width: calc(33.33cqw - 17px);
        height: min-content;
        text-align: center;
        cursor: pointer;
        overflow: hidden;
        display: grid;
        grid-template-rows: 1fr auto;

        h3 {
            font-size: 20px;
            margin: 0;
        }
    }

    img {
        max-height: 100%;
        max-width: 100%;
    } 
    
    label:has(input:checked) {
        border-bottom: 2px solid var(--c-red-50);
    }

    .fast-props {
        font-size: 1.25em;
    }
}

.fast-props {
    text-align: start;
    font-size: 0.9em;

    ul {
        margin: 0;
        color: var(--c-elements-gray-dark);
    }
}

.props {
    grid-column: 1/2;
    grid-row: 2/4;
    padding: 0 5px;
    display: flex;
    flex-direction: column;
    border-right: 8px solid var(--c-red-50);
    margin-top: 5px;
    margin-right: -4px;
    overflow: hidden;
    overflow-y: auto;
}

.tagButton > input {
    display: none;
}

.tagButton:has(input) {
    display: inline-block;
    align-content: center;
    text-align: center;
    padding: 0.25em;
    min-height: 50px;
    min-width: 150px;
}

.tagButton:has(input)  {
    border: none;
    background-color: var(--c-gray-4);
    color: var(--c-black);

    &:has(:checked) {
        background-color: var(--c-red-50);
    }
}

.filtresLine {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    min-height: 50px;
    gap: 1em;
    overflow-x: auto;
    width: min-content;
    max-width: 100%;

    > div {
        align-content: center;
    }

    > div:nth-child(2) {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 1em;
        width: 100%;
        overflow: auto;
    }

    > div.arrow {
        width: 50px;
        background-color: var(--c-gray-4);
        color: var(--c-gray-1);
        align-content: center;
        text-align: center;
        cursor: pointer;
    }
}

.counter {
    grid-column: 1/4;
    grid-row: 3/4;
    text-align: center;

    > span {
        cursor: pointer;
    }
}

@keyframes identifier {
    0% { 
        transform: scale(1);
        box-shadow: 0px 0px 5px 1px var(--c-red-50);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0px 0px 15px 3px var(--c-red-50);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0px 0px 5px 1px var(--c-red-50);
    }
}

.buttons {
    margin: 35px 5px 0 5px;
    grid-row: 4/5;
    grid-column: 1/4;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;

    > button {
        width: calc(50% - 5px);
        height: 80px;
        font-size: 20px;

        &:first-child {
            background-color: var(--c-red-10);
            animation: identifier 3s linear infinite;
        }
    }
}

input:enabled, textarea:enabled, a:enabled, label:has(input:enabled), button:enabled {
    cursor: pointer;
}

button {
    font-size: 16px;
    background-color: var(--c-gray-4);
    border: none;
    border-radius: 3px;
    height: 57px;
}

dialog {
    border: none;
    border-radius: 10px;
    max-width: 95%;
    max-height: 95dvh;
    padding: 0;

    &::backdrop {
		background-color: #1b1d2187;
		backdrop-filter: blur(10px);
	}
}

dialog:not(:open) {
    display: none;
}

dialog.allFilters:open {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

dialog.allFilters > div {
    overflow: hidden;
    container: size;
    grid-template-rows: auto 5px 1fr auto;
    grid-template-columns: 0.5fr 0.5fr;
    display: grid;
    height: 100%;
    margin: 0 5dvh;

    h1 {
        font-family: Stolzl-Bold;
        grid-row: 1/3;
    }

    hr {
        width: 100%;
        height: 4px;
        background: var(--c-black);
        border: none;
        grid-column: 1/3;
        grid-row: 2/3;
        margin: 0;
        border-top: 1px solid var(--c-gray-2);
    }

    :where(.header, section) {
        grid-column: span 2;
    };

    section {
        overflow: auto;
        scrollbar-width: thin;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 10px;
    }

    .propsGroup:last-child {
        border-bottom: none;
    }

    .btns {
        grid-column: 1/span 2;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
        margin-bottom: 10px;

        button {
            flex-grow: 0.4;
        }

        > div {
            line-height: 50px;
        }
    }

    .header {
        display: grid;
        grid-template-columns: 1fr 50px;
        grid-template-rows: 1fr;
    }
}

dialog .close {
    margin: auto 0 auto auto;
    width: 50px;
    color: var(--c-red-dark);
    font-size: 105px;
    font-family: "VAG World Bold", "Comic Sans", cursive;
    line-height: 10px;
    padding: 0;
    display: block;
    background-image: url('../img/close-lg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
}

.propsGroup {
    display: flex;
    gap: 15px;
    width: 100%;
    overflow: hidden;
    flex-wrap: wrap;
    padding: 5px 0;
    margin: 0;
    border: none;
    border-bottom: 2px solid var(--c-gray-2);

    > p {
        font-family: "Romul";
        font-size: 2em;
        width: 100%;
        margin: 20px 0;
    }

    > div {
        width: calc(33.33% - 10px);
        min-width: min-content;

        label.tagButton {
            width: 100%;
            padding: 0;
            margin-bottom: 20px;
            container-type: inline-size;

            div {
                min-height: 33.33cqw;
                align-content: center;
            }
        }

        img {
            width: calc(100% - 30px);
            margin-bottom: 11px;
        }
    }
}
/*
label.tagButton:has(input.disabled) div {
    color: var(--c-gray-2);
}
*/
label.tagButton > input.disabled {
    & + div {
        color: var(--c-gray-2);
    }

    & ~ img {
        filter: grayscale(95%) contrast(75%);
    }
}

.card {
    font-size: 1.5em;
    overflow: auto;
    width: 95dvw;
    height: 95dvh;
    text-align: center;

    > h2 {
        grid-row: 1/2;
        color: var(--c-red-dark);
        margin-top: 0;
    }

    img {
        max-height: calc(100% - 130px);
        max-width: 100%;
        grid-row: 1/2;
    }

    button:last-child {
        grid-row: 2/3;
        margin-top: 10px;
        background-color: var(--c-red-10);
        width: 100%;
    }
}

.screensaver {
    margin: 0;
    padding: 0;
    width: 100dvw;
    height: 100dvh;
    max-width: initial;
    max-height: initial;
    border-radius: 0;
    top: 0;
    left: 0;
    cursor: pointer;
    display: initial;
    background: transparent;

    &:open {
        display: grid;
        grid-template-columns: 1fr max-content 1fr;
        grid-template-rows: 1fr max-content auto;
    }

    video {
        width: 100%;
        height: 100%;
        grid-area: 1 / 1 / 4 / 4;
        background: transparent;
        object-fit: fill;
    }

    .age {
        grid-area: 1 / 2 / 3 / 3;
        align-self: center;
        box-shadow: 0 0 20px 2px #86663c;
        background-color: var(--c-red-10);
        border: none;
        border-radius: 10px;
        font-size: 30pt;
        font-weight: bold;
        color: var(--c-red-dark);
        padding: 20px;

        div {
            margin-top: 20px;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            justify-content: space-between;
        }

        button {
            width: 45%;
            height: 75px;
            font-size: 1em;
            color: var(--c-white);
            background-color: var(--c-red-dark);
            font-weight: bold;
        }
    }

    .selectWine {
        grid-area: 3/1/4/4;;
        background-color: #4114148c;
        border: 3px solid #b41e06c4;
        color: #e3c09b;
        font-size: 12dvw;
        height: auto;
        margin: 0;
        width: 100dvw;
        font-family: "Romul";
        font-weight: bold;
    }
}