/* ===== CHECKOUT PAGE IMAGE FIX ===== */

/* Checkout Item Images */
.checkout-item {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px !important;
}

.checkout-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checkout-item-image {
    position: relative !important;
    flex-shrink: 0 !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    transition: all 0.3s ease !important;
}

.checkout-item-image:hover {
    transform: scale(1.05);
    border-color: var(--hijau, #28a745);
}

.checkout-item-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: block !important;
}

/* Fallback icon styling */
.checkout-item-image .fas {
    color: var(--hijau, #28a745) !important;
    font-size: 1.5rem !important;
    opacity: 0.7 !important;
}

/* Image loading state */
.checkout-item-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--hijau, #28a745);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkout-item-image.loading::before {
    opacity: 1;
}

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

/* Checkout item details */
.checkout-item-details {
    flex: 1;
    min-width: 0;
}

.checkout-item-details > div:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-item-price {
    flex-shrink: 0;
    min-width: 100px;
}

/* Payment image styling */
.payment-image-container {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.payment-image {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.payment-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Image error handling */
.checkout-item-image img[src=""],
.checkout-item-image img:not([src]) {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .checkout-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    
    .checkout-item > div:first-child {
        width: 100%;
    }
    
    .checkout-item-image {
        width: 50px !important;
        height: 50px !important;
    }
    
    .checkout-item-price {
        width: 100%;
        text-align: left !important;
        margin-top: 8px;
    }
    
    .payment-image {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .checkout-item-image {
        width: 40px !important;
        height: 40px !important;
    }
    
    .checkout-item-details > div:first-child {
        font-size: 0.9rem !important;
    }
    
    .checkout-item-details small {
        font-size: 0.8rem !important;
    }
    
    .payment-image {
        height: 100px;
    }
}

/* Enhanced order summary styling */
#order-items {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

/* Summary section improvements */
.summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.summary-item.total {
    border-top: 2px solid var(--hijau, #28a745);
    margin-top: 1rem;
    padding-top: 1rem;
    font-size: 1.1rem;
}

/* Button improvements */
.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

/* Terms styling */
.terms {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    border: 1px solid #e9ecef;
}

.terms a {
    color: var(--hijau, #28a745);
    text-decoration: none;
    font-weight: 600;
}

.terms a:hover {
    text-decoration: underline;
}

/* Loading states */
.checkout-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.checkout-item.loading .checkout-item-image {
    position: relative;
}

/* Accessibility improvements */
.checkout-item:focus-within {
    outline: 2px solid var(--hijau, #28a745);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .checkout-item-image {
        width: 30px !important;
        height: 30px !important;
    }
    
    .payment-image-container {
        display: none;
    }
    
    .btn {
        display: none;
    }
}