/* Стили для промокодов */
.promo-code-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.promo-code-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.promo-code-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.promo-code-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.promo-code-input:focus {
    outline: none;
    border-color: #6a7e9f;
    box-shadow: 0 0 0 3px rgba(106, 126, 159, 0.1);
}

.apply-promo-btn {
    width: 100%;
    padding: 12px 16px;
    background: #6a7e9f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.apply-promo-btn:hover {
    background: #5a6b8a;
}

.apply-promo-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.promo-message {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 10px;
}

.promo-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.promo-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.applied-promo {
    padding: 10px 15px;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 10px;
}

/* Стили для раздела "Мои покупки" */
.my-purchases-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.my-purchases-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.my-purchases-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

.my-purchases-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.purchase-email-input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.purchase-email-input:focus {
    outline: none;
    border-color: #6a7e9f;
    box-shadow: 0 0 0 3px rgba(106, 126, 159, 0.1);
}

.find-purchases-btn {
    padding: 15px 25px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.find-purchases-btn:hover {
    background: #218838;
}

.find-purchases-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.purchases-message {
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}

.purchases-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.purchases-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.purchases-list {
    margin-top: 15px;
}

.purchases-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purchase-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.purchase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f3f4;
}

.purchase-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.purchase-id {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.purchase-date {
    font-size: 12px;
    color: #666;
}

.purchase-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.purchase-status.completed {
    background: #d4edda;
    color: #155724;
}

.purchase-status.processing {
    background: #fff3cd;
    color: #856404;
}

.purchase-status.shipped {
    background: #cce5ff;
    color: #004085;
}

.purchase-status.delivered {
    background: #d1ecf1;
    color: #0c5460;
}

.purchase-status.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.purchase-items {
    margin-bottom: 10px;
}

.purchase-item-product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.purchase-item-product:last-child {
    border-bottom: none;
}

.product-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.product-quantity {
    font-size: 12px;
    color: #666;
    margin: 0 10px;
}

.product-price {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.purchase-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f1f3f4;
    font-weight: 600;
}

.total-label {
    color: #333;
    font-size: 14px;
}

.total-amount {
    color: #6a7e9f;
    font-size: 16px;
}

/* Стили для итогов корзины */
.cart-summary__subtotal,
.cart-summary__discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.cart-summary__subtotal {
    border-bottom: 1px solid #f1f3f4;
    margin-bottom: 10px;
}

.cart-summary__discount {
    color: #28a745;
    font-weight: 500;
}

.subtotal-label,
.discount-label {
    color: #666;
}

.subtotal-amount {
    color: #333;
    font-weight: 500;
}

.discount-amount {
    color: #28a745;
    font-weight: 600;
}

/* Спиннер для загрузки */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .my-purchases-form {
        flex-direction: column;
    }
    
    .find-purchases-btn {
        width: 100%;
        justify-content: center;
    }
    
    .purchase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .purchase-status {
        align-self: flex-end;
    }
    
    .purchase-item-product {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .product-quantity {
        margin: 0;
    }
}
