/* 
* Стили для печати корзины.
* Эти стили применяются только при печати.
*/

#dsa-print-container {
    display: none !important;
}

@media print {

    /* --- Общие настройки страницы --- */
    @page {
        size: A4;
        margin: 1.5cm;
    }

    body {
        font-family: 'Rubik', sans-serif;
        font-size: 10pt;
        color: #000;
        background-color: #fff;
    }

    /* --- Скрытие ненужных элементов --- */
    body>*:not(#dsa-print-container) {
        display: none !important;
    }

    #dsa-print-container {
        display: block !important;
        visibility: visible !important;
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
    }

    /* --- Шапка документа --- */
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding-bottom: 20px;
        margin-bottom: 30px;
        border-bottom: 1px solid #ccc;
    }

    .print-header__left .print-logo {
        max-width: 150px;
        height: auto;
    }

    .print-header__center {
        text-align: center;
    }

    .print-header__center span,
    .print-header__right span {
        display: block;
        font-size: 9pt;
        color: #555;
    }

    .print-header__right {
        text-align: right;
    }

    .print-header__right strong {
        font-size: 12pt;
    }

    /* --- Таблица с товарами --- */
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 30px;
    }

    .print-table th,
    .print-table td {
        padding: 10px;
        border-bottom: 1px solid #eee;
        text-align: left;
        vertical-align: middle;
    }

    .print-table th {
        font-weight: 500;
        font-size: 9pt;
        color: #666;
        text-transform: uppercase;
        border-bottom-width: 2px;
        border-color: #ccc;
    }

    .print-table td:nth-child(1) {
        width: 10%;
    }

    .print-table td:nth-child(2) {
        width: 50%;
    }

    .print-table td:nth-child(3),
    .print-table td:nth-child(4),
    .print-table td:nth-child(5) {
        width: 15%;
        text-align: right;
    }

    .print-product-image {
        max-width: 60px;
        height: auto;
        border: 1px solid #eee;
    }

    /* --- Блок итогов --- */
    .print-totals {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-bottom: 40px;
    }

    .print-totals__label {
        font-size: 16pt;
        font-weight: 700;
        margin-right: 20px;
    }

    .print-totals__value {
        font-size: 16pt;
        font-weight: 700;
    }

    /* --- Подвал документа (реквизиты) --- */
    .print-footer {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding-top: 20px;
        border-top: 1px solid #ccc;
    }

    .print-footer__details {
        font-size: 9pt;
    }

    .print-footer__details strong {
        display: block;
        margin-bottom: 5px;
    }

    .print-footer__details p {
        margin: 0 0 3px;
    }

    .print-footer__url {
        font-size: 8pt;
        color: #888;
        align-self: flex-end;
    }

    /* --- Системный подвал страницы (для @page) --- */
    .print-page-footer {
        display: flex;
        justify-content: space-between;
        width: 100%;
        font-size: 8pt;
        color: #888;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0 1.5cm 10px 1.5cm;
        /* Отступы соответствуют @page margin */
    }

    /* Убираем ссылки и другие интерактивные элементы из печати */
    a {
        text-decoration: none;
        color: inherit;
    }
}