﻿/* Файл: wwwroot/css/pages/price-list-details.css */

.layout-grid {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 20px;
}

.layout-main {
    width: 920px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.layout-sidebar {
    width: 320px;
    flex: none;
    position: sticky;
    top: 20px;
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 29px;
    color: #07130B;
    margin: 0 0 4px 0 !important;
}

.page-meta {
    display: flex;
    gap: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #A1A1A1;
}

.table-header {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    width: 100%;
    height: 36px;
    background: #FFFFFF;
    border: 1px solid #E1E8F1;
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #A1A1A1;
}

.th-plant {
    flex-grow: 1;
    text-align: left;
}

.th-price-opt, .th-price-ret {
    width: 100px;
    text-align: left;
    flex-shrink: 0;
}

.th-delivery {
    width: 90px;
    text-align: left;
    flex-shrink: 0;
}

.th-toggle {
    width: 125px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.table-header .form-check {
    margin-bottom: 0;
    min-height: auto;
    display: flex;
    align-items: center;
}

.table-header .form-check-input {
    margin-top: 0;
    cursor: pointer;
}

.table-header .form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    line-height: 1;
    padding-top: 2px;
}

.table-header .custom-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
    margin-bottom: 0;
}

    .table-header .custom-switch .form-check-input {
        margin: 0;
        float: none;
        width: 36px;
        height: 20px;
        cursor: pointer;
    }

    .table-header .custom-switch .form-check-label {
        margin-bottom: 0;
        padding-left: 0;
        cursor: pointer;
        line-height: 1;
        padding-top: 1px;
    }

.plants-list {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E1E8F1;
    border-radius: 10px;
    padding: 0 16px;
}

.list-item-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: #FFFFFF;
    padding: 12px 0;
    min-height: 96px;
    min-width: 0;
}

    .list-item-card + .list-item-card {
        border-top: 1px solid #E1E8F1;
    }

    .list-item-card:last-child {
        border-bottom: none;
    }

.item-img-box {
    width: 72px;
    height: 72px;
    background: #E6E8EA;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.img-btn {
    border: none;
    background: transparent;
    padding: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
}

.item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
    width: auto;
    gap: 2px;
    overflow: hidden;
}

.item-title {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: #07130B;
    margin: 0 0 4px 0 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    word-break: break-word;
}

.item-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 15px;
    color: #A1A1A1;
    margin: 0 !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.item-price-opt, .item-price-ret {
    width: 100px;
    flex: 0 0 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 2px;
    flex-shrink: 0;
}

.item-delivery {
    width: 90px;
    flex: 0 0 90px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 15px;
    color: #A1A1A1;
    text-align: left;
    flex-shrink: 0;
}

.price-main {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 17px;
    color: #07130B;
}

.price-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 15px;
    color: #A1A1A1;
}

.item-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 125px;
    flex: 0 0 125px;
}

.plantItem__qty-btn {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #E1E8F1;
    border-radius: 8px;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    font-size: 0;
    padding: 0;
    transition: background-color 0.2s ease;
}

    .plantItem__qty-btn:hover {
        background-color: #F8FAFC;
    }

.plantItem__qty-minus::before {
    content: "";
    position: absolute;
    width: 11.5px;
    height: 1.37px;
    background-color: #C2C2C2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.item-counter.has-value .plantItem__qty-minus::before {
    background-color: #07130B;
}

.plantItem__qty-plus::before {
    content: "";
    position: absolute;
    width: 10.35px;
    height: 1.37px;
    background-color: #07130B;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

.plantItem__qty-plus::after {
    content: "";
    position: absolute;
    width: 1.37px;
    height: 10.34px;
    background-color: #07130B;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

.plantItem__qty-input {
    width: 36px;
    height: 17px;
    text-align: center;
    border: none;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 17px;
    color: #07130B;
    background: transparent;
}

.order-summary-card {
    background: #FFFFFF;
    border: 1px solid #E1E8F1;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #07130B;
    margin: 0;
}

.summary-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #A1A1A1;
}

.text-value {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #07130B;
    text-align: right;
}

.bold-price {
    font-weight: 800;
}

.summary-divider {
    height: 1px;
    background: #E1E8F1;
    margin: 4px 0;
}

.custom-switch .form-check-input:checked {
    background-color: #18A55E;
    border-color: #18A55E;
}

@media (min-width: 769px) {
    .content {
        padding-top: 0 !important;
        margin-top: 20px;
    }

    .price-list-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-end !important;
        width: 100% !important;
        margin-bottom: 10px;
    }
}

/* Мобильный адаптив */
@media (max-width: 768px) {
    html, body {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .layout-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        margin-top: 0 !important;
        gap: 10px !important;
    }

    .layout-main {
        display: contents !important;
    }

    .price-list-header {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0 !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .header-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        width: 100% !important;
    }

    .page-title {
        font-size: 20px !important;
        line-height: 24px !important;
    }

    .page-meta {
        flex-wrap: wrap !important;
        gap: 3px 12px !important;
    }

    .header-search {
        width: 100% !important;
    }

    .table-header {
        order: 3 !important;
        display: flex !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }

    .th-plant, .th-price-opt, .th-price-ret, .th-delivery {
        display: none !important;
    }

    .th-toggle {
        display: flex !important;
        width: 100% !important;
        justify-content: flex-end !important;
        align-items: center !important;
        height: 20px !important;
    }

    .table-header .custom-switch .form-check-input {
        background-color: #C2C2C2 !important;
        border: none !important;
        border-radius: 17px !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E") !important;
        background-position: left center !important;
        transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out !important;
    }

        .table-header .custom-switch .form-check-input:checked {
            background-color: #18A55E !important;
            background-position: right center !important;
        }

    .plants-list {
        order: 4 !important;
        padding: 0 12px !important;
        gap: 0 !important;
        margin-top: 0 !important;
    }

    .list-item-card {
        display: grid !important;
        grid-template-columns: 72px 1fr !important;
        grid-template-rows: auto auto 1fr auto auto !important;
        row-gap: 2px !important;
        column-gap: 16px !important;
        padding: 12px 0px !important;
        border-bottom: 1px solid #E1E8F1 !important;
    }

        .list-item-card:last-child {
            border-bottom: none !important;
        }

    .item-img-box {
        grid-column: 1 !important;
        grid-row: 1 / span 3 !important;
        margin: 0 !important;
    }

    .item-info {
        grid-column: 2 !important;
        grid-row: 1 / span 3 !important;
        padding-left: 0 !important;
        align-self: start !important;
    }

    .item-delivery {
        display: none !important;
    }

    .item-price-opt, .item-price-ret {
        grid-column: 1 / span 2 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        padding: 0px !important;
        gap: 8px !important;
        width: 100% !important;
        height: 17px !important;
    }

    .item-price-opt {
        grid-row: 4 !important;
        margin-top: 8px !important;
    }

    .item-price-ret {
        grid-row: 5 !important;
        margin-top: 0px !important;
    }

    .item-price-opt::before {
        content: "Опт" !important;
        width: 80px !important;
        color: #A1A1A1 !important;
    }

    .item-price-ret::before {
        content: "Розница" !important;
        width: 80px !important;
        color: #A1A1A1 !important;
    }

    .price-sub::before {
        content: "/ " !important;
    }

    .item-counter {
        position: absolute !important;
        right: 0 !important;
        bottom: 12px !important;
        margin: 0 !important;
    }

    /* Мобильный Sticky Footer / Sidebar */
    .layout-sidebar {
        order: 2 !important;
        position: sticky !important;
        top: 60px !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        z-index: 1020 !important;
    }

        .layout-sidebar.is-stuck {
            position: fixed !important;
            top: 58px !important;
            left: 0 !important;
            height: 99px !important;
            background: #FFFFFF !important;
            box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.05) !important;
            z-index: 1022 !important;
        }

            .layout-sidebar.is-stuck::before {
                content: "" !important;
                position: absolute !important;
                top: -10px !important;
                left: 0 !important;
                right: 0 !important;
                height: 11px !important;
                background: #FFFFFF !important;
                z-index: 1023 !important;
            }

    .order-summary-card {
        margin: 0 20px !important;
    }

    .layout-sidebar.is-stuck .order-summary-card {
        padding: 16px 32px !important;
        width: 100% !important;
        height: 99px !important;
        margin: 0 !important;
        border-width: 0px 0px 1px 0px !important;
        border-radius: 0px !important;
    }

    .summary-title {
        display: none !important;
    }

    .summary-row {
        height: 17px !important;
    }

    .summary-divider {
        width: 100% !important;
    }

    .btn-top-new, .btn-bottom-new {
        z-index: 1040 !important;
    }
}
