/* Checkout Page Styles - Clean implementation focusing on vertical layout and section expansion */

/* ======================================== */
/* CHECKOUT TABLE STYLES */
/* ======================================== */

/* Cart Summary Header and Toggle */
.cart-summary-container {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 20px auto;
    display: block;
    clear: both;
    float: none;
}

.cart-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #007bff;
    border-bottom: 1px solid #0056b3;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cart-summary-header h3 {
    margin: 0 0 5px 0;
    color: white;
    font-size: 18px;
    font-weight: bold;
    flex: 1;
}

.toggle-details-btn {
    background-color: #e9ecef;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-details-btn:hover {
    background-color: #dee2e6;
}

/* Cart summary expanded state - no hover effects */
.cart-summary-container.expanded {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    background-color: #f8f9ff;
}

/* Expand icon styling for cart summary */
.cart-summary-header .expand-icon {
    font-size: 16px;
    color: #333;
    transition: transform 0.3s ease;
}

.cart-summary-container.expanded .expand-icon {
    color: #333;
    font-weight: bold;
}

/* Smooth expand/collapse animation for cart table */
.cart-table-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.cart-table-wrapper.expanded {
    max-height: 1000px;
}

.cart-table-wrapper.hidden {
    max-height: 0 !important;
}

.cart-table {
    display: table;
    width: 100%;
}

/* Remove border-radius from cart table in checkout */
.checkout-page .cart-table {
    border-radius: 0 !important;
    overflow: visible !important;
}

/* Additional styles for checkout page */
.back-to-cart-btn {
    display: inline-block;
    padding: 6px 10px !important;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s;
}

.back-to-cart-btn:hover {
    background-color: #5a6268 !important;
}

/* Remove interactive elements from cart table for checkout */
.checkout-page .cart-table .remove-column,
.checkout-page .cart-table .quantity-controls {
    display: none !important;
}

.checkout-page .cart-table th.remove-column,
.checkout-page .cart-table td.remove-column {
    display: none !important;
}

/* Minimize row heights for checkout summary table */
.checkout-page .cart-table th {
    padding: 6px 8px !important;
    font-size: 16px !important;
}

.checkout-page .cart-table td {
    padding: 4px 8px !important;
    font-size: 16px !important;
}

/* Adjust column widths for checkout view */
.checkout-page .cart-table .item-name-column {
    width: 50% !important;
}

.checkout-page .cart-table .price-column {
    width: 20% !important;
}

.checkout-page .cart-table .quantity-column {
    width: 15% !important;
}

.checkout-page .cart-table .total-column {
    width: 15% !important;
}

/* Remove compact summary row styling so they match the rest of the table */
.checkout-page .cart-table .cart-total-row td,
.checkout-page .cart-table .cart-shipping-row td,
.checkout-page .cart-table .cart-final-total-row td {
    padding: 4px 8px !important;
    font-size: 16px !important;
}

.checkout-page .cart-table .cart-final-total-row td {
    font-weight: bold !important;
    font-size: 16px !important;
}

/* ======================================== */
/* CHECKOUT FORMS STYLES - VERTICAL DROPDOWN LAYOUT */
/* ======================================== */

/* Main checkout forms container */
.checkout-forms {
    max-width: 1200px;
    margin: 0 auto;
}

/* Form sections container - MUST be vertical */
.checkout-page .form-sections-container {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
}

/* Individual form sections - MUST stack vertically */
.checkout-page .form-section {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto 20px auto !important;
    display: block !important;
    clear: both !important;
    float: none !important;
}

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

/* Persistent highlight for expanded section */
.checkout-page .form-section.expanded {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
    background-color: #f8f9ff;
}

.checkout-page .form-section.disabled {
    background-color: #e9ecef;
    border-color: #ced4da;
    opacity: 0.6;
    pointer-events: none;
}

.checkout-page .form-section.disabled h3,
.checkout-page .form-section.disabled p {
    color: #6c757d;
}

/* Section Header */
.checkout-page .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.checkout-page .section-header:hover {
    background-color: #e9ecef;
}

/* Persistent highlight for expanded section header */
.checkout-page .form-section.expanded .section-header {
    background-color: #e9ecef;
}

.checkout-page .section-title {
    flex: 1;
}

.checkout-page .section-title h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.checkout-page .section-title p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.checkout-page .section-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.checkout-page .status-text {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

.checkout-page .status-text.not-started {
    background-color: #6c757d;
    color: white;
}

.checkout-page .status-text.completed {
    background-color: #28a745;
    color: white;
    text-decoration: none !important;
}

.checkout-page .status-text.not-required {
    background-color: #6c757d;
    color: white;
    opacity: 0.7;
}

.checkout-page .expand-icon {
    font-size: 16px;
    color: #666;
    transition: transform 0.3s ease;
}

/* Persistent styling for expanded section icon */
.checkout-page .form-section.expanded .expand-icon {
    color: #007bff;
    font-weight: bold;
}

/* Postal code validation styling removed - no live color validation */

/* Section Content - Smooth expand/collapse animation */
.checkout-page .section-content {
    padding: 0;
    background-color: white;
    transition: max-height 0.4s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

/* Ensure smooth height transitions when content changes */
.checkout-page .section-content.expanded {
    transition: max-height 0.3s ease-in-out;
}

.checkout-page .section-content.expanded {
    /* max-height will be set inline by JavaScript for smooth animation */
}

.checkout-page .section-content.hidden {
    max-height: 0 !important;
    padding: 0;
}

.checkout-page .section-content form {
    padding: 20px;
}

/* Form Elements - NO custom validation colors */
.checkout-page .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.checkout-page .form-group {
    flex: 1;
    margin-bottom: 15px;
}

.checkout-page .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.checkout-page .form-group input,
.checkout-page .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    height: 42px;
    line-height: 1.5;
}

.checkout-page .form-group select {
    background-color: white;
    cursor: pointer;
    font-family: 'Dosis', sans-serif;
    color: #333;
    font-weight: normal;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}

.checkout-page .form-group input:focus,
.checkout-page .form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* NO custom validation colors - only basic Django/HTML5 error handling */
.checkout-page .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: normal;
}

/* Success message styling for real-time validation */
.checkout-page .success-message {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: normal;
}

/* Basic error styling for Django validation errors (not live validation) */
.checkout-page .form-group input.error,
.checkout-page .form-group select.error,
.checkout-page .form-group textarea.error {
    border-color: #dc3545;
}

/* Success styling for real-time validation */
.checkout-page .form-group input.success,
.checkout-page .form-group select.success,
.checkout-page .form-group textarea.success {
    border-color: #28a745;
}

/* Card validation specific messages */
.checkout-page .card-validation-message,
.checkout-page .expiry-validation-message,
.checkout-page .cvv-validation-message {
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: normal;
    display: block;
}

/* Credit card fields visibility controlled by JavaScript */
.checkout-page #credit-card-fields {
    display: none;
}

.checkout-page #billing-address-section {
    display: none;
}

.checkout-page #credit-card-fields .form-row {
    display: flex !important;
}

.checkout-page #credit-card-fields .form-group {
    display: block !important;
}

.checkout-page #credit-card-fields input {
    display: block !important;
    visibility: visible !important;
}

.checkout-page #credit-card-fields label {
    display: block !important;
    visibility: visible !important;
}

.checkout-page .error-summary {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    color: #721c24;
}

.checkout-page .error-summary ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.checkout-page .error-summary li {
    margin-bottom: 5px;
}

/* Form Actions */
.checkout-page .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.checkout-page .form-actions-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.checkout-page .btn-primary {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.checkout-page .btn-primary:hover {
    background-color: #0056b3;
}

.checkout-page .btn-secondary {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.checkout-page .btn-secondary:hover {
    background-color: #5a6268;
}

/* Completed button styling */
.checkout-page .btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.checkout-page .use-shipping-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.checkout-page .use-shipping-btn:hover {
    background-color: #0056b3;
}

/* Button states */
.checkout-page .btn-blue {
    background-color: #e9ecef !important;
    color: #333 !important;
    border: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.checkout-page .btn-blue:hover {
    background-color: #dee2e6 !important;
}

.checkout-page .btn-gray {
    background-color: #e9ecef !important;
    color: #333 !important;
    border: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.checkout-page .btn-gray:hover {
    background-color: #dee2e6 !important;
}

/* Complete Purchase button */
.checkout-page .checkout-btn {
    height: auto;
    line-height: normal;
    padding: 15px 30px;
    font-size: 20px;
    display: inline-block;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.checkout-page .checkout-btn:hover {
    background-color: #5a6268;
}

.checkout-page .checkout-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.checkout-page .checkout-btn:not(:disabled) {
    background-color: #28a745;
}

.checkout-page .checkout-btn:not(:disabled):hover {
    background-color: #218838;
}

/* ======================================== */
/* RESPONSIVE BREAKPOINTS FOR MOBILE */
/* ======================================== */

@media (max-width: 767px) {
    .checkout-page .cart-table .price-column {
        display: none !important;
    }
    .checkout-page .cart-table th.price-column {
        display: none !important;
    }
    .checkout-page .cart-table .item-name-column {
        width: 60% !important;
    }
    .checkout-page .cart-table .quantity-column {
        width: 20% !important;
    }
    .checkout-page .cart-table .total-column {
        width: 20% !important;
    }
    
    .checkout-page .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .checkout-page .section-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .checkout-page .section-status {
        width: 100%;
        justify-content: space-between;
    }
    
    .checkout-page .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .checkout-page .form-actions button {
        width: 100%;
    }
    
    .checkout-page .checkout-btn {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
        margin: 12px 0 0 0;
        display: block;
        border-radius: 8px;
    }
    
    .checkout-page .form-section {
        width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
    }
    
    .checkout-page form {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
    }
}

 