@charset "UTF-8";

:root {
    --bg: #2c2c2f;
    --surface: #3a3a3d;
    --tabs-bg: #1a1a1d;
    --tabs-border: #3a3a3a;
    --tab-color: #888;
    --tab-active: #74c0fc;
    --text: #e4e5e5;
    --accent: #475e73;
    --tabs-h: 60px;
    --head-h: 70px;
    --content-max: 720px;
    --content-max-wide: 960px;
}

/* Атрибут hidden должен скрывать элемент всегда. Браузерное правило [hidden]{display:none} —
   это UA-стиль, и его перебивает ЛЮБОЙ авторский display, независимо от специфичности:
   например глобальное `form input {display:block}` в contact.css показывало скрытые input'ы форм. */
[hidden] {
    display: none !important;
}

#mainWrap {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    padding-bottom: var(--tabs-h);
}
.page-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0s 0.5s; /* visibility применяется после fade-out */
    height: 0px;
}

.page-active {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 4.3em;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s 0s;   /* visibility сразу */
}

/* .item {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease, display 0.4s allow-discrete;
  }
  
  .item.show {
    display: block;
    opacity: 1;
  } */


#page-record.page-active {
    display: flex;
    flex-direction: column;
    padding: 6px 10px 0;
    gap: 6px;
    overflow: hidden;
    height: calc(100vh - 4.3em - var(--tabs-h));
}

div#specialist, div#service, div#dateTime {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
    padding: 4px 8px;
    background-color: #3b3c3d;
    border-radius: 10px;
    gap: 10px;
}

#page-record .div-icon {
    background-color: #e4e5e5;
    border-radius: 50%;
    width: 32px;
    flex-wrap: wrap;
    height: 32px;
    display: flex;
    justify-content: center;
    align-content: center;
    flex-shrink: 0;
}

#page-record .div-content span {
    font-size: 1.05em;
    color: #e3e1e1;
}

#page-record .div-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#page-record .div-pic {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#page-record .div-pic-size {
    color: #a1a1a1;
}

#page-record div#select > div {
    margin: 10px;
}

div#page-head {
    background-position: center;
    background-size: contain;
    background-image: url("../viveska.jpg");
    background-repeat: no-repeat;
    margin: 5px 10px 0px 10px;
    position: relative;
    z-index: 100;
    display:flex;
    color: #e4e5e5;
    width: 100%;
    height: 4em;
    align-content: center;
    align-items: center;
}



#page-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    bottom: 5em;
    width: 100%;
    padding: 0px 10px;
    transition: opacity 0.5s ease, visibility 0s 0s;
}

#page-contact.page-active ~ #page-bottom, 
#page-record.page-active ~ #page-bottom, 
#page-calend.page-active ~ #page-bottom,
#page-master.page-active ~ #page-bottom {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease, visibility 0s 0s;
    
}

#page-bottom > div {
    /* outline: red solid 1px; */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    /* width: 100%; */
}
#page-bottom > div > div{
    /* outline: red solid 1px; */
    text-align: center;
}

.record-wait {
    border-width: 1px;
    border-radius: 10px;
    margin: 0px 10px;
    background-color: #3b3c3d;
    box-shadow: 7px 6px 3px #151a19;
    cursor: pointer;
    transition: all 0.1s ease; /* Плавность эффекта */
     user-select: none; /* Запрет выделения текста */    
}

.record-wait span.timer {
    font-size: 80%;
}

.record-wait:active {
    transform: scale(0.95);
     box-shadow: 0 1px 0 #151a19;
}

/* Плавная замена плиток на record-wait внутри #page-record.
   Когда .record-wait не скрыт (нет класса .hide1C):
     — .record-wait плавно появляется,
     — #specialist/#service/#dateTime плавно сворачиваются. */
#page-record > #specialist,
#page-record > #service,
#page-record > #dateTime {
    overflow: hidden;
    max-height: 200px;
    transition: opacity .4s ease, max-height .4s ease,
                padding .4s ease, margin .4s ease,
                transform .4s ease, visibility 0s linear 0s;
}

#page-record > .record-wait {
    overflow: hidden;
    transition: opacity .4s ease, max-height .4s ease,
                padding .4s ease, margin .4s ease,
                transform .4s ease, visibility 0s linear .4s;
}

/* Переопределяем .hide1C для .record-wait в #page-record — анимируемое скрытое состояние.
   Внешний `.hide1C { display: none !important }` остаётся для других мест. */
#page-record > .record-wait.hide1C {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

#page-record > .record-wait:not(.hide1C) {
    opacity: 1;
    visibility: visible;
    max-height: 400px;
    transform: translateY(0);
    transition: opacity .4s ease, max-height .4s ease,
                padding .4s ease, margin .4s ease,
                transform .4s ease, visibility 0s linear 0s;
}

#page-record:has(> .record-wait:not(.hide1C)) > #specialist,
#page-record:has(> .record-wait:not(.hide1C)) > #service,
#page-record:has(> .record-wait:not(.hide1C)) > #dateTime {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .4s ease, max-height .4s ease,
                padding .4s ease, margin .4s ease,
                transform .4s ease, visibility 0s linear .4s;
}

#bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    height: var(--tabs-h);
    background: var(--tabs-bg);
    border-top: 1px solid var(--tabs-border);
    z-index: 100;
    /* кнопок больше шести — панель листается влево-вправо */
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

#bottom-tabs::-webkit-scrollbar {
    display: none;
}

#bottom-tabs button {
    /* ровно 6 кнопок в видимой области при любой ширине контейнера */
    flex: 0 0 calc(100% / 6);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--tab-color);
    font-size: 11px;
    cursor: pointer;
    padding: 6px 2px;
    margin: 0;
    transition: color 0.15s ease, background 0.15s ease;
    min-width: 0;
}

#bottom-tabs button > svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

#bottom-tabs button > span {
    font-size: 10.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#bottom-tabs button:hover {
    color: var(--text);
}

#bottom-tabs button.tab-active {
    color: var(--tab-active);
}

#bottom-tabs button.tab-active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    background: var(--tab-active);
    border-radius: 0 0 3px 3px;
}

#bottom-tabs button {
    position: relative;
}

#cmd-bottom {
    position: fixed;
    bottom: calc(var(--tabs-h) + 8px);
    left: 0;
    right: 0;
    z-index: 90;
}

@media (min-width: 768px) {
    #mainWrap {
        max-width: var(--content-max-wide);
        width: 100%;
        margin: 0 auto;
    }

    #bottom-tabs {
        max-width: var(--content-max-wide);
        margin: 0 auto;
        border-radius: 12px 12px 0 0;
        border-left: 1px solid var(--tabs-border);
        border-right: 1px solid var(--tabs-border);
        overflow-x: hidden; /* на десктопе скролл не нужен — все кнопки видны */
    }

    /* Все кнопки делят ширину контейнера (720px) — показываем все 7 без скролла. */
    #bottom-tabs button {
        flex: 1 1 0;
    }

    #page-record.page-active {
        padding: 16px 24px;
        gap: 10px;
    }

    #cmd-bottom {
        max-width: var(--content-max);
        margin: 0 auto;
    }

    body {
        background: linear-gradient(180deg, #1d1d20 0%, #2c2c2f 100%);
    }
}

@media (min-width: 1024px) {
    :root { --tabs-h: 64px; }

    /* Контент остаётся не шире 720px (var(--content-max)) и на больших экранах. */

    #bottom-tabs button > span {
        font-size: 12px;
    }
}


