/* 
 * Box Order Module Styles
 * @package mod_box_order
 */

.mod-box-order {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* max-width: 1200px; */
    margin: 0 auto;
    /* padding: 20px; */
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Header */
.box-order-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.box-order-header .module-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: bold;
    -webkit-text-fill-color: inherit !important;
    color: white;
}

.box-order-header .module-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* Box Selection Grid */
.box-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.box-type-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.box-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007cba;
}

.box-image {
    text-align: center;
    margin-bottom: 20px;
}

.box-img {
    max-width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8f9fa;
    padding: 15px;
}

.box-info {
    text-align: center;
    margin-bottom: 20px;
}

.box-name {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.box-details {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.box-dimensions, .box-weight {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.box-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 10px 0;
}

.box-price {
    font-size: 20px;
    font-weight: bold;
    color: #28a745;
    margin: 10px 0;
}

.box-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #007cba;
    background: white;
    color: #007cba;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover:not(:disabled) {
    background: #007cba;
    color: white;
    transform: scale(1.1);
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    background: white;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1c7f71 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Shopping Cart */
.shopping-cart {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.cart-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.cart-count {
    color: #007cba;
}

.clear-cart-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.clear-cart-btn:hover {
    background: #c82333;
}

.cart-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.cart-item-details {
    font-size: 14px;
    color: #666;
}

.cart-item-quantity {
    margin: 0 20px;
    font-weight: bold;
    color: #007cba;
}

.cart-item-price {
    font-weight: bold;
    color: #28a745;
}

.cart-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.cart-item-remove:hover {
    background: #c82333;
}

.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.cart-total {
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
}

.checkout-btn {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

/* Modal Styles */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.checkout-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    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: all 0.3s ease;
}

.modal-close:hover {
    background: #dee2e6;
    color: #2c3e50;
}

.modal-body {
    padding: 25px;
    box-sizing: border-box;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.form-group {
    margin-bottom: 20px;
    box-sizing: border-box;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #495057;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.order-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #218838 0%, #1c7f71 100%);
    transform: translateY(-1px);
}

/* Loading and Success States */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 10000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 10000;
    border-left: 4px solid #28a745;
}

.success-content h4 {
    color: #28a745;
    margin: 0 0 15px 0;
}

.btn-new-order {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.btn-new-order:hover {
    background: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mod-box-order {
        padding: 15px;
    }
    
    .box-types-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .box-type-card {
        padding: 20px;
    }
    
    .box-img {
        max-width: 120px;
        height: 120px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-item-quantity {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .box-order-header {
        padding: 15px;
    }
    
    .box-order-header .module-title {
        font-size: 22px;
    }
    
    .box-order-header .module-description {
        font-size: 14px;
    }
    
    .box-name {
        font-size: 20px;
    }
    
    .shopping-cart {
        padding: 15px;
    }
    
    .cart-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Box type specific colors */
.box-type-card[data-box-type="xxl"]:hover {
    border-color: #dc3545;
}

.box-type-card[data-box-type="half"]:hover {
    border-color: #28a745;
}

/* Weight Warning Modal Styles */
.weight-warning-modal .modal-content {
    max-width: 700px;
    width: 95%;
}

.warning-content {
    text-align: center;
}

.warning-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.warning-content h4 {
    color: #dc3545;
    margin: 0 0 15px 0;
    font-size: 24px;
}

.warning-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #495057;
}

.box-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin: 30px 0;
    align-items: center;
}

.box-option {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.xxl-option {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
}

.half-option {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff4 0%, #e6ffe6 100%);
}

.box-option h5 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: bold;
}

.box-option p {
    font-size: 14px;
    margin: 10px 0;
    color: #666;
}

.box-option .dimensions {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.vs-divider {
    font-size: 20px;
    font-weight: bold;
    color: #007cba;
    text-align: center;
    background: #007cba;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.replacement-suggestion {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #007cba;
    margin: 25px 0;
}

.replacement-suggestion h4 {
    color: #007cba;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.replacement-suggestion p {
    margin-bottom: 15px;
    text-align: left;
}

.replacement-calculation {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #007cba;
    font-size: 16px;
    color: #007cba;
}

.weight-warning-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.weight-warning-actions button {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 140px;
}

.btn-replace-boxes {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-replace-boxes:hover {
    background: linear-gradient(135deg, #218838 0%, #1c7f71 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-keep-xxl {
    background: linear-gradient(135deg, #007cba 0%, #0056b3 100%);
    color: white;
}

.btn-keep-xxl:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.weight-warning-actions .btn-cancel {
    background: #6c757d;
    color: white;
}

.weight-warning-actions .btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Mobile responsiveness for weight warning */
@media (max-width: 768px) {
    .box-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .vs-divider {
        transform: rotate(90deg);
        margin: 10px auto;
    }
    
    .weight-warning-actions {
        flex-direction: column;
    }
    
    .weight-warning-actions button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .weight-warning-modal .modal-content {
        width: 98%;
        margin: 10px;
    }
}