/**
 * Bean Merchant Shopify Sync - Vendor Styles
 * Minimal styles that complement WCVendors Pro's native styling
 */

/* CSS Variables (also defined in admin-styles.css for admin pages) */
:root {
    --bm-primary: #4A2C1D;
    --bm-border: #c3c4c7;
    --bm-radius: 4px;
    --bm-cream: #FFF8F0;
    --bm-gold: #F7B642;
}

/* Page Header */
.bm-shopify-connect .bm-page-header,
.bm-shopify-import .bm-page-header,
.bm-shopify-settings .bm-page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.bm-page-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    color: #2c1810;
}

.bm-page-header p {
    margin: 0;
    color: #666;
    font-size: 15px;
}

/* Connect Steps */
.bm-connect-steps {
    margin: 30px 0;
}

.bm-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.bm-step:last-child {
    border-bottom: none;
}

.bm-step-num {
    width: 32px;
    height: 32px;
    background: #d4a574;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.bm-step-content strong {
    display: block;
    margin-bottom: 4px;
    color: #2c1810;
}

.bm-step-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Agreement */
.bm-agreement {
    margin: 24px 0;
    padding: 16px;
    background: #f8f6f3;
    border-radius: 8px;
}

.bm-agreement label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.bm-agreement input[type="checkbox"] {
    margin-top: 3px;
}

.bm-agreement a {
    color: #d4a574;
}

/* Connect Action */
.bm-connect-action {
    margin-top: 24px;
}

.bm-connect-action .wcv-button {
    display: inline-block;
    padding: 14px 28px;
    background: #d4a574;
    color: #2c1810;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bm-connect-action .wcv-button:hover {
    background: #c09660;
}

/* Products Grid */
.bm-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bm-product-card {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bm-product-card:hover {
    border-color: #d4a574;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.bm-product-card.selected {
    border-color: #d4a574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.bm-product-card-image {
    aspect-ratio: 1;
    background: #f8f6f3;
}

.bm-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bm-product-card-body {
    padding: 14px;
}

.bm-product-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #2c1810;
    margin: 0 0 6px;
}

.bm-product-card-price {
    color: #d4a574;
    font-weight: 700;
}

/* Status Badges */
.bm-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.bm-status-available { background: #27ae60; }
.bm-status-pending { background: #f39c12; }
.bm-status-published { background: #3498db; }

/* Loading */
.bm-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.bm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e5e5;
    border-top-color: #d4a574;
    border-radius: 50%;
    animation: bm-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes bm-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   WCV Dashboard Layout Fix for Custom Pages
   ============================================ */

/* Ensure the dashboard wrapper uses flexbox like WCV Pro */
#wcv-dashboard.wcv-dashboard-wrapper {
    width: 100%;
}

#wcv-dashboard .wcv-cols-group {
    display: flex;
    flex-wrap: wrap;
}

/* Navigation sidebar */
#wcv-dashboard .wcv-dashboard-navigation {
    width: 100%;
}

/* Grid columns - match WCV Pro */
#wcv-dashboard .all-20 {
    flex: 0 0 20%;
    max-width: 20%;
}

#wcv-dashboard .all-80 {
    flex: 0 0 80%;
    max-width: 80%;
}

/* Responsive */
@media screen and (max-width: 768px) {
    #wcv-dashboard .small-100,
    #wcv-dashboard .tiny-100 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Navigation Menu Styles */
.wcv-navigation.vertical {
    display: block;
}

.wcv-navigation-menu.vertical {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcv-navigation-menu-item {
    margin: 0;
    padding: 0;
}

.wcv-navigation-menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.wcv-navigation-menu-item a:hover {
    background: #f5f5f5;
    border-left-color: #ddd;
}

.wcv-navigation-menu-item.is-active a,
.wcv-navigation-menu-item.current a {
    background: #f0f0f0;
    border-left-color: #0073aa;
    font-weight: 600;
}

.wcv-navigation-menu-item .wcv-icon {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* ============================================
   Shopify Import Page Styles
   ============================================ */

.bm-shopify-connect-page,
.bm-shopify-import-page,
.bm-shopify-settings-page {
    padding: 20px 0;
}

.bm-page-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.bm-page-header h1 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
}

.bm-page-header p {
    margin: 0;
    color: #666;
}

/* Cards / Boxes */
.bm-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.bm-card-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.bm-card-header h2,
.bm-card-header h3 {
    margin: 0;
    font-size: 18px;
}

/* Forms */
.bm-form-group {
    margin-bottom: 20px;
}

.bm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.bm-form-group input[type="text"],
.bm-form-group input[type="url"],
.bm-form-group input[type="password"],
.bm-form-group textarea,
.bm-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bm-form-group input:focus,
.bm-form-group textarea:focus,
.bm-form-group select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.bm-form-hint {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* Buttons */
.bm-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.bm-button:hover {
    background: #005a87;
    color: #fff;
}

.bm-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.bm-button-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.bm-button-danger {
    background: #d63638;
}

.bm-button-danger:hover {
    background: #b32d2e;
}

/* Notices */
.bm-notice {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.bm-notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bm-notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.bm-notice-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Status Badges */
.bm-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.bm-status-available {
    background: #d4edda;
    color: #155724;
}

.bm-status-pending {
    background: #fff3cd;
    color: #856404;
}

.bm-status-published {
    background: #cce5ff;
    color: #004085;
}

.bm-status-outofstock {
    background: #f8d7da;
    color: #721c24;
}

/* Variant Matching Table */
.bm-variant-match-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

.bm-variant-match-table th,
.bm-variant-match-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.bm-variant-match-table th {
    background: #f8f6f3;
    font-weight: 600;
    color: #2c1810;
}

.bm-match-status {
    font-weight: 500;
}

.bm-match-yes {
    color: #27ae60;
}

.bm-match-no {
    color: #e74c3c;
}

#bm-orphaned-warning {
    margin-top: 15px;
}

#bm-orphaned-warning ul {
    margin: 10px 0 0 20px;
}

/* Inline value mapping popup */
.bm-inline-popup {
    position: relative;
    margin: 10px 0;
    padding: 15px;
    background: #fff;
    border: 2px solid #d4a574;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
}

.bm-inline-popup h4 {
    margin: 0 0 10px;
    color: #2c1810;
}

.bm-inline-popup p {
    margin: 0 0 15px;
    color: #666;
}

.bm-inline-popup select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bm-popup-actions {
    display: flex;
    gap: 10px;
}

.bm-status-rejected-badge,
.bm-status-rejected {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca;
}

.bm-status-changes_requested-badge {
    background: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fde68a;
}

/* Mapping Popup Styles */
.bm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
}

.bm-mapping-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 100001;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bm-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.bm-popup-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.bm-popup-header h4 i {
    margin-right: 8px;
    color: #d4a574;
}

.bm-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.bm-popup-close:hover {
    color: #4b5563;
}

.bm-popup-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.bm-popup-body > p {
    margin: 0 0 16px;
    color: #4b5563;
}

.bm-mapping-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bm-mapping-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bm-mapping-option:hover {
    border-color: #d4a574;
    background: #fefcfb;
}

.bm-mapping-option input[type="radio"] {
    margin-right: 12px;
    accent-color: #d4a574;
}

.bm-mapping-option span {
    flex: 1;
    font-weight: 500;
}

.bm-mapping-option.bm-suggested {
    border-color: #d4a574;
    background: linear-gradient(135deg, #fefcfb 0%, #fef7f0 100%);
}

.bm-match-badge {
    background: #d4a574;
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.bm-no-values-notice {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.bm-no-values-notice p {
    margin: 0;
    color: #92400e;
    font-size: 13px;
}

.bm-no-values-notice i {
    margin-right: 6px;
}

.bm-manual-value-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.bm-manual-value-input:focus {
    outline: none;
    border-color: #d4a574;
}

.bm-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Toast notification */
.bm-toast-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    background: #1f2937;
    color: #ffffff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100002;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.bm-toast-notice.bm-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.bm-toast-success {
    background: #059669;
}

.bm-toast-success i {
    color: #fff;
}

/* Flavour Notes Styles */
.bm-flavour-selector {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 10px;
    background: var(--bm-cream);
}

.bm-checkbox-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.bm-add-flavours {
    padding-top: 15px;
    border-top: 1px solid var(--bm-border);
}

.bm-flavour-preview {
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: var(--bm-radius);
    border: 1px solid #c8e6c9;
}

.bm-flavour-preview .bm-flavour-tag {
    display: inline-block;
    background: var(--bm-gold);
    color: var(--bm-primary);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 12px;
    margin: 3px 5px 3px 0;
    font-weight: 500;
}

.bm-flavour-preview .bm-flavour-tag.bm-existing {
    background: #e0e0e0;
    color: #666;
    text-decoration: line-through;
}