﻿/*
    CheckoutStep1
*/

/* Блоки с информацией */
.info-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
}

    .info-card .card-title {
        font-size: 1.4rem;
        font-weight: 600;
        color: #008DD2;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid #eee;
    }

/* Таблица корзины */
.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .cart-table thead th {
        background-color: #f8f9fa;
        padding: 12px 15px;
        font-weight: 600;
        border-bottom: 2px solid #008DD2;
    }

    .cart-table tbody td {
        padding: 15px;
        vertical-align: middle;
        border-bottom: 1px solid #eee;
    }

    .cart-table tbody tr:last-child td {
        border-bottom: none;
    }

.product-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* Формы */
.form-label {
    font-weight: 500;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 6px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}

    .form-control:focus {
        border-color: #008DD2;
        box-shadow: 0 0 0 0.2rem rgba(0, 141, 210, 0.25);
    }

/* Кнопки */
.btn-primary {
    background-color: #008DD2;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 500;
    color: white;
    transition: all 0.3s;
}

    .btn-primary:hover {
        background-color: #006DA8;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

.btn-outline-secondary {
    border: 1px solid #008DD2;
    color: #008DD2;
    background: transparent;
}

    .btn-outline-secondary:hover {
        background-color: #008DD2;
        color: white;
    }

/* Чекбоксы */
.form-check-input:checked {
    background-color: #008DD2;
    border-color: #008DD2;
}

/* Ошибки */
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
}


/* Адаптивность */
@media (max-width: 768px) {
    .cart-table thead {
        display: none;
    }

    .cart-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 6px;
        padding: 10px;
    }

    .cart-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        padding: 8px 0;
    }

        .cart-table tbody td::before {
            content: attr(data-label);
            font-weight: 600;
            margin-right: 15px;
            color: #008DD2;
        }

    .btn-primary {
        font-size: 1.2rem;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.5s ease-out;
}

/*
    Step2
*/
.checkout-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    padding: 20px;
}

.section-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

    .section-header h2 {
        font-size: 20px;
        font-weight: 600;
        color: #2c3e50;
        margin: 0;
    }

/* Two-column layout */
.checkout-columns {
    display: flex;
    gap: 20px;
}

.checkout-column {
    flex: 1;
}


/* Cart items styles */
.cart-items {
    margin-bottom: 20px;
}

.cart-header {
    display: flex;
    font-weight: 600;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.cart-col {
    padding: 0 10px;
}

.product-image {
    flex: 0 0 80px;
}

.product-name {
    flex: 3;
}

.product-quantity {
    flex: 1;
    text-align: center;
}

.product-price, .product-total {
    flex: 1;
    text-align: right;
}

.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
}

.cart-totals {
    display: flex;
    justify-content: flex-end;
    padding: 15px 0;
    font-weight: 600;
}

/* Client info styles */
.client-info, .company-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
}

.info-label {
    font-weight: 600;
    min-width: 150px;
    color: #555;
}

.info-value {
    flex: 1;
}

/* Delivery options */
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-company {
    margin-top: 15px;
    margin-bottom: 10px;
}

.delivery-logo {
    max-height: 40px;
    max-width: 150px;
}

.delivery-option {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 15px;
    transition: all 0.2s;
}

    .delivery-option:hover {
        border-color: #007bff;
    }

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-left: 10px;
}

.option-name {
    font-weight: 500;
}

.option-price {
    font-weight: 600;
    color: #28a745;
}

.free-shipping {
    display: flex;
    align-items: center;
}

.original-price {
    text-decoration: line-through;
    color: #dc3545;
    margin-right: 8px;
    font-size: 0.9em;
}

.free-price {
    color: #28a745;
}

/* Payment options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-option {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.2s;
}

    .payment-option:hover {
        border-color: #007bff;
    }

.payment-icon {
    height: 30px;
    margin-right: 15px;
}

.option-notice {
    font-size: 0.9em;
    color: #6c757d;
    margin-left: 10px;
}

/* Partial payment */
.partial-payment {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.partial-payment-toggle {
    margin-bottom: 10px;
}

.partial-payment-input {
    display: flex;
    margin-bottom: 15px;
}

    .partial-payment-input input {
        max-width: 200px;
    }

.input-addon {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    padding: 6px 12px;
    border-left: none;
    border-radius: 0 4px 4px 0;
}

.partial-payment-summary {
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

    .summary-row.total {
        font-weight: 600;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }

/* Order summary */
.order-summary {
    margin-top: 30px;
}

.summary-content {
    display: flex;
    gap: 30px;
}

.summary-details {
    flex: 1;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.summary-actions {
    flex: 1;
    max-width: 400px;
}

.terms-conditions {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

    .checkbox-label input {
        margin-right: 10px;
    }

.btn-checkout {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}

.payment-notice {
    font-size: 12px;
    color: #6c757d;
    margin-top: 15px;
    text-align: center;
}

/* Error states */
.has-error .error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
}

.has-error input[type="radio"],
.has-error input[type="checkbox"] {
    border-color: #dc3545;
}

/* === Адаптивность Checkout === */

/* Планшеты и меньше */
@media (max-width: 992px) {
    .checkout-columns {
        flex-direction: column;
    }

    .checkout-column {
        width: 100%;
    }

    .summary-content {
        flex-direction: column;
        gap: 20px;
    }

    .summary-actions {
        max-width: 100%;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .checkout-container {
        padding: 0 10px;
    }

    .checkout-header h1 {
        font-size: 1.6rem;
    }

    .checkout-section {
        padding: 15px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .info-label {
        min-width: 120px;
        font-size: 0.95rem;
    }

    .info-value {
        font-size: 0.95rem;
    }

    .delivery-option,
    .payment-option {
        padding: 10px 12px;
    }

    .option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .option-price {
        font-size: 0.95rem;
    }

    .summary-details {
        padding: 12px;
    }

    .summary-row {
        font-size: 0.95rem;
    }

    .btn-checkout {
        font-size: 15px;
        padding: 10px;
    }
}

/* Очень маленькие экраны (телефоны < 480px) */
@media (max-width: 480px) {
    .info-label {
        min-width: auto;
        width: 100%;
        margin-bottom: 4px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .option-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .option-content {
        margin-left: 0;
        width: 100%;
    }

    .delivery-logo {
        max-width: 100px;
        margin-bottom: 6px;
    }

    .payment-icon {
        height: 25px;
        margin-bottom: 6px;
    }

    .summary-content {
        gap: 15px;
    }
}


/* INDEX */

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f8f9fa; /* Мягкий серый фон */
}

.table {
    margin-bottom: 0;
    background-color: #ffffff;
}

.table-bordered th, .table-bordered td {
    border-color: #e9ecef !important;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    text-align: center;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

    .table tbody tr:hover {
        background-color: #f1f1f1;
    }

.table td {
    vertical-align: middle !important;
    padding: 1rem;
    font-size: 0.95rem;
}

.product-image-cell img {
    height: 70px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
    border: 1px solid #e9ecef;
}

.product-name-cell {
    font-weight: 500;
    color: #343a40;
}

.product-price-cell {
    font-weight: 700;
    font-size: 1.1rem;
    color: #007bff;
}

.quantity-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border-radius: 6px;
    margin-right: 10px;
}

.btn-update {
    font-weight: 500;
}

.btn-remove {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
    font-weight: 500;
}

    .btn-remove:hover {
        background-color: #c82333;
        border-color: #bd2130;
    }

.sales-info-row td {
    background-color: #e3f2fd;
    color: #31708f;
    padding: 15px;
    border-top: none !important;
}

.sales-info-row span {
    display: block;
    font-size: 0.9rem;
}

.sales-price {
    font-weight: 700;
    font-size: 1rem;
    margin-top: 4px;
}

.footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 1rem 0;
}

.checkout-btn {
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
}

.lead {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #343a40;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

    /* Для плавного скролла и аккуратных теней */
    .table-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .table-wrapper::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.15);
        border-radius: 4px;
    }

    .table-wrapper::-webkit-scrollbar-track {
        background-color: transparent;
    }

/* Таблица не ломается при прокрутке */
.table {
    min-width: 600px; /* Можно увеличить, если колонок больше */
}
@media (max-width: 768px) {
    /* Контейнер с формами — выравниваем по центру и делаем вертикально */
    .quantity-form {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    /* Каждая форма растягивается на всю ширину */
    .quantity-form form {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* Поле ввода чуть меньше и сжимается внутри формы */
    .quantity-input {
        width: 80px;
        margin-right: 5px;
        text-align: center;
        font-size: 0.95rem;
    }

    /* Кнопка редактирования — синяя */
    .btn-update {
        flex: 1;
        min-width: 90px;
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    /* Кнопка удаления — красная, чуть ниже */
    .btn-remove {
        width: 100%;
        font-size: 0.9rem;
        padding: 7px;
        margin-top: 20px;
    }

    /* Чтобы формы не прилипали к краям таблицы */
    .table td {
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    /* Для совсем маленьких экранов — компактнее */
    .quantity-input {
        width: 70px;
        font-size: 0.85rem;
    }

    .btn-update,
    .btn-remove {
        font-size: 0.85rem;
        padding: 6px;
    }

    .quantity-form {
        gap: 5px;
    }
}


