/* Основные стили МДФ калькулятора - Unique Styles */

.amc_wrapper {
    width: 100%;
    /* background: #dcdcdc; */
    padding: 10mm 0;
}

.amc_btn_action svg,
.amc_btn_submit svg {
    width: 20px !important;
    height: 20px !important;
}

.amc_btn_print {
    height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.amc_btn_action {
    height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}



.amc_page {
    width: 100%;
    /* max-width: 210mm; */
    /* min-height: 297mm; */
    margin: 0 auto;
    background: #fff;
    padding: 10mm 12mm;
    border: 1px solid #aaa;
    box-sizing: border-box;
}

.amc_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    font-family: "Arial", sans-serif;
    table-layout: fixed;
    border: 0 !important;
    /* Фіксована ширина колонок */
}

.amc_table th,
.amc_table td {
    border: 1px solid #000 !important;
    padding: 4px 2px !important;
    text-align: center !important;
}

.amc_table th {
    font-weight: bold;
    background: #f5f5f5;
}

.amc_readonly,
.amc_readonly_input {
    background: transparent !important;
    color: #555;
    pointer-events: none;
    /* Optional: prevents clicking */
}

.amc_table input,
.amc_table select {
    width: 100%;
    border: none;
    text-align: center;
    font-size: 11px;
    padding: 0;
    margin: 0;
    background: transparent;
    font-family: "Arial", sans-serif;
    border-width: 0 !important;
}

.amc_table input:focus,
.amc_table select:focus {
    outline: 1px solid #2271b1;
    outline-offset: -1px;
}

.amc_table select {
    cursor: pointer;
}



/* Actions logic */
.amc_actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.amc_btn_action {
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-family: inherit;
    transition: background 0.2s;
}

.amc_btn_print {
    background: #f0f0f1;
    color: #333;
    border: 1px solid #ccc;
}

.amc_btn_print:hover {
    background: #e0e0e0;
}

.amc_btn_checkout {
    background: #AB5733;
    color: white;
}

.amc_btn_checkout:hover {
    background: #894528 !important;
    color: #fff !important;
}

/* Modal Styles */
.amc_modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.amc_modal_content {
    background-color: #fefefe;
    margin: auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    font-family: "Arial", sans-serif;
}

.amc_close_modal {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #999;
    transition: all 0.2s;
    line-height: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.amc_close_modal:hover {
    color: #333;
    background-color: #f0f0f0;
    transform: rotate(90deg);
}

.amc_form_group {
    margin-bottom: 15px;
}

.amc_form_group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.amc_form_group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    background: #fff;
}

.amc_btn_submit {
    width: 100%;
    padding: 10px;
    background: #AB5733;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.amc_btn_submit:hover {
    background: #894528 !important;
    color: white;
}

/* Toast Styles */
#amc-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
}

.amc_toast {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    border-left: 4px solid #AB5733;
    font-family: "Arial", sans-serif;
    font-size: 14px;
    min-width: 250px;
    pointer-events: auto;
}

.amc_toast.show {
    transform: translateX(0);
}

.amc_toast_icon {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.amc_mono_icon {
    /* filter: grayscale(100%); - Not used anymore due to SVG */
    margin-right: 8px;
    display: inline-block;
}

.amc_btn_action svg,
.amc_btn_submit svg {
    vertical-align: middle;
    margin-bottom: 2px;
    margin-right: 6px;
}

.amc_btn_row {
    margin: 10px 0;
}

.amc_btn_add {
    font-size: 11px;
    padding: 8px 16px;
    border: 1px solid #000;
    background: #eee;
    cursor: pointer;
    font-family: "Arial", sans-serif;
    transition: all 0.2s;
    color: #000;
}

.amc_btn_add:hover {
    background: #ddd;
}

.amc_btn_add:active {
    transform: translateY(1px);
}

.amc_del_btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    color: #000000;
    font-weight: bold;
}

button:hover {
    background-color: #ab573300 !important;
    color: #ab5733;
}

.amc_row_num {
    width: 20px;
    font-weight: bold;
}

.amc_footer {
    margin-top: 20px;
    font-size: 14px;
    text-align: right;
    font-family: "Arial", sans-serif;
}

.amc_footer div {
    margin-bottom: 8px;
}

.amc_footer b {
    color: #2271b1;
    font-size: 16px;
}

/* Адаптивность для мобильных */
.amc_table_scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}

@media screen and (max-width: 768px) {
    .amc_wrapper {
        padding: 5px 0;
    }

    .amc_page {
        width: 100%;
        max-width: 100%;
        padding: 10px;
        border: none;
    }

    .amc_table {
        min-width: 800px;
        /* Фиксируем ширину для прокрутки, чтобы не ломать верстку */
        font-size: 11px;
        /* Возвращаем нормальный размер шрифта */
    }

    .amc_table th,
    .amc_table td {
        padding: 4px 2px !important;
    }

    .amc_table input,
    .amc_table select {
        font-size: 11px;
    }

    .amc_actions {
        flex-direction: column;
        gap: 10px;
    }

    .amc_btn_action {
        width: 100%;
        justify-content: center;
    }

    .amc_footer {
        text-align: left;
        margin-top: 15px;
        padding: 10px;
        background: #fdfdfd;
        border: 1px solid #eee;
    }
}



/* Печать - Optimized */
@media print {
    body * {
        visibility: hidden;
    }

    .amc_wrapper,
    .amc_wrapper * {
        visibility: visible;
    }

    .amc_wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }

    .amc_page {
        border: none;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: none;
        box-shadow: none;
    }

    .amc_btn_row,
    .amc_no_print,
    .amc_actions,
    .amc_del_btn {
        display: none !important;
    }
}