/**
 * Стили для выбора аптеки в корзине
 */

/* Блок выбора аптеки */
.store-selection {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.store-selection-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.store-selection-text {
    color: #666;
    margin-bottom: 15px;
}

.store-selection-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Элемент аптеки */
.store-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.store-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.store-item.selected {
    border-color: #28a745;
    background: #f8fff9;
}

.store-item.full {
    border-left: 4px solid #28a745;
}

.store-item.partial {
    border-left: 4px solid #ffc107;
}

.store-item.limited {
    border-left: 4px solid #dc3545;
}

/* Информация об аптеке */
.store-info {
    flex: 1;
    margin-right: 20px;
}

.store-address {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.store-phone {
    color: #666;
    margin-bottom: 3px;
}

.store-phone a {
    color: #007bff;
    text-decoration: none;
}

.store-phone a:hover {
    text-decoration: underline;
}

.store-time {
    font-size: 12px;
    color: #999;
}

/* Доступность товаров */
.store-availability {
    flex: 1;
    margin-right: 20px;
}

.availability-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.availability-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.availability-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.3s ease;
}

.availability-percentage {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Кнопка выбора */
.store-select {
    flex-shrink: 0;
}

.btn-select-store {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-select-store:hover {
    background: #0056b3;
}

.store-item.selected .btn-select-store {
    background: #28a745;
}

.store-item.selected .btn-select-store:hover {
    background: #1e7e34;
}

/* Блок состава заказа */
.order-composition-container {
    margin: 20px 0;
}

.order-composition {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.composition-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.composition-header h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.store-name {
    font-size: 14px;
    color: #666;
}

.composition-table {
    padding: 20px;
}

.composition-table .basked_table {
    width: 100%;
    border-collapse: collapse;
}

.composition-table .basked_table th,
.composition-table .basked_table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.composition-table .basked_table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

/* Информация о наличии */
.stock-info {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Общая сумма */
.composition-total {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.total-sum {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.total-label {
    color: #333;
}

.total-value {
    color: #007bff;
    font-size: 18px;
}

/* Состояния загрузки и ошибок */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .store-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .store-info,
    .store-availability {
        margin-right: 0;
        width: 100%;
    }

    .store-select {
        width: 100%;
    }

    .btn-select-store {
        width: 100%;
    }

    .composition-table {
        padding: 10px;
    }

    .composition-table .basked_table th,
    .composition-table .basked_table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .nomob {
        display: none !important;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-composition {
    animation: fadeIn 0.3s ease;
}

/* Стили для полей ввода с ошибками */
.order-composition input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Скрытие блока оформления заказа до выбора аптеки */
.order-form-container {
    display: none;
}

.order-form-container.show {
    display: block;
    animation: fadeIn 0.3s ease;
}