/* Himtong Vendor PromptPay - Checkout Styles */
/* Isolated styles to prevent theme conflicts */

.hvp-checkout-qr-section {
    background: #ffffff;
    padding: 0;
    margin: 30px auto 0 auto !important;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    overflow: visible;
    clear: both !important;
    width: 100% !important;
    max-width: 900px !important;
    box-sizing: border-box !important;
    float: none !important;
    position: relative !important;
}

.hvp-checkout-qr-section * {
    box-sizing: border-box !important;
}

.hvp-section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-bottom: none;
}

.hvp-section-header h3 {
    margin: 0 0 10px 0 !important;
    color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
}

.hvp-section-header h3 svg {
    color: #ffffff;
    margin-right: 10px;
    flex-shrink: 0;
}

.hvp-instructions {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    line-height: 1.6 !important;
}

.hvp-vendors-list {
    padding: 25px !important;
    display: block !important;
}

.hvp-vendor-qr-card {
    background: #f8f9fc;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px !important;
}

.hvp-vendor-qr-card:last-child {
    margin-bottom: 0 !important;
}

.hvp-card-header {
    background: #ffffff;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e2e8f0;
}

.hvp-vendor-badge {
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.hvp-vendor-badge svg {
    color: #667eea;
    margin-right: 8px;
    flex-shrink: 0;
}

.hvp-amount-badge {
    background: #10b981;
    color: white !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 15px;
}

/* Force white color for all text and elements inside amount badge */
.hvp-amount-badge,
.hvp-amount-badge *,
.hvp-amount-badge .woocommerce-Price-amount,
.hvp-amount-badge .amount,
.hvp-amount-badge bdi {
    color: white !important;
}

.hvp-card-body {
    padding: 25px !important;
    text-align: center !important;
}

.hvp-qr-container {
    margin-bottom: 20px !important;
}

.hvp-qr-wrapper {
    display: inline-block !important;
}

.hvp-checkout-qr-section .hvp-qr-image {
    width: 100% !important;
    max-width: 450px !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    border: 4px solid #667eea !important;
    border-radius: 12px !important;
    padding: 15px !important;
    background: white !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3) !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

.hvp-qr-overlay {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.hvp-promptpay-info {
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    text-align: left;
    max-width: 450px;
    margin: 0 auto;
}

.hvp-info-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-bottom: 5px;
}

.hvp-info-value {
    color: #1e293b;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
}

.hvp-qr-placeholder {
    padding: 30px 20px;
    background: #f8f9fc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    color: #94a3b8;
}

.hvp-qr-placeholder svg {
    opacity: 0.3;
    margin-bottom: 10px;
}

.hvp-qr-placeholder p {
    margin: 0;
    font-size: 14px;
}

.hvp-checkout-note {
    background: #fff;
    margin: 0;
    padding: 15px 20px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hvp-checkout-note svg {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 2px;
}

.hvp-checkout-note strong {
    color: #1e293b;
    margin-right: 4px;
}

.hvp-checkout-note em {
    color: #64748b;
    font-style: normal;
    line-height: 1.6;
    font-size: 13px;
}

/* Receipt Upload Section - Position after QR */
.hvp-receipt-upload-section {
    margin: 10px auto 30px auto !important;
    padding: 0 !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    border: 2px solid #e2e8f0 !important;
    clear: both !important;
    width: 100% !important;
    max-width: 900px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 1 !important;
}

.hvp-receipt-upload-section h2 {
    margin: 0 0 20px 0 !important;
    color: #1e293b !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

/* Force order details table to display below upload section */
.woocommerce-order-details {
    clear: both !important;
    margin-top: 30px !important;
    position: relative !important;
    z-index: 0 !important;
}

.woocommerce-order-details .woocommerce-table {
    width: 100% !important;
    margin-bottom: 20px !important;
}

/* Ensure no floating issues */
.woocommerce-thankyou-order-received {
    clear: both !important;
}

.woocommerce-order {
    clear: both !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hvp-vendors-list {
        padding: 20px !important;
    }
    
    .hvp-checkout-qr-section .hvp-qr-image {
        max-width: 380px !important;
    }
    
    .hvp-card-body {
        padding: 20px !important;
    }
    
    .hvp-section-header {
        padding: 20px !important;
    }
    
    .hvp-checkout-note {
        padding: 15px 20px !important;
        font-size: 13px !important;
    }
    
    .hvp-card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hvp-checkout-qr-section .hvp-qr-image {
        max-width: 320px !important;
    }
    
    .hvp-amount-badge {
        font-size: 14px;
        padding: 6px 14px;
    }
    
    .hvp-section-header h3 {
        font-size: 18px !important;
    }
    
    .hvp-vendors-list {
        padding: 15px !important;
    }
}

/* Vendor Upload Card Styles */
.hvp-vendor-upload-card {
    background: #f8f9fc;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px !important;
}

.hvp-vendor-upload-card:last-child {
    margin-bottom: 0 !important;
}

.hvp-vendor-upload-card .hvp-card-body {
    padding: 30px !important;
}

/* Upload Area Styles */
.hvp-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #ffffff;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hvp-upload-area:hover {
    border-color: #667eea;
    background: #f8f9fc;
}

.hvp-upload-area svg {
    color: #94a3b8;
    margin-bottom: 15px;
}

.hvp-upload-label {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0 5px 0 !important;
}

.hvp-upload-hint {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 15px 0 !important;
}

.hvp-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hvp-browse-button {
    background: #667eea !important;
    color: white !important;
    border: none !important;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.hvp-browse-button:hover {
    background: #5568d3 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.hvp-file-name {
    display: none;
    margin: 15px 0;
    padding: 10px 15px;
    background: #f1f5f9;
    border-radius: 6px;
    color: #475569;
    font-size: 14px;
    text-align: center;
}

.hvp-submit-button {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border: none !important;
    padding: 15px 24px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
}

.hvp-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.hvp-submit-button:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.hvp-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Receipt Uploaded State */
.hvp-receipt-uploaded {
    text-align: center;
}

.hvp-success-icon {
    margin-bottom: 15px;
}

.hvp-success-icon svg {
    color: #10b981;
}

.hvp-success-message {
    color: #10b981;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0 !important;
}

.hvp-receipt-preview {
    margin: 20px 0 !important;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hvp-receipt-preview img {
    max-width: 100%;
    max-height: 400px;
    display: block;
}

.hvp-pending-text {
    color: #f59e0b;
    font-size: 14px;
    font-style: italic;
    margin: 15px 0 0 0 !important;
}

/* Upload Messages */
.hvp-upload-message {
    margin-top: 15px;
}

.hvp-success-msg {
    background: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.hvp-error-msg {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

/* Single Vendor Cart Notice */
.woocommerce-error a,
.woocommerce-notice a {
    color: #667eea;
    text-decoration: underline;
    font-weight: 600;
}

.woocommerce-error a:hover,
.woocommerce-notice a:hover {
    color: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
    .hvp-vendor-qr-item {
        flex-direction: column;
        text-align: center;
    }
    
    .hvp-qr-code img {
        max-width: 150px;
    }
}
