/* ============================================ */
/* WHOLESALE SYSTEM STYLES */
/* ============================================ */

/* Wholesale back button */
.wholesale-back-btn {
    background: none;
    border: none;
    color: white; /* Changed to white */
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.wholesale-back-btn:hover {
    opacity: 0.7;
}

.wholesale-back-btn svg {
    width: 24px;
    height: 24px;
}

/* Wholesale header text - Same typography as category header */
.wholesale-header-text {
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: white; /* Changed to white */
    letter-spacing: 1px;
    position: absolute; /* Position absolutely to center it */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
}

@media (min-width: 768px) {
    .wholesale-header-text {
        font-size: 18px;
    }
}

/* Wholesale badge on product cards - Same design as discount badge */
.wholesale-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(45deg, #1e8449, #27ae60, #229954, #1e8449);
    background-size: 300% 300%;
    color: white;
    font-weight: bold;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Mobile adjustments for wholesale badge */
@media (max-width: 768px) {
    .wholesale-badge {
        font-size: 0.6rem;
        padding: 3px 6px;
        top: 0.5rem;
        left: 0.5rem;
    }
}

/* Wholesale price display */
.wholesale-price-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wholesale-price {
    font-size: 18px;
    font-weight: 700;
    color: #ff6b6b;
}

.retail-price-crossed {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

/* Wholesale cart grouping */
.wholesale-cart-group {
    margin-bottom: 20px;
}

.wholesale-cart-group-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.wholesale-minimum-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
    border-left: 4px solid #ffc107;
}

.wholesale-minimum-met {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
    border-left: 4px solid #28a745;
}

/* Wholesale totals in cart */
.wholesale-totals-section {
    border-top: 2px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.wholesale-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.wholesale-total-row.main {
    font-size: 16px;
    font-weight: bolder;
}

.wholesale-total-row.retail {
    font-weight: lighter;
}

.wholesale-total-row.saved {
    font-weight: lighter;
}

/* Wholesale admin modal */
.wholesale-admin-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow: hidden;
}

.wholesale-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.wholesale-admin-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.wholesale-add-btn {
    background: #ff8c00;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.wholesale-add-btn:hover {
    background: #e67c00;
}

.wholesale-discount-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wholesale-discount-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.wholesale-discount-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wholesale-discount-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.wholesale-discount-value {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wholesale-discount-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.wholesale-discount-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.wholesale-discount-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.wholesale-save-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.wholesale-save-btn:hover {
    background: #218838;
}

.wholesale-delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.wholesale-delete-btn:hover {
    background: #c82333;
}

.wholesale-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.wholesale-empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.wholesale-empty-state-text {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .wholesale-admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wholesale-add-btn {
        width: 100%;
    }
    
    .wholesale-discount-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .wholesale-discount-actions {
        justify-content: stretch;
    }
    
    .wholesale-save-btn,
    .wholesale-delete-btn {
        flex: 1;
    }
    
    .wholesale-header-text {
        font-size: 20px;
    }
}

/* Dark mode support */
body.dark-mode .wholesale-admin-container {
    background: #2d2d2d;
}

body.dark-mode .wholesale-admin-title {
    color: #fff;
}

body.dark-mode .wholesale-discount-item {
    background: #3d3d3d;
    border-color: #4d4d4d;
}

body.dark-mode .wholesale-discount-input,
body.dark-mode .wholesale-discount-select {
    background: #2d2d2d;
    color: #fff;
    border-color: #4d4d4d;
}

body.dark-mode .wholesale-discount-label {
    color: #ccc;
}


/* ============================================ */
/* WHOLESALE ADMIN SECTION */
/* ============================================ */

.wholesale-section-global {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wholesale-section-global h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.wholesale-list {
    margin-top: 15px;
}

.wholesale-discount-value {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 600;
    color: #333;
}

/* Dark mode for admin section */
body.dark-mode .wholesale-section-global {
    background: #2d2d2d;
}

body.dark-mode .wholesale-section-global h3 {
    color: #fff;
}

body.dark-mode .wholesale-discount-value {
    background: #3d3d3d;
    color: #fff;
}

/* Hide navigation bar in wholesale mode */
body.wholesale-mode .navigation-bar {
    display: none !important;
}
