/* Checkout Page Styles */
.checkout-page {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.page-title {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 40px;
    text-align: center;
}

.checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Form Section */
.checkout-form-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 25px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select:disabled,
.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Search Results */
.city-search-results,
.warehouse-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.city-search-results.active,
.warehouse-search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item.selected {
    background: rgba(102, 126, 234, 0.1);
    font-weight: 500;
}

.form-group {
    position: relative;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.loading-cities,
.loading-warehouses {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-method {
    display: block;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.payment-method input[type="radio"] {
    display: none;
}

.payment-method input[type="radio"]:checked + .payment-method-content {
    color: #667eea;
}

.payment-method:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.payment-method-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.payment-icon {
    font-size: 32px;
}

.payment-method-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.payment-method-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-submit {
    flex: 1;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
}

.btn-secondary {
    padding: 16px 24px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Order Summary */
.checkout-summary-section {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.order-summary {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.order-summary h2 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 25px;
    color: #333;
}

.order-items-list {
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.order-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    flex-shrink: 0;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

.order-item-details {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.order-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.order-totals {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 16px;
}

.total-row.total-final {
    font-size: 20px;
    font-weight: 600;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    margin-top: 15px;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-cart-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-cart h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-cart p {
    margin-bottom: 30px;
}

/* Requisites Modal */
.requisites-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

.requisites-modal > div {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.requisites-modal button[onclick*="remove"] {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.requisites-modal button[onclick*="remove"]:hover {
    background: #f5f5f5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .checkout-wrapper {
        grid-template-columns: 1fr;
    }

    .checkout-summary-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .checkout-page {
        padding: 20px 0;
    }

    .checkout-form-section,
    .order-summary {
        padding: 20px 15px;
    }
    
    .page-title {
        font-size: 28px;
        padding: 0 10px;
    }

    .form-section h2 {
        font-size: 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
        padding: 12px 16px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-submit,
    .btn-secondary {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }
    
    .payment-method {
        padding: 15px;
    }
    
    .order-item {
        gap: 10px;
    }
    
    .order-item-image {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .checkout-form-section,
    .order-summary {
        padding: 15px 10px;
    }
    
    .page-title {
        font-size: 24px;
    }
}

