@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap");

:root {
    --vs-primary: 29 92 255;
}

/* previus-order */
#previus-order {
    position: fixed;
    top: 0px;
    left: 0;
    background: white;
    z-index: 991;
    width: 100%;
    height: 100%;
    background: #00000038;
}

#previus-order.displayNone {
    display: none;
}

#previus-order>div {
    width: 75%;
    height: 85%;
    position: fixed;
    top: 5%;
    right: 50%;
    transform: translate(50%, 0);
    background: white;
    z-index: 992;
    padding: 1rem 2rem 1rem 2rem;
    border-radius: 12px;
    overflow-y: scroll;
}

#previus-order>div table thead td {
    border-radius: 0 !important;
    background-color: white !important;
}

#previus-order>div::-webkit-scrollbar {
    width: 10px;
    border-radius: 12px;
    background-color: #f9f9fd;
}

#previus-order>div::-webkit-scrollbar-thumb {
    border-radius: 12px;
    background-color: #7f76799e;
}

#previus-order>div::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    background-color: #f9f9fd;
}

/* imgOnHover */
.nameImage {
    position: relative;
}

.imgOnHover {
    display: none;
    position: absolute;
    bottom: 0;
    right: 0;
    max-width: 170px;
    border: 0;
    z-index: 999;
}

img.imgOnHover {
    opacity: 1;
    transition: opacity 0.3s;
}

img[data-src].imgOnHover {
    opacity: 0;
}

.nameImage:hover .imgOnHover {
    display: flex;
}

/*Dialog Styles*/
dialog {
    padding: 1rem 3rem;
    background: white;
    max-width: 49%;
    padding-top: 2rem;
    border-radius: 20px;
    border: 0;
    box-shadow: 0 5px 30px 0 rgb(0 0 0 / 10%);
    animation: fadeIn 1s ease both;
}

dialog::backdrop {
    animation: fadeIn 1s ease both;
    background: rgb(255 255 255 / 40%);
    z-index: 2;
    backdrop-filter: blur(20px);
}

dialog .line{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

dialog .line .btn{
    margin: 0;
    background-color: #0c65f5;
    border-radius: 8px;
    color: #fff;
}

dialog .line .btn:hover:active{
    background-color: #fff;
    color: #000;
    transition: all 0.2s;
}

dialog .x {
    filter: grayscale(1);
    border: none;
    background: none;
    position: absolute;
    top: 15px;
    right: 10px;
    transition: ease filter, transform 0.3s;
    cursor: pointer;
    transform-origin: center;
}

dialog .x:hover {
    filter: grayscale(0);
    transform: scale(1.1);
}

dialog>h2 {
    font-weight: 600;
    font-size: 2rem;
    padding-bottom: 1rem;
}

dialog>p {
    font-size: 1rem;
    line-height: 1.3rem;
    padding: 0.5rem 0;
}

dialog>p>a:visited {
    color: rgb(var(--vs-primary));
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 2rem;
    margin-right: 2rem;
}

footer .confirm-order {
    display: flex;
    gap: 2vw
}

footer .confirm-order div.io {
    display: flex;
    align-items: center;
}

.zeroMargin {
    margin: 0;
}

#news-block {
    display: none;
    overflow: hidden;
    transition: height 0.3s ease-out;
    border: 1px solid #ccc;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 2;
    box-shadow: 4px -5px 6px rgba(0, 0, 0, 0.1);
    background-color: white;  
    max-height: 70%;
    overflow-y: scroll; 
}

/* Стили для скроллбара */
#news-block::-webkit-scrollbar {
    width: 8px; /* Ширина скроллбара */
}

#news-block::-webkit-scrollbar-thumb {
    background-color: #888; /* Цвет ползунка скроллбара */
    border-radius: 4px; /* Закругленные углы ползунка */
}

#news-block .news-item {
    background-color: #f2f2f2;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    position: relative;
}

#news-block .news-header {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: small;
    color: deeppink;
}

#news-block .news-title {
    font-weight: bold;
    font-size: large;
}

#news-block p {
    white-space: pre;
}

#news-content {
    padding: 10px;
}

#toggle-button {
    cursor: pointer;
    padding: 5px;
    width: 80px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: #fff;
    text-align: center;
    box-sizing: border-box;
    transition: background 0.3s ease-out;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px 8px 0 0;
    font-size: small;
    z-index: 3;
    display: none;
}

#toggle-button:hover {
    background: linear-gradient(45deg, #2980b9, #3498db);
}
#mainTotalCategories {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 60px;
    width: 60px;
    height: 60px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Псевдоэлемент для иконки в миниатюрном состоянии */
#mainTotalCategories::before {
    content: "💰";
    font-size: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: all 0.3s ease;
    opacity: 1;
}

/* Миниатюрная сумма под иконкой */
#mainTotalCategories::after {
    content: attr(data-mini-total);
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    font-size: 9px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    z-index: 1;
    opacity: 1;
    transition: all 0.3s ease;
}

/* Скрываем весь контент по умолчанию */
#mainTotalCategories > * {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* При наведении показываем контент и скрываем псевдоэлементы */
#mainTotalCategories:hover {
    max-width: 300px;
    width: auto;
    height: auto;
    min-height: 200px;
    padding: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#mainTotalCategories:hover::before,
#mainTotalCategories:hover::after {
    opacity: 0;
    visibility: hidden;
}

#mainTotalCategories:hover > * {
    opacity: 1;
    max-height: 1000px;
    overflow: visible;
}

#mainTotalCategories h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    text-align: center;
}

#mainTotalCategories ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 250px;
    overflow-y: auto;
}

#mainTotalCategories ul::-webkit-scrollbar {
    width: 5px;
}

#mainTotalCategories ul::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#mainTotalCategories ul::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

#mainTotalCategories li {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

#mainTotalCategories:hover li {
    opacity: 1;
    transform: translateY(0);
}

#mainTotalCategories li:hover {
    background: #e9ecef;
}

#mainTotalCategories li:nth-child(1) {
    border-left-color: #3498db;
    transition-delay: 0.05s;
}

#mainTotalCategories li:nth-child(2) {
    border-left-color: #2ecc71;
    transition-delay: 0.1s;
}

#mainTotalCategories li:nth-child(3) {
    border-left-color: #e74c3c;
    transition-delay: 0.15s;
}

#mainTotalCategories li:nth-child(4) {
    border-left-color: #f39c12;
    transition-delay: 0.2s;
}

#mainTotalCategories li:nth-child(5) {
    border-left-color: #9b59b6;
    transition-delay: 0.25s;
}

#mainTotalCategories li:nth-child(n+6) {
    border-left-color: #95a5a6;
    transition-delay: 0.3s;
}

#mainTotalCategories li strong {
    color: #2c3e50;
    font-weight: 600;
    flex: 1;
}

#mainTotalCategories li::after {
    content: attr(data-amount);
    color: #27ae60;
    font-weight: 600;
    font-size: 13px;
    background: rgba(39, 174, 96, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 70px;
    text-align: right;
}

#mainTotalCategories > p:last-child {
    margin: 15px 0 0 0;
    padding: 12px;
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

#mainTotalCategories > p:last-child strong {
    display: block;
    font-size: 18px;
    margin-top: 5px;
    font-weight: 700;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    #mainTotalCategories {
        position: relative;
        top: auto;
        right: auto;
        max-width: 100%;
        width: auto;
        height: auto;
        margin: 20px auto;
    }
    
    #mainTotalCategories::before,
    #mainTotalCategories::after {
        display: none;
    }
    
    #mainTotalCategories > * {
        opacity: 1;
        max-height: none;
        overflow: visible;
    }
    
    #mainTotalCategories:hover {
        max-width: 100%;
    }
}