/* Контейнер списка заказов */
.orders-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Карточка заказа (Группа) */
.order-group {
    background: rgba(30, 25, 50, 0.7);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.order-group:hover {
    border-color: rgba(108, 92, 231, 0.5);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Шапка заказа (всегда видна) */
.order-header {
    padding: 20px;
    background: rgba(45, 40, 65, 0.5);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.order-header:hover {
    background: rgba(108, 92, 231, 0.1);
}

/* Левая часть шапки */
.order-title h3 {
    margin: 0;
    font-size: 1.2em;
    color: #fff;
}

.order-date {
    font-size: 0.9em;
    color: #bdc3c7;
    margin-top: 5px;
}

/* Правая часть шапки */
.order-summary {
    text-align: right;
}

.order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #6c5ce7;
    display: block;
}

.order-status {
    display: inline-block;
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 5px;
    font-weight: 500;
}

/* Цвета статусов */
.status-process { background: rgba(33, 150, 243, 0.2); color: #2196f3; } /* В обработке */
.status-sent { background: rgba(255, 152, 0, 0.2); color: #ff9800; } /* Отправлен */
.status-done { background: rgba(76, 175, 80, 0.2); color: #4caf50; } /* Доставлен */
.status-cancel { background: rgba(244, 67, 54, 0.2); color: #f44336; } /* Отменен */

/* Стрелочка раскрытия */
.toggle-icon {
    margin-left: 20px;
    transition: transform 0.3s;
    font-size: 0.8em;
    color: #a29bfe;
}

.order-group.active .toggle-icon {
    transform: rotate(180deg);
}

/* Тело заказа (скрыто по умолчанию) */
.order-details {
    display: none; /* Скрыто */
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(20, 18, 35, 0.4);
    animation: slideDown 0.3s ease;
}

.order-group.active .order-details {
    display: block; /* Показываем при классе active */
}

/* Список товаров внутри заказа */
.order-item-row {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.order-item-row:last-child {
    border-bottom: none;
}

.item-img {
    width: 60px;
    height: 60px;
    background: #2d2a3b;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    flex-grow: 1;
}

.item-name {
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
    display: block;
    text-decoration: none;
}
.item-name:hover { color: #a29bfe; }

.item-meta {
    font-size: 0.9em;
    color: #888;
}

.item-price {
    font-weight: bold;
    color: #fff;
}

/* Блок с адресом доставки */
.delivery-info-block {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.9em;
    color: #bdc3c7;
}

.delivery-info-block h4 {
    color: #fff;
    margin-bottom: 10px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}



/* --- Адаптив истории заказов --- */
@media (max-width: 600px) {
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .order-summary {
        text-align: left;
    }
    .toggle-icon {
        position: absolute;
        top: 20px;
        right: 20px;
        margin-left: 0;
    }
    .order-header {
        position: relative;
    }
    .order-item-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .item-img {
        width: 100%;
        height: 150px;
    }
}