/* Bayi Panel - Frontend Styles */

/* Registration form */
.bayi-registration-wrapper {
    margin-bottom: 10px;
}

.bayi-registration-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    appearance: auto;
}

#bayi-fields-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    animation: bayiFadeIn 0.3s ease;
}

@keyframes bayiFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

#bayi-fields-container .form-row {
    margin-bottom: 12px;
}

#bayi-fields-container label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    display: block;
    color: #374151;
}

#bayi-fields-container input[type="text"],
#bayi-fields-container input[type="tel"],
#bayi-fields-container input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

#bayi-fields-container input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

#bayi-fields-container input[type="file"]:hover {
    border-color: #2271b1;
}

#bayi-fields-container .description {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Standalone Bayi Registration Form */
.bayi-standalone-form-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bayi-form-header {
    margin-bottom: 20px;
    text-align: center;
}

.bayi-form-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a2744;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.bayi-form-header p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.bayi-standalone-form .bayi-form-field {
    margin-bottom: 14px;
}

.bayi-standalone-form .bayi-form-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 5px;
}

.bayi-standalone-form .bayi-form-field label .required {
    color: #ef4444;
}

.bayi-standalone-form .bayi-form-field input[type="text"],
.bayi-standalone-form .bayi-form-field input[type="email"],
.bayi-standalone-form .bayi-form-field input[type="tel"],
.bayi-standalone-form .bayi-form-field input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.bayi-standalone-form .bayi-form-field input:focus {
    border-color: #1a2744;
    box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.1);
    outline: none;
}

.bayi-standalone-form .bayi-form-field input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background: #fafbfc;
    cursor: pointer;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.bayi-standalone-form .bayi-form-field input[type="file"]:hover {
    border-color: #1a2744;
}

.bayi-form-hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.bayi-form-row {
    display: flex;
    gap: 12px;
}

.bayi-form-field--half {
    flex: 1;
    min-width: 0;
}

.bayi-form-field--checkbox {
    margin-top: 4px;
}

.bayi-form-field--checkbox label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    font-size: 13px !important;
    color: #4b5563 !important;
    cursor: pointer;
}

.bayi-form-field--checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #1a2744;
}

.bayi-form-field--checkbox a {
    color: #1a2744;
    font-weight: 600;
    text-decoration: underline;
}

.bayi-form-submit {
    display: block;
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, #1a2744 0%, #2d4373 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 18px;
    letter-spacing: 0.3px;
    text-transform: none;
}

.bayi-form-submit:hover {
    background: linear-gradient(135deg, #0f1a2e 0%, #1a2744 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 39, 68, 0.3);
}

.bayi-form-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.bayi-form-notice p {
    margin: 0 0 4px;
}

.bayi-form-notice p:last-child {
    margin-bottom: 0;
}

.bayi-form-notice--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.bayi-form-notice--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.bayi-form-notice--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.bayi-form-notice a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 480px) {
    .bayi-form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Bayi price badge on product page */
.bayi-price-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    animation: bayiBadgeFadeIn 0.4s ease-out;
}

.bayi-price-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.08;
    pointer-events: none;
}

@keyframes bayiBadgeFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bayi-price-badge__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bayi-price-badge__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bayi-price-badge__text strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.bayi-price-badge__text span {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 400;
    line-height: 1.4;
}

.bayi-price-badge--approved {
    background: linear-gradient(135deg, #0d9f6e 0%, #047857 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(5, 120, 87, 0.25), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.bayi-price-badge--approved .bayi-price-badge__icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.bayi-price-badge--pending {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.bayi-price-badge--pending .bayi-price-badge__icon {
    background: rgba(120, 53, 15, 0.12);
    color: #78350f;
}

@media (max-width: 480px) {
    .bayi-price-badge {
        padding: 12px 14px;
        gap: 10px;
    }
    .bayi-price-badge__icon {
        width: 36px;
        height: 36px;
    }
    .bayi-price-badge__text strong {
        font-size: 14px;
    }
    .bayi-price-badge__text span {
        font-size: 12px;
    }
}

/* ========== Bulk Order ========== */
.bayi-bulk-order-wrap h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a2744;
    margin: 0 0 4px;
}

.bayi-bulk-desc {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 20px;
}

.bayi-bulk-search-box {
    position: relative;
    margin-bottom: 20px;
}

.bayi-bulk-search-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.bayi-bulk-search-box input:focus {
    border-color: #1a2744;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 39, 68, 0.1);
}

.bayi-bulk-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 350px;
    overflow-y: auto;
}

.bayi-bulk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: default;
    transition: background 0.15s;
}

.bayi-bulk-item:hover {
    background: #f9fafb;
}

.bayi-bulk-item:last-child {
    border-bottom: none;
}

.bayi-bulk-item--added {
    opacity: 0.6;
}

.bayi-bulk-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.bayi-bulk-item-info {
    flex: 1;
    min-width: 0;
}

.bayi-bulk-item-info strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bayi-bulk-item-info span {
    font-size: 12px;
    color: #6b7280;
}

.bayi-bulk-item-add {
    flex-shrink: 0;
}

.bayi-bulk-item-added {
    font-size: 12px;
    color: #047857;
    font-weight: 600;
    flex-shrink: 0;
}

.bayi-bulk-no-result {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.bayi-bulk-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.bayi-bulk-table thead th {
    background: #f9fafb;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
}

.bayi-bulk-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: middle;
}

.bayi-bulk-table tbody tr:hover {
    background: #f9fafb;
}

.bayi-bulk-table tfoot td {
    padding: 12px;
    border-top: 2px solid #e5e7eb;
    font-size: 15px;
}

.bayi-bulk-qty {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.bayi-bulk-remove {
    background: none;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 18px;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.bayi-bulk-remove:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.bayi-bulk-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.bayi-bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0;
}

.bayi-bulk-status {
    font-size: 14px;
}

@media (max-width: 600px) {
    .bayi-bulk-table thead { display: none; }
    .bayi-bulk-table tbody td { display: block; text-align: right; padding: 6px 12px; }
    .bayi-bulk-table tbody td::before { content: attr(data-label); float: left; font-weight: 600; }
}
